Test-case gdb.base/unwind-on-each-insn.exp compiles $srcfile with debug info, and
$srcfile2 without.
Occasionally, I try both files with debug info:
...
- $srcfile $debug_flags $srcfile2 $nodebug_flags]]} {
+ $srcfile $debug_flags $srcfile2 $debug_flags]]} {
...
and both files without:
...
- $srcfile $debug_flags $srcfile2 $nodebug_flags]]} {
+ $srcfile $nodebug_flags $srcfile2 $nodebug_flags]]} {
...
In the latter case, I run into:
...
FAIL: gdb.base/unwind-on-each-insn.exp: foo: instruction 1: bt 2
FAIL: gdb.base/unwind-on-each-insn.exp: foo: instruction 1: up
...
due to a mismatch between the regexp and the different output due to using
nodebug.
Fix this by making the regexp less strict.
Tested on x86_64-linux.
"check frame-id matches"
# Check that the previous frame is 'main'.
- gdb_test "bt 2" "\r\n#1\\s+\[^\r\n\]+ in main \\(\\) .*"
+ gdb_test "bt 2" "\r\n#1\\s+\[^\r\n\]+ in main \\(\\)( .*)?"
# Move up the stack (to main).
gdb_test "up" \
- "\r\n#1\\s+\[^\r\n\]+ in main \\(\\) .*"
+ "\r\n#1\\s+\[^\r\n\]+ in main \\(\\)( .*)?"
# Check we can unwind the stack-pointer and the frame base
# address correctly.