}
gdb_test "step" "bar \\(\\) at.*" "step 1"
- gdb_test "step" ".*" "step 2"; # Return from foo()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
- gdb_test "step" ".*" "step 4"; # Return from bar()
+ gdb_test "step" ".*" "step 2"; # Return from bar()
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at .*" "step"
+ gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}
gdb_test_no_output "skip enable 7"
gdb_test "step" "bar \\(\\) at.*" "step 1"
gdb_test "step" ".*" "step 2"; # Return from bar()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step"
gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}
gdb_test_no_output "skip enable 8"
gdb_test "step" "bar \\(\\) at.*" "step 1"
gdb_test "step" ".*" "step 2"; # Return from bar()
- gdb_test "step" "foo \\(\\) at.*" "step 3"
+ # With gcc 9.2.0 we jump once back to main before entering foo here.
+ # If that happens try to step a second time.
+ gdb_test "step" "foo \\(\\) at.*" "step 3" "main \\(\\) at.*" "step"
gdb_test "step" ".*" "step 4"; # Return from foo()
gdb_test "step" "main \\(\\) at.*" "step 5"
}