Skip to content

Commit e64ddcc

Browse files
committed
[gdb/testsuite] Fix gdb.base/corefile.exp with glibc 2.35
On Ubuntu 22.04.1 x86_64 (with glibc 2.35), I run into: ... (gdb) PASS: gdb.base/corefile.exp: $_exitcode is void bt^M #0 __pthread_kill_implementation (...) at ./nptl/pthread_kill.c:44^M #1 __pthread_kill_internal (...) at ./nptl/pthread_kill.c:78^M #2 __GI___pthread_kill (...) at ./nptl/pthread_kill.c:89^M #3 0x00007f4985e1a476 in __GI_raise (...) at ../sysdeps/posix/raise.c:26^M bminor#4 0x00007f4985e007f3 in __GI_abort () at ./stdlib/abort.c:79^M bminor#5 0x0000556b4ea4b504 in func2 () at gdb.base/coremaker.c:153^M bminor#6 0x0000556b4ea4b516 in func1 () at gdb.base/coremaker.c:159^M bminor#7 0x0000556b4ea4b578 in main (...) at gdb.base/coremaker.c:171^M (gdb) PASS: gdb.base/corefile.exp: backtrace up^M #1 __pthread_kill_internal (...) at ./nptl/pthread_kill.c:78^M 78 in ./nptl/pthread_kill.c^M (gdb) FAIL: gdb.base/corefile.exp: up ... The problem is that the regexp used here: ... gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up" ... does not fit the __pthread_kill_internal line which lacks the instruction address due to inlining. Fix this by making the regexp less strict. Tested on x86_64-linux.
1 parent 2da7ec8 commit e64ddcc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gdb/testsuite/gdb.base/corefile.exp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ gdb_test "print \$_exitcode" " = void" \
153153
# file correctly. I don't think the other tests do this.
154154

155155
gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace"
156-
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up"
156+
gdb_test "up" "#\[0-9\]* *(\[0-9xa-fH'\]* in)? .* \\(.*\\).*" "up"
157157

158158
# Test ability to read mmap'd data
159159

@@ -197,7 +197,7 @@ gdb_test "x/wx buf3" "$hex:\[ \t\]+0x00000000" \
197197
# test reinit_frame_cache
198198

199199
gdb_load ${binfile}
200-
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up (reinit)"
200+
gdb_test "up" "#\[0-9\]* *(\[0-9xa-fH'\]* in)? .* \\(.*\\).*" "up (reinit)"
201201

202202
gdb_test "core" "No core file now."
203203

0 commit comments

Comments
 (0)