[pushed,1/2,gdb/testsuite] Fix gdb.threads/threadcrash.exp with glibc debuginfo

Message ID 20240424133622.4639-1-tdevries@suse.de
State Committed
Headers
Series [pushed,1/2,gdb/testsuite] Fix gdb.threads/threadcrash.exp with glibc debuginfo |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Tom de Vries April 24, 2024, 1:36 p.m. UTC
  After installing glibc debuginfo, I ran into:
...
FAIL: gdb.threads/threadcrash.exp: test_live_inferior: \
  $thread_count == [llength $test_list]
...

This happens because the clause:
...
	-re "^\r\n${hs}main$hs$eol" {
...
which is intended to match only:
...
 #1  <hex> in main () at threadcrash.c:423^M
...
also matches "remaining" in:
...
 #1  <hex> in __GI___nanosleep (requested_time=<hex>, remaining=<hex>) at \
   nanosleep.c:27^M
...

Fix this by checking for "in main" instead.

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.threads/threadcrash.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 3b3e2090118966e3b885ae578440e380dc90e648
  

Patch

diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
index c72ce73fd6d..ffbfd83942c 100644
--- a/gdb/testsuite/gdb.threads/threadcrash.exp
+++ b/gdb/testsuite/gdb.threads/threadcrash.exp
@@ -74,7 +74,7 @@  proc thread_apply_all {} {
 	    lappend test_list 6
 	    exp_continue
 	}
-	-re "^\r\n${hs}main$hs$eol" {
+	-re "^\r\n${hs}in main$hs$eol" {
 	    lappend test_list 7
 	    exp_continue
 	}