aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.ada/mi_catch_ex.exp41
2 files changed, 36 insertions, 10 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b33e1be..8656082 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2016-06-21 Pedro Alves <palves@redhat.com>
+ * gdb.ada/mi_catch_ex.exp (continue_to_exception): New procedure.
+ (top level): Use it instead of mi_execute_to.
+
+2016-06-21 Pedro Alves <palves@redhat.com>
+
* gdb.python/py-mi-events-gdb.py (stop_handler_str)
(cont_handler_str): New.
(signal_stop_handler): Set stop_handler_str instead of printing to
diff --git a/gdb/testsuite/gdb.ada/mi_catch_ex.exp b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
index 320f3bf..288a065 100644
--- a/gdb/testsuite/gdb.ada/mi_catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/mi_catch_ex.exp
@@ -78,17 +78,38 @@ mi_gdb_test "-catch-exception" \
"\\^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. #