aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorGuinevere Larsen <blarsen@redhat.com>2024-03-11 10:57:31 +0100
committerTom de Vries <tdevries@suse.de>2024-03-11 10:57:31 +0100
commitb95b92ec093cea8014e33fdca2f800c4e5ce91be (patch)
treeacf77077d21396da0beff42a11fdf5505ce4cb01 /gdb
parent72ab7ac8be993e29f8a393b72dc681d627b12d19 (diff)
downloadbinutils-b95b92ec093cea8014e33fdca2f800c4e5ce91be.zip
binutils-b95b92ec093cea8014e33fdca2f800c4e5ce91be.tar.gz
binutils-b95b92ec093cea8014e33fdca2f800c4e5ce91be.tar.bz2
gdb/testsuite: Use _inferior_thread_count in gdb.threads/threadcrash.exp
A linaro PR [1] reports that the gdb.threads/threadcrash.exp test-case fails to cout the number of threads in the inferior: ... FAIL: gdb.threads/threadcrash.exp: test_gcore: $thread_count == 7 FAIL: gdb.threads/threadcrash.exp: test_gcore: $thread_count == [llength $test_list] ... Fix this by getting the convenience variable _inferior_thread_count as opposed to calculating it based on the output of "info threads". Tested on arm-linux and x86_64-linux. Reviewed-By: Lancelot Six <lancelot.six@amd.com> Approved-By: Tom de Vries <tdevries@suse.de> [1] https://linaro.atlassian.net/browse/GNU-1120
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/gdb.threads/threadcrash.exp23
1 files changed, 2 insertions, 21 deletions
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index 592098b..966708a 100644
--- a/gdb/testsuite/gdb.threads/threadcrash.exp
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -20,26 +20,6 @@
# a gcore.
-# Check that the inferior has 7 threads, and return the number of threads (7).
-# We return the thread count so that, even if there is some error in the test,
-# the final log doesn't get flooded with failures.
-
-proc test_thread_count {} {
- set thread_count 0
-
- gdb_test_multiple "info threads" "getting thread count" -lbl {
- -re "Thread" {
- incr thread_count
- exp_continue
- }
- -re "$::gdb_prompt " {
- gdb_assert {$thread_count == 7}
- }
- }
-
- return $thread_count
-}
-
# Use 'thread apply all backtrace' to check if all expected threads
# are present, and stopped in the expected locations. Set the global
# TEST_LIST to be the a list of regexps expected to match all the
@@ -132,7 +112,8 @@ proc thread_apply_all {} {
proc do_full_test {} {
global test_list
- set thread_count [test_thread_count]
+ set thread_count [get_valueof "" "\$_inferior_thread_count" 0]
+ gdb_assert {$thread_count == 7}
thread_apply_all