aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-01-23 18:58:31 +0000
committerPedro Alves <palves@redhat.com>2019-01-23 19:04:48 +0000
commit89f8fb50fa16b0ef510dcd6de9088cee9820116d (patch)
treeb214231dcdc1c2a021d405bad37e9ded9a5b2e4f /gdb
parent5419bdae559360a10044983b06c11a31de8d81f4 (diff)
downloadgdb-89f8fb50fa16b0ef510dcd6de9088cee9820116d.zip
gdb-89f8fb50fa16b0ef510dcd6de9088cee9820116d.tar.gz
gdb-89f8fb50fa16b0ef510dcd6de9088cee9820116d.tar.bz2
Remove remaining cleanup from gdb/breakpoint.c
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: 2019-01-23 Tom Tromey <tom@tromey.com> Pedro Alves <palves@redhat.com> * breakpoint.c (create_breakpoint): Remove cleanup.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/breakpoint.c12
2 files changed, 5 insertions, 12 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 55acd81..a400cbc 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,4 +1,9 @@
2019-01-23 Tom Tromey <tom@tromey.com>
+ Pedro Alves <palves@redhat.com>
+
+ * breakpoint.c (create_breakpoint): Remove cleanup.
+
+2019-01-23 Tom Tromey <tom@tromey.com>
Andrew Burgess <andrew.burgess@embecosm.com>
Pedro Alves <palves@redhat.com>
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 999809c..33c5bfe 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;