Fix gdbserver regression exposed by gdb.threads/multi-create-ns-info-thr.exp
Commit 8629910955
("Add thread_db_notice_clone to gdbserver")
introduced calls into libthread_db without making sure that the
current thread is pointing to a know-stopped thread. This resulted in
sometimes thread_db_notice_clone failing->find_one_thread failing like
this, as seen when running gdb.threads/multi-create-ns-info-thr.exp:
~~~
Thread <6> executing
Thread <7> executing
gdbserver: PID mismatch! Expected 27472, got 27471
gdbserver: Cannot find thread after clone.
Thread <1000> executing
Thread <1001> executing
~~~
Things go south from here and sometimes that ends up resulting in
gdbserver crashing and the test failing.
gdb/gdbserver/ChangeLog:
2017-09-29 Pedro Alves <palves@redhat.com>
* linux-low.c (handle_extended_wait): Pass parent thread instead
of process to thread_db_notice_clone.
* linux-low.h (thread_db_notice_clone): Replace parent process
parameter with parent thread parameter.
* thread-db.c (find_one_thread): Add comment.
(thread_db_notice_clone): Replace parent process parameter with
parent thread parameter. Temporarily switch to the parent thread.
This commit is contained in:
parent
f6ac8c52c9
commit
94c207e097
4 changed files with 26 additions and 5 deletions
|
@ -656,7 +656,7 @@ handle_extended_wait (struct lwp_info **orig_event_lwp, int wstat)
|
|||
new_lwp->status_pending = status;
|
||||
}
|
||||
|
||||
thread_db_notice_clone (get_thread_process (event_thr), ptid);
|
||||
thread_db_notice_clone (event_thr, ptid);
|
||||
|
||||
/* Don't report the event. */
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue