From: Jim Kingdon Date: Thu, 7 Oct 1993 11:16:35 +0000 (+0000) Subject: * breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf3e377e61e7861677252feb4d06ba8fcea1e5c1;p=binutils-gdb.git * breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function that clears the `inserted' flag for all breakpoints and deletes any breakpoints which should go away between runs of programs. * inflow.c (generic_mourn_inferior), infrun.c (init_wait_for_inferior), remote-es.c (es1800_load), comments in exec.c and corelow.c: Use it instead of mark_breakpoints_out. * breakpoint.c (mark_breakpoints_out): Update comment, tm-rs6000.h uses it in a completely different context. * breakpoint.c (breakpoint_re_set_one): Add bp_call_dummy case. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7333f919f0f..38a50f1499d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,15 @@ +Thu Oct 07 09:29:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function + that clears the `inserted' flag for all breakpoints and deletes + any breakpoints which should go away between runs of programs. + * inflow.c (generic_mourn_inferior), infrun.c (init_wait_for_inferior), + remote-es.c (es1800_load), comments in exec.c and corelow.c: + Use it instead of mark_breakpoints_out. + * breakpoint.c (mark_breakpoints_out): Update comment, tm-rs6000.h + uses it in a completely different context. + * breakpoint.c (breakpoint_re_set_one): Add bp_call_dummy case. + Thu Oct 07 09:29:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * Makefile.in (REGEX, REGEX1): Always use our own version of diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ee5cf541d69..2db375340eb 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -505,8 +505,7 @@ remove_breakpoints () return 0; } -/* Clear the "inserted" flag in all breakpoints. - This is done when the inferior is loaded. */ +/* Clear the "inserted" flag in all breakpoints. */ void mark_breakpoints_out () @@ -517,6 +516,26 @@ mark_breakpoints_out () b->inserted = 0; } +/* Clear the "inserted" flag in all breakpoints and delete any breakpoints + which should go away between runs of the program. */ + +void +breakpoint_init_inferior () +{ + register struct breakpoint *b, *temp; + + ALL_BREAKPOINTS_SAFE (b, temp) + { + b->inserted = 0; + + /* If the call dummy breakpoint is at the entry point it will + cause problems when the inferior is rerun, so we better + get rid of it. */ + if (b->type == bp_call_dummy) + delete_breakpoint (b); + } +} + /* breakpoint_here_p (PC) returns 1 if an enabled breakpoint exists at PC. When continuing from a location with a breakpoint, we actually single step once before calling insert_breakpoints. */ @@ -2709,6 +2728,7 @@ breakpoint_re_set_one (bint) case bp_finish: case bp_longjmp: case bp_longjmp_resume: + case bp_call_dummy: delete_breakpoint (b); break; } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 8317dd3886b..589915d32b9 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -156,11 +156,8 @@ extern void bpstat_clear PARAMS ((bpstat *)); is part of the bpstat is copied as well. */ extern bpstat bpstat_copy PARAMS ((bpstat)); -/* Get a bpstat associated with having just stopped at address *PC - and frame address FRAME_ADDRESS. Update *PC to point at the - breakpoint (if we hit a breakpoint). */ /* FIXME: prototypes uses equivalence between FRAME_ADDR and CORE_ADDR */ -extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, CORE_ADDR)); +extern bpstat bpstat_stop_status PARAMS ((CORE_ADDR *, CORE_ADDR, int)); /* This bpstat_what stuff tells wait_for_inferior what to do with a breakpoint (a challenging task). */ @@ -316,6 +313,9 @@ set_default_breakpoint PARAMS ((int, CORE_ADDR, struct symtab *, int)); extern void mark_breakpoints_out PARAMS ((void)); +extern void +breakpoint_init_inferior PARAMS ((void)); + extern void delete_breakpoint PARAMS ((struct breakpoint *)); diff --git a/gdb/corelow.c b/gdb/corelow.c index a30f2c3089b..1e803efea3a 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -291,7 +291,7 @@ core_files_info (t) } /* If mourn is being called in all the right places, this could be say - `gdb internal error' (since generic_mourn calls mark_breakpoints_out). */ + `gdb internal error' (since generic_mourn calls breakpoint_init_inferior). */ static int ignore (addr, contents) diff --git a/gdb/inflow.c b/gdb/inflow.c index fddfe84db5b..b4844662dd5 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -469,7 +469,7 @@ generic_mourn_inferior () { inferior_pid = 0; attach_flag = 0; - mark_breakpoints_out (); + breakpoint_init_inferior (); registers_changed (); #ifdef CLEAR_DEFERRED_STORES @@ -478,15 +478,8 @@ generic_mourn_inferior () #endif reopen_exec_file (); - flush_cached_frames (); - if (target_has_stack) { - set_current_frame ( create_new_frame (read_register (FP_REGNUM), - read_pc ())); - select_frame (get_current_frame (), 0); - } else { - set_current_frame (0); - select_frame ((FRAME) 0, -1); - } + reinit_frame_cache (); + /* It is confusing to the user for ignore counts to stick around from previous runs of the inferior. So clear them. */ breakpoint_clear_ignore_counts (); diff --git a/gdb/infrun.c b/gdb/infrun.c index 409a768cf0d..37447334eb0 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -447,7 +447,7 @@ init_wait_for_inferior () trap_expected_after_continue = 0; breakpoints_inserted = 0; - mark_breakpoints_out (); + breakpoint_init_inferior (); stop_signal = 0; /* Don't confuse first call to proceed(). */ } diff --git a/gdb/remote-es.c b/gdb/remote-es.c index e9108169b54..66a62dae3df 100644 --- a/gdb/remote-es.c +++ b/gdb/remote-es.c @@ -1430,7 +1430,7 @@ es1800_load (filename, from_tty) error ("Downloading format not defined\n"); } - mark_breakpoints_out (); + breakpoint_init_inferior (); inferior_pid = 0; if (from_tty) {