From patchwork Wed Jan 9 03:34:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 31010 Received: (qmail 47859 invoked by alias); 9 Jan 2019 03:36:00 -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 47839 invoked by uid 89); 9 Jan 2019 03:36:00 -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=Resolve X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.67.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jan 2019 03:35:58 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 4F5E040EED535 for ; Tue, 8 Jan 2019 21:34:29 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id h4dRgogc8iQerh4dRgqDO6; Tue, 08 Jan 2019 21:34:29 -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=0hQ/92l3cjTMUIkIAmil6oB7WG/9lwE8XuiZ83rP/UI=; b=tBqLRakl9jUmmUlKkuJjjt0aMX nbxh5c6+Gxe1x99Hk8MaS3MfcB4n/aaVcVzfzX5Yuzk1ceKE12dDTHBVBHVdV5BZzWHcDs3uVb7kU nicozJeCKpq9q/nKnBd80X6Ah; Received: from 75-166-72-210.hlrn.qwest.net ([75.166.72.210]:47026 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gh4dR-000HG2-3m; Tue, 08 Jan 2019 21:34:29 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 02/12] Remove remaining cleanup from breakpoint.c Date: Tue, 8 Jan 2019 20:34:16 -0700 Message-Id: <20190109033426.16062-3-tom@tromey.com> In-Reply-To: <20190109033426.16062-1-tom@tromey.com> References: <20190109033426.16062-1-tom@tromey.com> The remaining null cleanup in breakpoint.c does not seem to protect anything, so remove it. gdb/ChangeLog 2019-01-08 Tom Tromey * breakpoint.c (create_breakpoint): Remove cleanup. --- gdb/ChangeLog | 4 ++++ gdb/breakpoint.c | 11 ----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 24ba4071ff..3acb5145b9 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9236,7 +9236,6 @@ create_breakpoint (struct gdbarch *gdbarch, unsigned flags) { struct linespec_result canonical; - struct cleanup *bkpt_chain = NULL; int pending = 0; int task = 0; int prev_bkpt_count = breakpoint_count; @@ -9286,12 +9285,6 @@ create_breakpoint (struct gdbarch *gdbarch, if (!pending && canonical.lsals.empty ()) return 0; - /* ----------------------------- SNIP ----------------------------- - Anything added to the cleanup chain beyond this point is assumed - to be part of a breakpoint. If the breakpoint create succeeds - then the memory is not reclaimed. */ - bkpt_chain = make_cleanup (null_cleanup, 0); - /* Resolve all line numbers to PC's and verify that the addresses are ok for the target. */ if (!pending) @@ -9390,10 +9383,6 @@ create_breakpoint (struct gdbarch *gdbarch, prev_breakpoint_count = prev_bkpt_count; } - /* That's it. Discard the cleanups for data inserted into the - breakpoint. */ - discard_cleanups (bkpt_chain); - /* error call may happen here - have BKPT_CHAIN already discarded. */ update_global_location_list (UGLL_MAY_INSERT);