Force to update thread list in queue-signal.exp
Commit Message
Hi,
I see the following fail on arm-linux-gnueabi testing,
thread 2^M
Thread ID 2 not known.^M
^^^^^^^^^^^^^^^^^^^^^^
(gdb) PASS: gdb.threads/queue-signal.exp: thread 2
bt^M
(gdb) FAIL: gdb.threads/queue-signal.exp: determine thread functions
gdb/testsuite:
The output "Thread ID 2 not known" doesn't cause a fail because no
pattern to match the output, but the message "Thread ID 2 not known" is
still unexpected. This patch is to force to issue command "info threads"
in order to update thread list. On the other hand, this patch is also
to match the output of "thread 2" to make the failure, if any, more
obvious.
2014-09-25 Yao Qi <yao@codesourcery.com>
* gdb.threads/queue-signal.exp: Execute command "info threads".
Match the output of "thread 2".
---
gdb/testsuite/gdb.threads/queue-signal.exp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
Yao Qi <yao@codesourcery.com> writes:
> 2014-09-25 Yao Qi <yao@codesourcery.com>
>
> * gdb.threads/queue-signal.exp: Execute command "info threads".
> Match the output of "thread 2".
Ping.
On 10/07/2014 02:53 PM, Yao Qi wrote:
> Yao Qi <yao@codesourcery.com> writes:
>
>> 2014-09-25 Yao Qi <yao@codesourcery.com>
>>
>> * gdb.threads/queue-signal.exp: Execute command "info threads".
This part should no longer be necessary:
https://sourceware.org/ml/gdb-patches/2014-09/msg00734.html
>> Match the output of "thread 2".
Thanks,
Pedro Alves
@@ -34,10 +34,14 @@ gdb_test "handle SIGABRT stop print pass"
gdb_breakpoint "all_threads_running"
gdb_continue_to_breakpoint "all_threads_running"
+# Make sure thread list is up-to-date (in case remote targets have not
+# yet reported thread creation events).
+gdb_test "info threads"
+
# Find out which of threads 2,3 are for sigusr1,2.
set sigusr1_thread 0
set sigusr2_thread 0
-gdb_test "thread 2"
+gdb_test "thread 2" "Switching to .*"
gdb_test_multiple "bt" "determine thread functions" {
-re "sigusr1.*$gdb_prompt $" {
set sigusr1_thread 2