/* Chain of all breakpoints defined. */
-struct breakpoint *breakpoint_chain;
+static struct breakpoint *breakpoint_chain;
/* Number of last breakpoint made. */
b->enable = disabled;
if (!disabled_breaks)
{
+ target_terminal_ours_for_output ();
fprintf_unfiltered (gdb_stderr,
"Cannot insert breakpoint %d:\n", b->number);
printf_filtered ("Disabling shared library breakpoints:\n");
else
#endif
{
+ target_terminal_ours_for_output ();
fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
#ifdef ONE_PROCESS_WRITETEXT
fprintf_unfiltered (gdb_stderr,
register struct breakpoint *b;
int val;
-#ifdef BREAKPOINT_DEBUG
- printf_unfiltered ("Removing breakpoints.\n");
-#endif /* BREAKPOINT_DEBUG */
-
ALL_BREAKPOINTS (b)
if (b->type != bp_watchpoint && b->inserted)
{
if (val)
return val;
b->inserted = 0;
-#ifdef BREAKPOINT_DEBUG
- printf_unfiltered ("Removed breakpoint at %s",
- local_hex_string((unsigned long) b->address));
- printf_unfiltered (", shadow %s",
- local_hex_string((unsigned long) b->shadow_contents[0]));
- printf_unfiltered (", %s.\n",
- local_hex_string((unsigned long) b->shadow_contents[1]));
-#endif /* BREAKPOINT_DEBUG */
}
return 0;
return 0;
}
+/* Return nonzero if FRAME is a dummy frame. We can't use PC_IN_CALL_DUMMY
+ because figuring out the saved SP would take too much time, at least using
+ get_saved_register on the 68k. This means that for this function to
+ work right a port must use the bp_call_dummy breakpoint. */
+
+int
+frame_in_dummy (frame)
+ FRAME frame;
+{
+ struct breakpoint *b;
+
+#ifdef CALL_DUMMY
+ ALL_BREAKPOINTS (b)
+ {
+ static unsigned LONGEST dummy[] = CALL_DUMMY;
+
+ if (b->type == bp_call_dummy
+ && b->frame == frame->frame
+
+ /* We need to check the PC as well as the frame on the sparc,
+ for signals.exp in the testsuite. */
+ && (frame->pc
+ >= (b->address
+ - sizeof (dummy) / sizeof (LONGEST) * REGISTER_SIZE))
+ && frame->pc <= b->address)
+ return 1;
+ }
+#endif /* CALL_DUMMY */
+ return 0;
+}
+
/* breakpoint_match_thread (PC, PID) returns true if the breakpoint at PC
is valid for process/thread PID. */
/* We hit the longjmp_resume breakpoint. */
long_resume,
+ /* We hit the step_resume breakpoint. */
+ step_resume,
+
/* This is just used to count how many enums there are. */
class_last
};
#define setlr BPSTAT_WHAT_SET_LONGJMP_RESUME
#define clrlr BPSTAT_WHAT_CLEAR_LONGJMP_RESUME
#define clrlrs BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE
+#define sr BPSTAT_WHAT_STEP_RESUME
+
/* "Can't happen." Might want to print an error message.
abort() is not out of the question, but chances are GDB is just
a bit confused, not unusable. */
(BPSTAT_WHAT_SINGLE type stuff) is handled in proceed() without
reference to how we stopped. We retain separate wp_silent and bp_silent
codes in case we want to change that someday. */
+
+ /* step_resume entries: a step resume breakpoint overrides another
+ breakpoint of signal handling (see comment in wait_for_inferior
+ at first IN_SIGTRAMP where we set the step_resume breakpoint). */
+
static const enum bpstat_what_main_action
table[(int)class_last][(int)BPSTAT_WHAT_LAST] =
{
/* old action */
- /* keep_c stop_s stop_n single setlr clrlr clrlrs */
-
-/*no_effect*/ {keep_c, stop_s, stop_n, single, setlr , clrlr , clrlrs},
-/*wp_silent*/ {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s},
-/*wp_noisy*/ {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n},
-/*bp_nostop*/ {single, stop_s, stop_n, single, setlr , clrlrs, clrlrs},
-/*bp_silent*/ {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s},
-/*bp_noisy*/ {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n},
-/*long_jump*/ {setlr , stop_s, stop_n, setlr , err , err , err },
-/*long_resume*/ {clrlr , stop_s, stop_n, clrlrs, err , err , err }
+ /* keep_c stop_s stop_n single setlr clrlr clrlrs sr */
+
+/*no_effect*/ {keep_c, stop_s, stop_n, single, setlr , clrlr , clrlrs, sr},
+/*wp_silent*/ {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s, sr},
+/*wp_noisy*/ {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, sr},
+/*bp_nostop*/ {single, stop_s, stop_n, single, setlr , clrlrs, clrlrs, sr},
+/*bp_silent*/ {stop_s, stop_s, stop_n, stop_s, stop_s, stop_s, stop_s, sr},
+/*bp_noisy*/ {stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, stop_n, sr},
+/*long_jump*/ {setlr , stop_s, stop_n, setlr , err , err , err , sr},
+/*long_resume*/ {clrlr , stop_s, stop_n, clrlrs, err , err , err , sr},
+/*step_resume*/ {sr , sr , sr , sr , sr , sr , sr , sr}
};
#undef keep_c
#undef stop_s
struct bpstat_what retval;
retval.call_dummy = 0;
- retval.step_resume = 0;
for (; bs != NULL; bs = bs->next)
{
enum class bs_class = no_effect;
if (bs->stop)
{
#endif
- retval.step_resume = 1;
- /* We don't handle this via the main_action. */
- bs_class = no_effect;
+ bs_class = step_resume;
#if 0
}
else
printf_filtered ("\n");
if (b->frame)
- printf_filtered ("\tstop only in stack frame at %s\n",
- local_hex_string((unsigned long) b->frame));
+ {
+ printf_filtered ("\tstop only in stack frame at ");
+ print_address_numeric (b->frame, gdb_stdout);
+ printf_filtered ("\n");
if (b->cond)
{
printf_filtered ("\tstop only if ");
others++;
if (others > 0)
{
- printf_unfiltered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
+ printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
ALL_BREAKPOINTS (b)
if (b->address == pc)
{
others--;
- printf_unfiltered ("%d%s%s ",
- b->number,
- (b->enable == disabled) ? " (disabled)" : "",
- (others > 1) ? "," : ((others == 1) ? " and" : ""));
+ printf_filtered
+ ("%d%s%s ",
+ b->number,
+ (b->enable == disabled) ? " (disabled)" : "",
+ (others > 1) ? "," : ((others == 1) ? " and" : ""));
}
- printf_unfiltered ("also set at pc %s.\n", local_hex_string((unsigned long) pc));
+ printf_filtered ("also set at pc ");
+ print_address_numeric (pc, gdb_stdout);
+ printf_filtered (".\n");
}
}
\f
print_expression (b->exp, gdb_stdout);
break;
case bp_breakpoint:
- printf_filtered ("Breakpoint %d at %s", b->number,
- local_hex_string((unsigned long) b->address));
+ printf_filtered ("Breakpoint %d at ", b->number);
+ print_address_numeric (b->address);
if (b->source_file)
printf_filtered (": file %s, line %d.",
b->source_file, b->line_number);
if (sals.nelts > 1)
{
- printf_unfiltered ("Multiple breakpoints were set.\n");
- printf_unfiltered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
+ printf_filtered ("Multiple breakpoints were set.\n");
+ printf_filtered ("Use the \"delete\" command to delete unwanted breakpoints.\n");
}
do_cleanups (old_chain);
}
make_cleanup(delete_breakpoint, breakpoint);
}
- proceed (-1, -1, 0);
+ proceed (-1, TARGET_SIGNAL_DEFAULT, 0);
do_cleanups(old_chain);
}
\f
val = target_insert_breakpoint (b->address, b->shadow_contents);
if (val != 0)
{
+ target_terminal_ours_for_output ();
fprintf_unfiltered (gdb_stderr, "Cannot insert breakpoint %d:\n", b->number);
memory_error (val, b->address); /* which bombs us out */
}
free (bpt->source_file);
if (xgdb_verbose && bpt->type == bp_breakpoint)
- printf_unfiltered ("breakpoint #%d deleted\n", bpt->number);
+ {
+ target_terminal_ours_for_output ();
+ printf_unfiltered ("breakpoint #%d deleted\n", bpt->number);
+ }
/* Be sure no bpstat's are pointing at it after it's been freed. */
- /* FIXME, how can we find all bpstat's? We just check stop_bpstat for now. */
+ /* FIXME, how can we find all bpstat's?
+ We just check stop_bpstat for now. */
for (bs = stop_bpstat; bs; bs = bs->next)
if (bs->breakpoint_at == bpt)
bs->breakpoint_at = NULL;