diff options
author | Pedro Alves <palves@redhat.com> | 2013-11-14 19:43:26 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-11-14 19:50:19 +0000 |
commit | ce12b0125d49c4c47813f010c8d60d4c79ff52e1 (patch) | |
tree | 47945fde8ba32a02f25cfe1ff5a409b7dad62be4 /gdb/infrun.c | |
parent | 05ba85103b9131333b829c7c1366bfdb015169a3 (diff) | |
download | gdb-ce12b0125d49c4c47813f010c8d60d4c79ff52e1.zip gdb-ce12b0125d49c4c47813f010c8d60d4c79ff52e1.tar.gz gdb-ce12b0125d49c4c47813f010c8d60d4c79ff52e1.tar.bz2 |
infrun.c: Don't set ecs->random_signal for "catchpoint" events (eliminate ecs->random_signal).
This goes a step forward in making only TARGET_WAITKIND_STOPPED talk
about signals.
There's no reason for the "catchpoint" TARGET_WAITKIND_XXXs to consult
bpstat about signals -- unlike breakpoints, all these events are
continuable, so we don't need to do a remove-break/step/reinsert-break
-like dance. That means we don't actually need to run them through
process_event_stop_test (for the bpstat_what checks), and can just use
bpstat_causes_stop instead. Note we were already using it in the
TARGET_WAITKIND_(V)FORKED cases.
Then, these "catchpoint" waitkinds don't need to set
ecs->random_signal for anything, because they check it immediately
afterwards (and the value they set is never used again).
gdb/
2013-11-14 Pedro Alves <palves@redhat.com>
* infrun.c (struct execution_control_state): Remove
'random_signal' field.
(handle_syscall_event): Use bpstat_causes_stop instead of
bpstat_explains_signal. Don't set ecs->random_signal.
(handle_inferior_event): New 'random_signal' local.
<TARGET_WAITKIND_FORKED, TARGET_WAITKIND_VFORKED,
TARGET_WAITKIND_EXECD>: Use bpstat_causes_stop instead of
bpstat_explains_signal. Don't set ecs->random_signal.
<TARGET_WAITKIND_STOPPED>: Adjust to use local instead of
ecs->random_signal.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r-- | gdb/infrun.c | 45 |
1 files changed, 13 insertions, 32 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c index 8ab6b61..f37d881 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2419,7 +2419,6 @@ struct execution_control_state struct thread_info *event_thread; struct target_waitstatus ws; - int random_signal; int stop_func_filled_in; CORE_ADDR stop_func_start; CORE_ADDR stop_func_end; @@ -3094,8 +3093,6 @@ handle_syscall_event (struct execution_control_state *ecs) if (catch_syscall_enabled () > 0 && catching_syscall_number (syscall_number) > 0) { - enum bpstat_signal_value sval; - if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: syscall number = '%d'\n", syscall_number); @@ -3104,11 +3101,7 @@ handle_syscall_event (struct execution_control_state *ecs) = bpstat_stop_status (get_regcache_aspace (regcache), stop_pc, ecs->ptid, &ecs->ws); - sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, - GDB_SIGNAL_0); - ecs->random_signal = sval == BPSTAT_SIGNAL_NO; - - if (!ecs->random_signal) + if (bpstat_causes_stop (ecs->event_thread->control.stop_bpstat)) { /* Catchpoint hit. */ return 0; @@ -3160,6 +3153,8 @@ handle_inferior_event (struct execution_control_state *ecs) int stopped_by_watchpoint; int stepped_after_stopped_by_watchpoint = 0; enum stop_kind stop_soon; + int random_signal; + enum bpstat_signal_value sval; if (ecs->ws.kind == TARGET_WAITKIND_IGNORE) { @@ -3339,7 +3334,6 @@ handle_inferior_event (struct execution_control_state *ecs) if (stop_soon == NO_STOP_QUIETLY) { struct regcache *regcache; - enum bpstat_signal_value sval; regcache = get_thread_regcache (ecs->ptid); @@ -3349,12 +3343,7 @@ handle_inferior_event (struct execution_control_state *ecs) = bpstat_stop_status (get_regcache_aspace (regcache), stop_pc, ecs->ptid, &ecs->ws); - sval - = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, - GDB_SIGNAL_0); - ecs->random_signal = sval == BPSTAT_SIGNAL_NO; - - if (!ecs->random_signal) + if (bpstat_causes_stop (ecs->event_thread->control.stop_bpstat)) { /* A catchpoint triggered. */ process_event_stop_test (ecs); @@ -3593,15 +3582,11 @@ Cannot fill $_exitsignal with the correct signal number.\n")); = bpstat_stop_status (get_regcache_aspace (get_current_regcache ()), stop_pc, ecs->ptid, &ecs->ws); - /* Note that we're interested in knowing the bpstat actually - causes a stop, not just if it may explain the signal. - Software watchpoints, for example, always appear in the - bpstat. */ - ecs->random_signal - = !bpstat_causes_stop (ecs->event_thread->control.stop_bpstat); - - /* If no catchpoint triggered for this, then keep going. */ - if (ecs->random_signal) + /* If no catchpoint triggered for this, then keep going. Note + that we're interested in knowing the bpstat actually causes a + stop, not just if it may explain the signal. Software + watchpoints, for example, always appear in the bpstat. */ + if (!bpstat_causes_stop (ecs->event_thread->control.stop_bpstat)) { ptid_t parent; ptid_t child; @@ -3687,10 +3672,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); ecs->event_thread->control.stop_bpstat = bpstat_stop_status (get_regcache_aspace (get_current_regcache ()), stop_pc, ecs->ptid, &ecs->ws); - ecs->random_signal - = (bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, - GDB_SIGNAL_0) - == BPSTAT_SIGNAL_NO); /* Note that this may be referenced from inside bpstat_stop_status above, through inferior_has_execd. */ @@ -3698,7 +3679,7 @@ Cannot fill $_exitsignal with the correct signal number.\n")); ecs->ws.value.execd_pathname = NULL; /* If no catchpoint triggered for this, then keep going. */ - if (ecs->random_signal) + if (!bpstat_causes_stop (ecs->event_thread->control.stop_bpstat)) { ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0; keep_going (ecs); @@ -4274,7 +4255,7 @@ Cannot fill $_exitsignal with the correct signal number.\n")); SPARC. */ if (ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP) - ecs->random_signal + random_signal = !((bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, GDB_SIGNAL_TRAP) != BPSTAT_SIGNAL_NO) @@ -4289,7 +4270,7 @@ Cannot fill $_exitsignal with the correct signal number.\n")); sval = bpstat_explains_signal (ecs->event_thread->control.stop_bpstat, ecs->event_thread->suspend.stop_signal); - ecs->random_signal = (sval == BPSTAT_SIGNAL_NO); + random_signal = (sval == BPSTAT_SIGNAL_NO); if (sval == BPSTAT_SIGNAL_HIDE) ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0; @@ -4298,7 +4279,7 @@ Cannot fill $_exitsignal with the correct signal number.\n")); /* For the program's own signals, act according to the signal handling tables. */ - if (ecs->random_signal) + if (random_signal) { /* Signal not for debugging purposes. */ int printed = 0; |