From patchwork Wed Feb 13 21:29:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31450 Received: (qmail 18655 invoked by alias); 13 Feb 2019 21:29:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 18272 invoked by uid 89); 13 Feb 2019 21:29:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=utilities, Hx-languages-length:1724 X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Feb 2019 21:29:35 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id B9FAE42292 for ; Wed, 13 Feb 2019 15:29:33 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id u261gBZI82PzOu261gg2Bd; Wed, 13 Feb 2019 15:29:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eVs85s74d8jZwbKBq7ceOVA7PH1TWl7A9dez+agOJnU=; b=E+HBT50OhhL/HhjYjUi3lHElMt EPD3QeF6jwxwFN5fLuCOB3yeQIdBKMjYZnKCb5jPEH4J6QuHgyPNOSu1DMd4aKDq2UAP2dWP1CUOd ZB50aZnxqIgSoTLXFx+LCOZPS; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:42554 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gu261-001UWe-Hn; Wed, 13 Feb 2019 15:29:33 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 12/20] Remove free_current_contents Date: Wed, 13 Feb 2019 14:29:19 -0700 Message-Id: <20190213212927.9474-13-tom@tromey.com> In-Reply-To: <20190213212927.9474-1-tom@tromey.com> References: <20190213212927.9474-1-tom@tromey.com> free_current_contents is no longer used, so this patch removes it. gdb/ChangeLog 2019-02-13 Tom Tromey * utils.h (free_current_contents): Don't declare. * utils.c (free_current_contents): Remove. --- gdb/ChangeLog | 5 +++++ gdb/utils.c | 29 ----------------------------- gdb/utils.h | 2 -- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/gdb/utils.c b/gdb/utils.c index 6fb5736abb5..272fe268fef 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -126,35 +126,6 @@ show_pagination_enabled (struct ui_file *file, int from_tty, } -/* Cleanup utilities. - - These are not defined in cleanups.c (nor declared in cleanups.h) - because while they use the "cleanup API" they are not part of the - "cleanup API". */ - -/* This function is useful for cleanups. - Do - - foo = xmalloc (...); - old_chain = make_cleanup (free_current_contents, &foo); - - to arrange to free the object thus allocated. */ - -void -free_current_contents (void *ptr) -{ - void **location = (void **) ptr; - - if (location == NULL) - internal_error (__FILE__, __LINE__, - _("free_current_contents: NULL pointer")); - if (*location != NULL) - { - xfree (*location); - *location = NULL; - } -} - /* Print a warning message. The first argument STRING is the warning diff --git a/gdb/utils.h b/gdb/utils.h index 896feb973c9..30cf02f16c4 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -260,8 +260,6 @@ struct htab_deleter /* A unique_ptr wrapper for htab_t. */ typedef std::unique_ptr htab_up; -extern void free_current_contents (void *); - extern void init_page_info (void); /* Temporarily set BATCH_FLAG and the associated unlimited terminal size.