public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] [gdb/testsuite] Fix gdb.base/step-over-exit.exp with glibc debuginfo
@ 2023-06-14 15:40 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-06-14 15:40 UTC (permalink / raw)
  To: gdb-patches

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=<optimized out>) 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" ".*"

base-commit: 7ade0f1582c417dc74b9449faf2b8dc86469ac9b
-- 
2.35.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-14 15:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 15:40 [pushed] [gdb/testsuite] Fix gdb.base/step-over-exit.exp with glibc debuginfo 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).