[gdb/testsuite] Fix gdb.threads/threadcrash.exp with glibc debuginfo
commite6a0a281a0bf93bd22247bcd1d68b303dc657845
authorTom de Vries <tdevries@suse.de>
Wed, 24 Apr 2024 13:36:02 +0000 (24 15:36 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 24 Apr 2024 13:36:02 +0000 (24 15:36 +0200)
treef3afc915531e66736089ff876b3bcf64718a78be
parent3b3e2090118966e3b885ae578440e380dc90e648
[gdb/testsuite] Fix gdb.threads/threadcrash.exp with glibc debuginfo

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