clean_restart ${testfile}
if ![runto_main] then {
- fail "Cannot run to main, testcase aborted"
+ fail "cannot run to main, testcase aborted"
return 0
}
####################################
if ![mi_run_to_main] then {
- fail "Cannot run to main, testcase aborted"
+ fail "cannot run to main, testcase aborted"
return 0
}
"\\^done,bkptno=\"$decimal\",bkpt={.*disp=\"keep\",enabled=\"y\",addr=\"$hex\",what=\"all Ada exceptions\",.*}" \
"catch all exceptions"
-mi_execute_to "exec-continue" \
- "breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"CONSTRAINT_ERROR" \
- "foo" "" ".*" ".*" \
- ".*" \
- "continue until CE caught by all-exceptions catchpoint"
+# Continue to caught exception.
-mi_execute_to "exec-continue" \
- "breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"PROGRAM_ERROR" \
- "foo" "" ".*" ".*" \
- ".*" \
- "continue until PE caught by all-exceptions catchpoint"
+proc continue_to_exception { exception_name test } {
+ global hex any_nb
+
+ mi_send_resuming_command "exec-continue" "$test"
+
+ # Match console stream output.
+ gdb_expect {
+ -re " $exception_name at $hex in foo " {
+ }
+ timeout {
+ fail "$test (timeout)"
+ return -1
+ }
+ }
+
+ # Now MI stream output.
+ mi_expect_stop \
+ "breakpoint-hit\",disp=\"keep\",bkptno=\"$any_nb\",exception-name=\"$exception_name" \
+ "foo" "" ".*" ".*" \
+ ".*" \
+ $test
+}
+
+continue_to_exception \
+ "CONSTRAINT_ERROR" \
+ "continue until CE caught by all-exceptions catchpoint"
+
+continue_to_exception \
+ "PROGRAM_ERROR" \
+ "continue until PE caught by all-exceptions catchpoint"
################################################
# 2. Try catching only some of the exceptions. #
# - continue, the program exits.
if ![mi_run_to_main] then {
- fail "Cannot run to main, testcase aborted"
+ fail "cannot run to main, testcase aborted"
return 0
}