public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: Use _inferior_thread_count in gdb.threads/threadcrash.exp
@ 2024-03-11 9:57 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2024-03-11 9:57 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b95b92ec093cea8014e33fdca2f800c4e5ce91be
commit b95b92ec093cea8014e33fdca2f800c4e5ce91be
Author: Guinevere Larsen <blarsen@redhat.com>
Date: Mon Mar 11 10:57:31 2024 +0100
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
Diff:
---
gdb/testsuite/gdb.threads/threadcrash.exp | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index 592098b9c38..966708acd96 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-11 9:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-11 9:57 [binutils-gdb] gdb/testsuite: Use _inferior_thread_count in gdb.threads/threadcrash.exp Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).