[gdb/testsuite] Fix gdb.base/step-over-exit.exp with glibc debuginfo
authorTom de Vries <tdevries@suse.de>
Wed, 14 Jun 2023 15:39:34 +0000 (17:39 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 14 Jun 2023 15:39:34 +0000 (17:39 +0200)
commitdf3b9a6dfa1f2d4983e06cc21bf7c4cae0947888
tree68b936da3225ade64c304ef6c67ff92beca8b4bb
parent7ade0f1582c417dc74b9449faf2b8dc86469ac9b
[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=<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