diff options
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index afc8309..42f344a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -9726,7 +9726,6 @@ create_breakpoint (struct gdbarch *gdbarch, unsigned flags) { struct linespec_result canonical; - struct cleanup *old_chain; struct cleanup *bkpt_chain = NULL; int pending = 0; int task = 0; @@ -9738,8 +9737,6 @@ create_breakpoint (struct gdbarch *gdbarch, if (extra_string != NULL && *extra_string == '\0') extra_string = NULL; - init_linespec_result (&canonical); - TRY { ops->create_sals_from_location (location, &canonical, type_wanted); @@ -9779,9 +9776,6 @@ create_breakpoint (struct gdbarch *gdbarch, if (!pending && VEC_empty (linespec_sals, canonical.sals)) return 0; - /* Create a chain of things that always need to be cleaned up. */ - old_chain = make_cleanup_destroy_linespec_result (&canonical); - /* ----------------------------- SNIP ----------------------------- Anything added to the cleanup chain beyond this point is assumed to be part of a breakpoint. If the breakpoint create succeeds @@ -9922,8 +9916,6 @@ create_breakpoint (struct gdbarch *gdbarch, /* That's it. Discard the cleanups for data inserted into the breakpoint. */ discard_cleanups (bkpt_chain); - /* But cleanup everything else. */ - do_cleanups (old_chain); /* error call may happen here - have BKPT_CHAIN already discarded. */ update_global_location_list (UGLL_MAY_INSERT); @@ -10372,13 +10364,10 @@ break_range_command (char *arg, int from_tty) if (arg == NULL || arg[0] == '\0') error(_("No address range specified.")); - init_linespec_result (&canonical_start); - arg_start = arg; event_location_up start_location = string_to_event_location (&arg, current_language); parse_breakpoint_sals (start_location.get (), &canonical_start); - cleanup_bkpt = make_cleanup_destroy_linespec_result (&canonical_start); if (arg[0] != ',') error (_("Too few arguments.")); @@ -10393,14 +10382,13 @@ break_range_command (char *arg, int from_tty) sal_start = lsal_start->sals.sals[0]; addr_string_start = savestring (arg_start, arg - arg_start); - make_cleanup (xfree, addr_string_start); + cleanup_bkpt = make_cleanup (xfree, addr_string_start); arg++; /* Skip the comma. */ arg = skip_spaces (arg); /* Parse the end location. */ - init_linespec_result (&canonical_end); arg_start = arg; /* We call decode_line_full directly here instead of using @@ -10414,8 +10402,6 @@ break_range_command (char *arg, int from_tty) sal_start.symtab, sal_start.line, &canonical_end, NULL, NULL); - make_cleanup_destroy_linespec_result (&canonical_end); - if (VEC_empty (linespec_sals, canonical_end.sals)) error (_("Could not find location of the end of the range.")); @@ -14487,7 +14473,6 @@ decode_location_default (struct breakpoint *b, { struct linespec_result canonical; - init_linespec_result (&canonical); decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, search_pspace, (struct symtab *) NULL, 0, &canonical, multiple_symbols_all, @@ -14506,8 +14491,6 @@ decode_location_default (struct breakpoint *b, contents. */ lsal->sals.sals = NULL; } - - destroy_linespec_result (&canonical); } /* Prepare the global context for a re-set of breakpoint B. */ |