[gdb/testsuite] Allow debug srcfile2 in gdb.base/unwind-on-each-insn.exp

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]]} {
...

This shortcuts the test due to no longer recognizing that stepi still lands
in foo.

Fix this by determining whether still in foo by checking the info frame output.

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries
2023-01-25 15:24:17 +01:00
parent 621271c781
commit d25a8dbc7c

View File

@ -142,9 +142,11 @@ proc do_test { function step_cmd } {
break break
} }
gdb_test $step_cmd
set in_fn 0 set in_fn 0
gdb_test_multiple $step_cmd "" { gdb_test_multiple "info frame" "" {
-re -wrap "$::hex in $function \\(\\)" { -re -wrap "rip = $::hex in ${function}( \\(.*\\))?;.*" {
set in_fn 1 set in_fn 1
} }
-re -wrap "" {} -re -wrap "" {}