diff options
author | Pedro Alves <palves@redhat.com> | 2015-03-19 16:51:09 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2015-03-19 16:51:09 +0000 |
commit | 91baf43fa70827325272667c8e7a86c553c767dc (patch) | |
tree | d86ff0e50c86c20bbde2a6c0d28f32da40fe6e09 /gdb/gdbserver | |
parent | 1740ba0cec44bdfe9cba586892a5953a4c602228 (diff) | |
download | gdb-91baf43fa70827325272667c8e7a86c553c767dc.zip gdb-91baf43fa70827325272667c8e7a86c553c767dc.tar.gz gdb-91baf43fa70827325272667c8e7a86c553c767dc.tar.bz2 |
gdbserver/Linux: unbreak non-stop
The previous change added an assertion that is catching yet another
bug in count_events_callback/select_event_lwp_callback:
(gdb)
PASS: gdb.mi/mi-nonstop.exp: interrupted
mi_expect_interrupt: expecting: \*stopped,(reason="signal-received",signal-name="0",signal-meaning="Signal 0"|reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt")[^
]*
/home/pedro/gdb/mygit/src/gdb/gdbserver/linux-low.c:2329: A problem internal to GDBserver has been detected.
select_event_lwp: Assertion `num_events > 0' failed.
=thread-group-exited,id="i1"
Certainly select_event_lwp_callback should always at least find one
event, as it's only called because an event triggered (though we may
have more than one: the point of the function is randomly picking
one).
An LWP that GDB previously asked to continue/step (thus is resumed)
and gets a vCont;t request ends up with last_resume_kind ==
resume_stop. These functions in gdbserver used to filter out events
that weren't going to be reported to GDB; I think the last_resume_kind
kind check used to make sense at that point, but it no longer does.
gdb/gdbserver/ChangeLog:
2015-03-19 Pedro Alves <palves@redhat.com>
* linux-low.c (count_events_callback, select_event_lwp_callback):
No longer check whether the thread has resume_stop as last resume
kind.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index df8f9ab..0383e67 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2015-03-19 Pedro Alves <palves@redhat.com> + + * linux-low.c (count_events_callback, select_event_lwp_callback): + No longer check whether the thread has resume_stop as last resume + kind. + 2015-03-19 Pedro Alves <palves@redhat.com> * linux-low.c (count_events_callback, select_event_lwp_callback): diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index e53e0fc..2b988ec 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -2245,7 +2245,6 @@ count_events_callback (struct inferior_list_entry *entry, void *data) /* Count only resumed LWPs that have an event pending. */ if (thread->last_status.kind == TARGET_WAITKIND_IGNORE - && thread->last_resume_kind != resume_stop && lp->status_pending_p) (*count)++; @@ -2280,8 +2279,7 @@ select_event_lwp_callback (struct inferior_list_entry *entry, void *data) gdb_assert (selector != NULL); /* Select only resumed LWPs that have an event pending. */ - if (thread->last_resume_kind != resume_stop - && thread->last_status.kind == TARGET_WAITKIND_IGNORE + if (thread->last_status.kind == TARGET_WAITKIND_IGNORE && lp->status_pending_p) if ((*selector)-- == 0) return 1; |