This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v3 07/17] Remove remaining cleanup from gdb/breakpoint.c
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>, Andrew Burgess <andrew dot burgess at embecosm dot com>
- Date: Wed, 23 Jan 2019 15:21:21 +0000
- Subject: [PATCH v3 07/17] Remove remaining cleanup from gdb/breakpoint.c
- References: <20190123152131.29893-1-palves@redhat.com>
From: Tom Tromey <tom@tromey.com>
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 <tom@tromey.com>
Pedro Alves <palves@redhat.com>
* 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;
--
2.14.4