b->inserted = 0;
#ifdef BREAKPOINT_DEBUG
printf ("Removed breakpoint at %s",
- local_hex_string(b->address));
+ local_hex_string((unsigned long) b->address));
printf (", shadow %s",
- local_hex_string(b->shadow_contents[0]));
+ local_hex_string((unsigned long) b->shadow_contents[0]));
printf (", %s.\n",
- local_hex_string(b->shadow_contents[1]));
+ local_hex_string((unsigned long) b->shadow_contents[1]));
#endif /* BREAKPOINT_DEBUG */
}
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. */
{
/* We use value_{,free_to_}mark because it could be a
*long* time before we return to the command level and
- call free_all_values. */
- /* But couldn't we just call free_all_values instead? */
+ call free_all_values. We can't call free_all_values because
+ we might be in the middle of evaluating a function call. */
value mark = value_mark ();
value new_val = evaluate_expression (bs->breakpoint_at->exp);
return -1;
}
+/* 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). NOT_A_BREAKPOINT is nonzero
+ if this is known to not be a real breakpoint (it could still be a
+ watchpoint, though). */
+
/* Determine whether we stopped at a breakpoint, etc, or whether we
don't understand this stop. Result is a chain of bpstat's such that:
if we don't understand the stop, the result is a null pointer.
- if we understand why we stopped, the result is not null, and
- the first element of the chain contains summary "stop" and
- "print" flags for the whole chain.
+ if we understand why we stopped, the result is not null.
Each element of the chain refers to a particular breakpoint or
watchpoint at which we have stopped. (We may have stopped for
*/
-
bpstat
-bpstat_stop_status (pc, frame_address)
+bpstat_stop_status (pc, frame_address, not_a_breakpoint)
CORE_ADDR *pc;
FRAME_ADDR frame_address;
+ int not_a_breakpoint;
{
register struct breakpoint *b;
CORE_ADDR bp_addr;
if (b->type != bp_watchpoint && b->address != bp_addr)
continue;
+ if (b->type != bp_watchpoint && not_a_breakpoint)
+ continue;
+
/* Come here if it's a watchpoint, or if the break address matches */
bs = bpstat_alloc (b, bs); /* Alloc a bpstat to explain stop */
{
*pc = bp_addr;
#if defined (SHIFT_INST_REGS)
- {
- CORE_ADDR pc = read_register (PC_REGNUM);
- CORE_ADDR npc = read_register (NPC_REGNUM);
- if (pc != npc)
- {
- write_register (NNPC_REGNUM, npc);
- write_register (NPC_REGNUM, pc);
- }
- }
+ SHIFT_INST_REGS();
#else /* No SHIFT_INST_REGS. */
write_pc (bp_addr);
#endif /* No SHIFT_INST_REGS. */
enum bpstat_what_main_action current_action = BPSTAT_WHAT_KEEP_CHECKING;
struct bpstat_what retval;
+ retval.call_dummy = 0;
+ retval.step_resume = 0;
for (; bs != NULL; bs = bs->next)
{
enum class bs_class = no_effect;
case bp_step_resume:
case bp_call_dummy:
if (addressprint)
- printf_filtered ("%s ", local_hex_string_custom(b->address, "08"));
+ printf_filtered ("%s ", local_hex_string_custom ((unsigned long) b->address, "08l"));
last_addr = b->address;
if (b->source_file)
if (b->frame)
printf_filtered ("\tstop only in stack frame at %s\n",
- local_hex_string(b->frame));
+ local_hex_string((unsigned long) b->frame));
if (b->cond)
{
printf_filtered ("\tstop only if ");
(b->enable == disabled) ? " (disabled)" : "",
(others > 1) ? "," : ((others == 1) ? " and" : ""));
}
- printf ("also set at pc %s.\n", local_hex_string(pc));
+ printf ("also set at pc %s.\n", local_hex_string((unsigned long) pc));
}
}
\f
break;
case bp_breakpoint:
printf_filtered ("Breakpoint %d at %s", b->number,
- local_hex_string(b->address));
+ local_hex_string((unsigned long) b->address));
if (b->source_file)
printf_filtered (": file %s, line %d.",
b->source_file, b->line_number);
bpstat bs;
{
for (; bs; bs = bs->next)
- if (bs->breakpoint_at && bs->breakpoint_at->disposition == delete)
+ if (bs->breakpoint_at && bs->breakpoint_at->disposition == delete
+ && bs->stop)
delete_breakpoint (bs->breakpoint_at);
}
if (bpt->inserted)
{
ALL_BREAKPOINTS (b)
- if (b->address == bpt->address && !b->duplicate)
+ if (b->address == bpt->address
+ && !b->duplicate
+ && b->enable != disabled)
{
int val;
val = target_insert_breakpoint (b->address, b->shadow_contents);
case bp_finish:
case bp_longjmp:
case bp_longjmp_resume:
+ case bp_call_dummy:
delete_breakpoint (b);
break;
}