From patchwork Wed Jan 23 15:21:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 31184 Received: (qmail 64579 invoked by alias); 23 Jan 2019 15:21: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 64437 invoked by uid 89); 23 Jan 2019 15:21:43 -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, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1713 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jan 2019 15:21:42 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 520ADC03BC9B; Wed, 23 Jan 2019 15:21:41 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73BDD67141; Wed, 23 Jan 2019 15:21:40 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey , Andrew Burgess Subject: [PATCH v3 07/17] Remove remaining cleanup from gdb/breakpoint.c Date: Wed, 23 Jan 2019 15:21:21 +0000 Message-Id: <20190123152131.29893-8-palves@redhat.com> In-Reply-To: <20190123152131.29893-1-palves@redhat.com> References: <20190123152131.29893-1-palves@redhat.com> From: Tom Tromey In v3: remove the "have BKPT_CHAIN already discarded" comment too. The remaining null cleanup in breakpoint.c does not seem to protect anything, so remove it. gdb/ChangeLog: yyyy-mm-dd Tom Tromey Pedro Alves * breakpoint.c (create_breakpoint): Remove cleanup. --- gdb/breakpoint.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 999809c312..33c5bfef43 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9230,7 +9230,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; @@ -9280,12 +9279,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) @@ -9384,11 +9377,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); return 1;