diff options
author | Pedro Alves <palves@redhat.com> | 2013-10-22 15:11:28 +0100 |
---|---|---|
committer | Tom Tromey <tromey@sourceware.org> | 2013-10-25 14:02:59 +0000 |
commit | 6d3e7a943f8bc67ceb2901500cea9c3bcaaf687a (patch) | |
tree | 4c3a7ee09baa24a52848323109bc8c341df9bac1 | |
parent | 42ec045f62013faf59dc925c5b6392e627eb9975 (diff) | |
download | gdb-6d3e7a943f8bc67ceb2901500cea9c3bcaaf687a.zip gdb-6d3e7a943f8bc67ceb2901500cea9c3bcaaf687a.tar.gz gdb-6d3e7a943f8bc67ceb2901500cea9c3bcaaf687a.tar.bz2 |
Remove dead sets/clears of ecs->random signal.
'*ecs' is always memset by handle_inferior_event's callers, so all
these clears are unnecessary. There's one place that sets the flag to
true, but, afterwards, before ecs->random_signal is ever read, we
reach the part of handle_inferior_even that clears ecs->random_signal,
among other things:
clear_stop_func (ecs);
ecs->event_thread->stepping_over_breakpoint = 0;
bpstat_clear (&ecs->event_thread->control.stop_bpstat);
ecs->event_thread->control.stop_step = 0;
stop_print_frame = 1;
ecs->random_signal = 0;
stopped_by_random_signal = 0;
So all these ecs->random_signal accesses are dead code.
Tested on x86_64 Fedora 17.
gdb/
2013-10-22 Pedro Alves <palves@redhat.com>
* infrun.c (handle_inferior_event) <thread hop>: Don't clear or
set ecs->random signal.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/infrun.c | 9 |
2 files changed, 5 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e4abc1c..d0854a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-10-22 Pedro Alves <palves@redhat.com> + * infrun.c (handle_inferior_event) <thread hop>: Don't clear or + set ecs->random signal. + +2013-10-22 Pedro Alves <palves@redhat.com> + * infrun.c (keep_going): Update comments. 2013-10-22 Pedro Alves <palves@redhat.com> diff --git a/gdb/infrun.c b/gdb/infrun.c index b1d2dc5..c1cb99f 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3819,7 +3819,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); remove_single_step_breakpoints (); singlestep_breakpoints_inserted_p = 0; - ecs->random_signal = 0; ecs->event_thread->control.trap_expected = 0; context_switch (saved_singlestep_ptid); @@ -3884,7 +3883,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); not see this breakpoint hit when stepping onto breakpoints. */ if (regular_breakpoint_inserted_here_p (aspace, stop_pc)) { - ecs->random_signal = 0; if (!breakpoint_thread_match (aspace, stop_pc, ecs->ptid)) thread_hop_needed = 1; } @@ -3898,7 +3896,6 @@ Cannot fill $_exitsignal with the correct signal number.\n")); "trap for %s\n", target_pid_to_str (ecs->ptid)); - ecs->random_signal = 0; /* The call to in_thread_list is necessary because PTIDs sometimes change when we go from single-threaded to multi-threaded. If the singlestep_ptid is still in the list, assume that it is @@ -4012,13 +4009,7 @@ Cannot fill $_exitsignal with the correct signal number.\n")); return; } } - else if (singlestep_breakpoints_inserted_p) - { - ecs->random_signal = 0; - } } - else - ecs->random_signal = 1; /* See if something interesting happened to the non-current thread. If so, then switch to that thread. */ |