aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2023-09-19 12:26:26 +0100
committerPedro Alves <pedro@palves.net>2023-09-27 15:28:40 +0100
commitaeb889f580a270520d04d69a5fd72dd7fe11c61c (patch)
tree0eb8ab696a0be23536dc2a7c8fab6ef115b0df5a
parentb57264372264ebe6a8115028aa15c81af4fd98f1 (diff)
downloadgdb-aeb889f580a270520d04d69a5fd72dd7fe11c61c.zip
gdb-aeb889f580a270520d04d69a5fd72dd7fe11c61c.tar.gz
gdb-aeb889f580a270520d04d69a5fd72dd7fe11c61c.tar.bz2
Adjust gdb.thread/pthreads.exp for Cygwin
The Cygwin runtime spawns a few extra threads, so using hardcoded thread numbers in tests rarely works correctly. Thankfully, this testcase already records the ids of the important threads in globals. It just so happens that they are not used in a few tests. This commit fixes that. With this, the test passes cleanly on Cygwin [1]. Still passes cleanly on x86-64 GNU/Linux. [1] - with system GDB. Upstream GDB is missing a couple patches Cygwin carries downstream. Approved-By: Tom Tromey <tom@tromey.com> Change-Id: I01bf71fcb44ceddea8bd16b933b10b964749a6af
-rw-r--r--gdb/testsuite/gdb.threads/pthreads.exp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index 41a7cb3..122172a 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -274,21 +274,21 @@ proc check_qcs {} {
set number "\[0-9]\+"
# Check -c (continue) and -s (silently continue) flags.
- gdb_test "thread apply 2-3 p notfound" \
+ gdb_test "thread apply $::thread1_id $::thread2_id p notfound" \
[multi_line \
"" \
- "Thread 2 ${any}" \
+ "Thread $::thread1_id ${any}" \
"No symbol \\\"notfound\\\" in current context." \
] \
"run a failing command that aborts thread apply"
- gdb_test "thread apply 2-3 -c p notfound" \
+ gdb_test "thread apply $::thread1_id $::thread2_id -c p notfound" \
[multi_line \
"" \
- "Thread 2 ${any}" \
+ "Thread $::thread1_id ${any}" \
"No symbol \\\"notfound\\\" in current context." \
"" \
- "Thread 3 ${any}" \
+ "Thread $::thread2_id ${any}" \
"No symbol \\\"notfound\\\" in current context." \
] \
"run a failing command, -c to continue"
@@ -302,11 +302,11 @@ proc check_qcs {} {
gdb_test $cmd \
[multi_line \
"" \
- "Thread 3 ${any}" \
+ "Thread $::thread2_id ${any}" \
"#${number}${ws}${any} in thread2 ${any}" \
"\\\$\[0-9]+ = ${number}${any}" \
"" \
- "Thread 2 ${any}" \
+ "Thread $::thread1_id ${any}" \
"#${number}${ws}${any} in thread1 ${any}" \
"\\\$\[0-9]+ = ${number}${any}" \
] \