aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-07-01 18:35:36 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-07-01 18:35:36 +0000
commit00eb2c4ae81736e51d2bac0fbab4f8b04ab3d319 (patch)
treeab6eea88206b85df3e784f31f598a65b47555335 /gdb
parent85a20c42eacf836502c5dc0cc2afbd24666b2e86 (diff)
downloadgdb-00eb2c4ae81736e51d2bac0fbab4f8b04ab3d319.zip
gdb-00eb2c4ae81736e51d2bac0fbab4f8b04ab3d319.tar.gz
gdb-00eb2c4ae81736e51d2bac0fbab4f8b04ab3d319.tar.bz2
bettter display for temporary Ada exception catchpoints
Temporary catchpoints on Ada exceptions are now displayed as "Temporary catchpoint" as opposed to just "Catchpoint". This is cosmetic only, but in line with what's done for other catchpoints as well as breakpoints. gdb/ChangeLog: * ada-lang.c (print_it_exception): Print temporary catchpoints as "Temporary catchpoint". (print_mention_exception): Likewise. gdb/testsuite/ChangeLog: * gdb.ada/catch_ex.exp: Add temporary catchpoint tests.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/ada-lang.c26
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.ada/catch_ex.exp30
4 files changed, 58 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b5762b7..eacb247 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+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,
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 766bfc8..752af87 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -11085,7 +11085,9 @@ print_it_exception (enum exception_catchpoint_kind ex, struct breakpoint *b)
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, ", ");
@@ -11194,24 +11196,32 @@ print_mention_exception (enum exception_catchpoint_kind ex,
{
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:
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index e0c4a0a..6f84e43 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2011-07-01 Joel Brobecker <brobecker@adacore.com>
+
+ * gdb.ada/catch_ex.exp: Add temporary catchpoint tests.
+
2011-07-01 Jan Kratochvil <jan.kratochvil@redhat.com>
Test GCC PR debug/49546.
diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp
index 7fc2895..fa458d8 100644
--- a/gdb/testsuite/gdb.ada/catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex.exp
@@ -145,4 +145,34 @@ gdb_test "continue" \
"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"
+
+