+2011-07-01 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-lang.c (print_it_exception): Print temporary catchpoints
+ as "Temporary catchpoint".
+ (print_mention_exception): Likewise.
+
2011-07-01 Tom Tromey <tromey@redhat.com>
* jv-lang.c (java_language_defn): Use java_printchar,
ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
}
- ui_out_text (uiout, "\nCatchpoint ");
+ ui_out_text (uiout,
+ b->disposition == disp_del ? "\nTemporary catchpoint "
+ : "\nCatchpoint ");
ui_out_field_int (uiout, "bkptno", b->number);
ui_out_text (uiout, ", ");
{
struct ada_catchpoint *c = (struct ada_catchpoint *) b;
+ ui_out_text (uiout, b->disposition == disp_del ? _("Temporary catchpoint ")
+ : _("Catchpoint "));
+ ui_out_field_int (uiout, "bkptno", b->number);
+ ui_out_text (uiout, ": ");
+
switch (ex)
{
case ex_catch_exception:
if (c->excep_string != NULL)
- printf_filtered (_("Catchpoint %d: `%s' Ada exception"),
- b->number, c->excep_string);
+ {
+ char *info = xstrprintf (_("`%s' Ada exception"), c->excep_string);
+ struct cleanup *old_chain = make_cleanup (xfree, info);
+
+ ui_out_text (uiout, info);
+ do_cleanups (old_chain);
+ }
else
- printf_filtered (_("Catchpoint %d: all Ada exceptions"), b->number);
-
+ ui_out_text (uiout, _("all Ada exceptions"));
break;
case ex_catch_exception_unhandled:
- printf_filtered (_("Catchpoint %d: unhandled Ada exceptions"),
- b->number);
+ ui_out_text (uiout, _("unhandled Ada exceptions"));
break;
case ex_catch_assert:
- printf_filtered (_("Catchpoint %d: failed Ada assertions"), b->number);
+ ui_out_text (uiout, _("failed Ada assertions"));
break;
default:
"Continuing\..*$inferior_exited_re.*" \
"continuing to program completion"
+#################################
+# 3. Try temporary catchpoints. #
+#################################
+
+# Scenario:
+# - Insert a temporary catchpoint on all exceptions.
+# - Run to that catchpoint
+# - Continue; we should reach the program's exit, not stopping
+# at any of the other exceptions that are being raised inside
+# the program.
+
+if ![runto_main] then {
+ fail "Cannot run to main, testcase aborted"
+ return 0
+}
+
+gdb_test "tcatch exception" \
+ "Temporary catchpoint $any_nb: all Ada exceptions"
+
+set temp_catchpoint_msg \
+ "Temporary catchpoint $any_nb, CONSTRAINT_ERROR at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
+gdb_test "continue" \
+ "Continuing\.$eol$temp_catchpoint_msg$eol.*SPOT1" \
+ "continuing to temporary catchpoint"
+
+gdb_test "continue" \
+ "Continuing\..*$inferior_exited_re.*" \
+ "continuing to program completion"
+
+