+2013-11-14 Pedro Alves <palves@redhat.com>
+
+ * breakpoint.c (bpstat_explains_signal) <Moribund locations>:
+ Return BPSTAT_SIGNAL_PASS instead of BPSTAT_SIGNAL_HIDE.
+ (explains_signal_watchpoint): Return BPSTAT_SIGNAL_PASS instead of
+ BPSTAT_SIGNAL_HIDE.
+ (base_breakpoint_explains_signal): Return BPSTAT_SIGNAL_PASS
+ instead of BPSTAT_SIGNAL_HIDE.
+ * infrun.c (handle_inferior_event): Rework random signal checks.
+
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (struct execution_control_state): Remove
/* A moribund location can never explain a signal other than
GDB_SIGNAL_TRAP. */
if (sig == GDB_SIGNAL_TRAP)
- newval = BPSTAT_SIGNAL_HIDE;
+ newval = BPSTAT_SIGNAL_PASS;
else
newval = BPSTAT_SIGNAL_NO;
}
if (b->type == bp_watchpoint && sig != GDB_SIGNAL_TRAP)
return BPSTAT_SIGNAL_NO;
- return BPSTAT_SIGNAL_HIDE;
+ return BPSTAT_SIGNAL_PASS;
}
/* The breakpoint_ops structure to be used in hardware watchpoints. */
static enum bpstat_signal_value
base_breakpoint_explains_signal (struct breakpoint *b, enum gdb_signal sig)
{
- return BPSTAT_SIGNAL_HIDE;
+ return BPSTAT_SIGNAL_PASS;
}
/* The default "after_condition_true" method. */
"infrun: no user watchpoint explains "
"watchpoint SIGTRAP, ignoring\n");
- /* NOTE: cagney/2003-03-29: These two checks for a random signal
+ /* NOTE: cagney/2003-03-29: These checks for a random signal
at one stage in the past included checks for an inferior
function call's call dummy's return breakpoint. The original
comment, that went with the test, read:
be necessary for call dummies on a non-executable stack on
SPARC. */
- if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
- random_signal
- = !((bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
- GDB_SIGNAL_TRAP)
- != BPSTAT_SIGNAL_NO)
- || stopped_by_watchpoint
- || ecs->event_thread->control.trap_expected
- || (ecs->event_thread->control.step_range_end
- && (ecs->event_thread->control.step_resume_breakpoint
- == NULL)));
- else
- {
- enum bpstat_signal_value sval;
+ /* See if the breakpoints module can explain the signal. */
+ sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
+ ecs->event_thread->suspend.stop_signal);
+ random_signal = (sval == BPSTAT_SIGNAL_NO);
+
+ /* If not, perhaps stepping/nexting can. */
+ if (random_signal)
+ random_signal = !(ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP
+ && currently_stepping (ecs->event_thread));
- sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat,
- ecs->event_thread->suspend.stop_signal);
- random_signal = (sval == BPSTAT_SIGNAL_NO);
+ /* No? Perhaps we got a moribund watchpoint. */
+ if (random_signal)
+ random_signal = !stopped_by_watchpoint;
- if (sval == BPSTAT_SIGNAL_HIDE)
- ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
- }
+ if (sval == BPSTAT_SIGNAL_HIDE)
+ ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
/* For the program's own signals, act according to
the signal handling tables. */