diff options
author | Don Breazeal <donb@codesourcery.com> | 2015-05-28 13:12:01 -0700 |
---|---|---|
committer | Don Breazeal <donb@codesourcery.com> | 2015-05-28 14:40:30 -0700 |
commit | bfacd19d64c76b740a4a9c18dce4277e4a9afde5 (patch) | |
tree | 3a5e1bf7d29a24851fa91bb2c16399580f12470e /ld | |
parent | 8dd06f7a89b6eb7b646349f50746b3d2e85ed5de (diff) | |
download | gdb-bfacd19d64c76b740a4a9c18dce4277e4a9afde5.zip gdb-bfacd19d64c76b740a4a9c18dce4277e4a9afde5.tar.gz gdb-bfacd19d64c76b740a4a9c18dce4277e4a9afde5.tar.bz2 |
Initialize last_resume_kind for remote fork child
This patch fixes some intermittent test failures in
gdb.base/foll-vfork.exp where a vfork child would be (incorrectly)
resumed when handling the vfork event. In this case the result
was a subsequent event reported to the client side as a SIGTRAP
delivered to the as-yet-unknown child thread.
The new thread was resumed (incorrectly) in linux-low.c when
resume_stopped_resumed_lwps was called from
linux_wait_for_event_filtered after the vfork event had been
handled in handle_extended_wait.
Gdbserver/linux-low.c's add_thread function creates threads with
last_resume_kind == resume_continue by default. This field is
used by resume_stopped_resumed_lwps to decide whether to perform
the resume:
static void
resume_stopped_resumed_lwps (struct inferior_list_entry *entry) {
struct thread_info *thread = (struct thread_info *) entry;
struct lwp_info *lp = get_thread_lwp (thread);
if (lp->stopped
&& !lp->status_pending_p
&& thread->last_resume_kind != resume_stop
&& thread->last_status.kind == TARGET_WAITKIND_IGNORE)
{
So the fix is to make sure to set thread->last_resume_kind to
resume_stop. Here we do that for new fork children in
gdbserver/linux-low.c:handle_extended_wait.
In addition, it seemed prudent to initialize lwp_info.status_pending_p
for the new fork child. I also rearranged the initialization code
so that all of the lwp_info initialization was together, rather than
intermixed with thread_info and process_info initialization.
Tested native, native-gdbserver, native-extended-gdbserver on
x86_64 GNU/Linux.
gdb/gdbserver/
* linux-low.c (handle_extended_wait): Initialize
thread_info.last_resume_kind for new fork children.
Diffstat (limited to 'ld')
0 files changed, 0 insertions, 0 deletions