diff options
Diffstat (limited to 'gdb/testsuite/gdb.opt/solib-intra-step.exp')
-rw-r--r-- | gdb/testsuite/gdb.opt/solib-intra-step.exp | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp index 14b34ea..ad19895 100644 --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp @@ -48,33 +48,54 @@ if ![runto_main] then { } set test "first-hit" +set state 0 gdb_test_multiple "step" $test { - -re " first-hit .*\r\n$gdb_prompt $" { - pass $test + -re -wrap " first-hit .*" { + gdb_assert { $state != -1 } $test } - -re " first-retry .*\r\n$gdb_prompt $" { - gdb_test "step" " first-hit .*" "first-hit (optimized)" + -re -wrap " first-retry .*" { + if { $state != 0 } { + set state -1 + } else { + set state 1 + } + send_gdb "step\n" + exp_continue + } + -re -wrap "get_pc_thunk.*" { + if { $state != 1 } { + set state -1 + } else { + set state 2 + } + send_gdb "step\n" + exp_continue } } set test "second-hit" +set state 0 gdb_test_multiple "step" $test { - -re " second-hit .*\r\n$gdb_prompt $" { - pass $test + -re -wrap " second-hit .*" { + gdb_assert { $state != -1 } $test } - -re " first-retry .*\r\n$gdb_prompt $" { - set test "second-hit (optimized 1)" - gdb_test_multiple "step" $test { - -re " second-hit .*\r\n$gdb_prompt $" { - pass $test - } - -re " first-hit .*\r\n$gdb_prompt $" { - gdb_test "step" " second-hit .*" "second-hit (optimized 2)" - } + -re -wrap " second-retry .*" { + if { $state != 0 } { + set state -1 + } else { + set state 1 } + send_gdb "step\n" + exp_continue } - -re " second-retry .*\r\n$gdb_prompt $" { - gdb_test "step" " second-hit .*" "second-hit (optimized 3)" + -re -wrap "get_pc_thunk.*" { + if { $state != 1 } { + set state -1 + } else { + set state 2 + } + send_gdb "step\n" + exp_continue } } |