* 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.
This commit is contained in:
Jim Kingdon 1993-10-07 11:16:35 +00:00
parent f5ebb9ea78
commit cf3e377e61
7 changed files with 44 additions and 19 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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 *));

View File

@ -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)

View File

@ -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 ();

View File

@ -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(). */
}

View File

@ -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)
{