aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2017-09-29 13:06:34 +0100
committerPedro Alves <palves@redhat.com>2017-09-29 13:06:34 +0100
commit94c207e097a3a30ce71fc8f700325113968c276b (patch)
treedb4cc65cb31bde9bcfbdac32c6ab0be00d540b3e /gdb/gdbserver/linux-low.h
parentf6ac8c52c955b487dcb56d05fc93fced7b203294 (diff)
downloadgdb-94c207e097a3a30ce71fc8f700325113968c276b.zip
gdb-94c207e097a3a30ce71fc8f700325113968c276b.tar.gz
gdb-94c207e097a3a30ce71fc8f700325113968c276b.tar.bz2
Fix gdbserver regression exposed by gdb.threads/multi-create-ns-info-thr.exp
Commit 8629910955a7 ("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.
Diffstat (limited to 'gdb/gdbserver/linux-low.h')
-rw-r--r--gdb/gdbserver/linux-low.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 85bb8ca..0ece7bc 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -417,7 +417,7 @@ int thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp);
both the clone and the parent should be stopped. This function does
whatever is required have the clone under thread_db's control. */
-void thread_db_notice_clone (struct process_info *proc, ptid_t lwp);
+void thread_db_notice_clone (struct thread_info *parent_thr, ptid_t child_ptid);
bool thread_db_thread_handle (ptid_t ptid, gdb_byte **handle, int *handle_len);