aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-thread-exited.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-07-31 11:30:30 -0600
committerTom Tromey <tromey@adacore.com>2023-08-10 11:42:38 -0600
commit78e7f66e75f93d49a7accf3a7552b2378533b52b (patch)
tree614f0f60692a0d8cb938c97c3ab3e6522d7de688 /gdb/testsuite/gdb.python/py-thread-exited.c
parentd0ffdf6482024331dc43d9c221c7afc5863a300b (diff)
downloadbinutils-78e7f66e75f93d49a7accf3a7552b2378533b52b.zip
binutils-78e7f66e75f93d49a7accf3a7552b2378533b52b.tar.gz
binutils-78e7f66e75f93d49a7accf3a7552b2378533b52b.tar.bz2
Change py-thread-exited.exp to work with gdbserver
gdbserver does not notify gdb of new threads when they are created. I'm not sure if this is documented anywhere, but it is mentioned on this page: https://sourceware.org/gdb/wiki/LocalRemoteFeatureParity Search for "Finding new threads in the inferior". This behavior is a bit unfortunate -- I would think that it would be better to arrange for such notification if something on the gdb side is interested. Meanwhile, this patch fixes py-thread-exited.exp to work around this problem. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30677
Diffstat (limited to 'gdb/testsuite/gdb.python/py-thread-exited.c')
-rw-r--r--gdb/testsuite/gdb.python/py-thread-exited.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.python/py-thread-exited.c b/gdb/testsuite/gdb.python/py-thread-exited.c
index fd0342b..d62133b 100644
--- a/gdb/testsuite/gdb.python/py-thread-exited.c
+++ b/gdb/testsuite/gdb.python/py-thread-exited.c
@@ -24,14 +24,14 @@ pthread_t thread3_id;
void* do_thread (void* d)
{
- return NULL;
+ return NULL; /* In thread */
}
int main (void)
{
pthread_create (&thread2_id, NULL, do_thread, NULL);
- pthread_join (thread2_id, NULL);
pthread_create (&thread3_id, NULL, do_thread, NULL);
+ pthread_join (thread2_id, NULL);
pthread_join (thread3_id, NULL);
- return 12;
+ return 12; /* Done */
}