Skip to content

Commit

Permalink
[gdb/testsuite] Fix gdb.gdb/selftest.exp
Browse files Browse the repository at this point in the history
With a gdb build with CFLAGS "-O2 -g -flto=auto", I run into:
...
 #7  gdb_main (args=0x7fffffffd220) at src/gdb/main.c:1368^M
 #8  main (argc=<optimized out>, argv=<optimized out>) at src/gdb/gdb.c:32^M
 (gdb) FAIL: gdb.gdb/selftest.exp: backtrace through signal handler
...
which means that this regexp in proc test_with_self fails:
...
  -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
...

The problem is that gdb_main has been inlined into main, and consequently the
backtrace uses:
...
 #x  <fn> ...
...
instead of
...
 #x  <address> in <fn> ...
...

Fix this by updating the regexp to not require "in" before " main".

Tested on x86_64-linux.
  • Loading branch information
vries committed Sep 13, 2021
1 parent fd52555 commit 7486cb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gdb/testsuite/gdb.gdb/selftest.exp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ proc test_with_self { } {
setup_xfail "i*86-pc-linuxaout-gnu"
set description "backtrace through signal handler"
gdb_test_multiple "backtrace" "$description" {
-re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
-re "#0.*(read|poll).* main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
pass "$description"
}
}
Expand Down

0 comments on commit 7486cb6

Please sign in to comment.