diff options
author | Jan Matyas <jmatyas@codasip.com> | 2021-02-25 08:27:09 +0100 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2021-02-25 15:38:54 -0500 |
commit | 64d38fdd9956aefd1f0fbeb7e1d2774e71c0a9b8 (patch) | |
tree | b0934299c4e2f443f62620865a50eb117b7a25bb /gdb/testsuite/gdb.server/stop-reply-no-thread.exp | |
parent | e38332c286bb96026fadc128170303cc4e935225 (diff) | |
download | binutils-64d38fdd9956aefd1f0fbeb7e1d2774e71c0a9b8.zip binutils-64d38fdd9956aefd1f0fbeb7e1d2774e71c0a9b8.tar.gz binutils-64d38fdd9956aefd1f0fbeb7e1d2774e71c0a9b8.tar.bz2 |
Fix initial thread state of non-threaded remote targets
This change fixes the initial state of the main thread of remote
targets which have no concept of threading. Such targets are
treated as single-threaded by gdb, and this single thread needs
to be initially set to the "resumed" state, in the same manner as
threads in thread-aware remote targets (see remote.c,
remote_target::remote_add_thread).
Without this fix, the following assert was triggered on thread-
unaware remote targets:
remote_target::select_thread_for_ambiguous_stop_reply(const target_waitstatus*): Assertion `first_resumed_thread != nullptr' failed.
The bug can be reproduced using gdbserver
* by disabling packets 'T' and 'qThreadInfo', or
* by disabling all thread-related packets.
The test suite has been updated to include these two scenarios, see
gdb.server/stop-reply-no-thread.exp.
Change-Id: I2c39c9de17e8d6922a8c1b9e259eb316a554a43d
Diffstat (limited to 'gdb/testsuite/gdb.server/stop-reply-no-thread.exp')
-rw-r--r-- | gdb/testsuite/gdb.server/stop-reply-no-thread.exp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp index 68bf42a..823bdf8 100644 --- a/gdb/testsuite/gdb.server/stop-reply-no-thread.exp +++ b/gdb/testsuite/gdb.server/stop-reply-no-thread.exp @@ -112,3 +112,13 @@ foreach_with_prefix to_disable { "" Tthread T } { run_test $to_disable $t_nonstop } } + +# Regression for PR gdb/26819: Cover the case when GDBserver does not report +# any threads (i.e. the remote target has no concept of threads). +# +# Scenario 1: Disable 'T' and 'qfThreadInfo' packets +# Scenario 2: Disable all threading packets +foreach_with_prefix to_disable { "T,qfThreadInfo" "threads" } { + # Non-stop mode not applicable - off. + run_test $to_disable off +} |