+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
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 ()
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. */
case bp_finish:
case bp_longjmp:
case bp_longjmp_resume:
+ case bp_call_dummy:
delete_breakpoint (b);
break;
}
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));
\f
/* This bpstat_what stuff tells wait_for_inferior what to do with a
breakpoint (a challenging task). */
extern void
mark_breakpoints_out PARAMS ((void));
+extern void
+breakpoint_init_inferior PARAMS ((void));
+
extern void
delete_breakpoint PARAMS ((struct breakpoint *));
}
\f
/* 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)
{
inferior_pid = 0;
attach_flag = 0;
- mark_breakpoints_out ();
+ breakpoint_init_inferior ();
registers_changed ();
#ifdef CLEAR_DEFERRED_STORES
#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 ();
trap_expected_after_continue = 0;
breakpoints_inserted = 0;
- mark_breakpoints_out ();
+ breakpoint_init_inferior ();
stop_signal = 0; /* Don't confuse first call to proceed(). */
}
error ("Downloading format not defined\n");
}
- mark_breakpoints_out ();
+ breakpoint_init_inferior ();
inferior_pid = 0;
if (from_tty)
{