From df3b9a6dfa1f2d4983e06cc21bf7c4cae0947888 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 14 Jun 2023 17:39:34 +0200 Subject: [PATCH] [gdb/testsuite] Fix gdb.base/step-over-exit.exp with glibc debuginfo In test-case gdb.base/step-over-exit.exp, we set a breakpoint on _exit and continue, expecting to hit the breakpoint. Without glibc debug info installed, we have with target board unix/-m64: ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, 0x00007ffff7d46aee in \ _exit () from /lib64/libc.so.6^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... and with target board unix/-m32: ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, 0xf7d84c25 in _exit () from \ /lib/libc.so.6^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... However after installing debug info (packages glibc-debuginfo and glibc-32bit-debuginfo), we have for -m64 (note: __GI__exit instead of _exit): ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, \ __GI__exit (status=) at \ ../sysdeps/unix/sysv/linux/_exit.c:27^M 27 {^M (gdb) PASS: gdb.base/step-over-exit.exp: continue to exit ... and -m32 (note: _Exit instead of _exit): ... Thread 2.1 "step-over-exit" hit Breakpoint 2.2, _Exit () at \ ../sysdeps/unix/sysv/linux/i386/_exit.S:24^M 24 ../sysdeps/unix/sysv/linux/i386/_exit.S: No such file or directory.^M (gdb) FAIL: gdb.base/step-over-exit.exp: continue to exit ... The gdb_test allows for both _exit and __GI__exit, but not _Exit: ... gdb_test "continue" \ "Continuing\\..*Breakpoint $decimal.*_exit \\(.*\\).*" \ "continue to exit" ... Fix this by allowing _Exit as well. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/step-over-exit.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/step-over-exit.exp b/gdb/testsuite/gdb.base/step-over-exit.exp index 6e975c6d34c..2a2a98a8884 100644 --- a/gdb/testsuite/gdb.base/step-over-exit.exp +++ b/gdb/testsuite/gdb.base/step-over-exit.exp @@ -49,7 +49,7 @@ gdb_test "break _exit" "Breakpoint $decimal at .*" # Hit the breakpoint on _exit. The address of syscall insn is recorded. gdb_test "continue" \ - "Continuing\\..*Breakpoint $decimal.*_exit \\(.*\\).*" \ + "Continuing\\..*Breakpoint $decimal.*_\[eE\]xit \\(.*\\).*" \ "continue to exit" gdb_test "display/i \$pc" ".*" -- 2.30.2