Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch] catchpoints bring output in-line with breakpoints output
Date: Tue, 27 May 2008 21:32:00 -0000	[thread overview]
Message-ID: <g1hknu$ap3$1@ger.gmane.org> (raw)
In-Reply-To: <g1hjgi$681$1@ger.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

Aleksandar Ristovski wrote:
> Hello,
> 
> This patch brings catchpoint output in line with breakpoints output:

The previous patch was not complete... mention was not changed (sorry). Now the complete diff is attached.

And I just noticed a bug I introduced with the pending catchpoints, tempflag was ignored (thus always creating permanent catchpoints)... oops on my behalf...



New ChangeLog:

2008-05-27  Aleksandar Ristovski  <aristovski@qnx.com>

	* breakpoint.c (print_exception_catchpoint): In CLI add 'Temporary' for
	temporary catchpoints.  In MI add missing fields 'reason', 'disp', 
	'bkptno'.
	(print_mention_exception_catchpoint): Add 'Temporary' for temporary
	catchpoints.
	(handle_gnu_v3_exceptions): Use tempflag.

[-- Attachment #2: catchpointsMI20080527.diff --]
[-- Type: text/plain, Size: 2582 bytes --]

Index: gdb/breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.321
diff -u -p -r1.321 breakpoint.c
--- gdb/breakpoint.c	4 May 2008 19:38:59 -0000	1.321
+++ gdb/breakpoint.c	27 May 2008 18:38:00 -0000
@@ -6495,14 +6495,34 @@ catch_unload_command_1 (char *arg, int t
 static enum print_stop_action
 print_exception_catchpoint (struct breakpoint *b)
 {
+  int bp_temp;
+  char msg[160];
+  const char * msgspec;
+  const char msgfmt[] = "\n%s %d (exception %s)\n";
+
   annotate_catchpoint (b->number);
 
   if (strstr (b->addr_string, "throw") != NULL)
-    printf_filtered (_("\nCatchpoint %d (exception thrown)\n"),
-		     b->number);
+    msgspec = "thrown";
   else
-    printf_filtered (_("\nCatchpoint %d (exception caught)\n"),
-		     b->number);
+    msgspec = "caught";
+  if (b->loc->address != b->loc->requested_address)
+    breakpoint_adjustment_warning (b->loc->requested_address,
+	                           b->loc->address,
+				   b->number, 1);
+  bp_temp = b->loc->owner->disposition == disp_del;
+  sprintf (msg, msgfmt, 
+	   bp_temp ? "Temporary catchpoint" : "Catchpoint", 
+	   b->number, msgspec);
+  ui_out_text (uiout, msg);
+  if (ui_out_is_mi_like_p (uiout))
+    {
+      ui_out_field_string (uiout, "reason", 
+			   async_reason_lookup (EXEC_ASYNC_BREAKPOINT_HIT));
+      ui_out_field_string (uiout, "disp", bpdisp_text (b->disposition));
+    }
+  ui_out_field_int (uiout, "bkptno", b->number);
+  ui_out_text (uiout, ", ");
 
   return PRINT_SRC_AND_LOC;
 }
@@ -6530,10 +6550,15 @@ print_one_exception_catchpoint (struct b
 static void
 print_mention_exception_catchpoint (struct breakpoint *b)
 {
+  int bp_temp;
+
+  bp_temp = b->loc->owner->disposition == disp_del;
   if (strstr (b->addr_string, "throw") != NULL)
-    printf_filtered (_("Catchpoint %d (throw)"), b->number);
+    printf_filtered (bp_temp ? _("Temporary catchpoint %d (throw)")
+			     : _("Catchpoint %d (throw)"), b->number);
   else
-    printf_filtered (_("Catchpoint %d (catch)"), b->number);
+    printf_filtered (bp_temp ? _("Temporary catchpoint %d (catch)")
+			     : _("Catchpoint %d (catch)"), b->number);
 }
 
 static struct breakpoint_ops gnu_v3_exception_catchpoint_ops = {
@@ -6555,7 +6580,7 @@ handle_gnu_v3_exceptions (int tempflag, 
 
   break_command_really (trigger_func_name, cond_string, -1,
 			0 /* condition and thread are valid.  */,
-			0, 0,
+			tempflag, 0,
 			0,
 			AUTO_BOOLEAN_TRUE /* pending */,
 			&gnu_v3_exception_catchpoint_ops, from_tty);

  reply	other threads:[~2008-05-27 18:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 20:01 Aleksandar Ristovski
2008-05-27 21:32 ` Aleksandar Ristovski [this message]
2008-05-27 23:25   ` Eli Zaretskii
2008-05-28 15:20     ` Aleksandar Ristovski
2008-05-28 16:25       ` Eli Zaretskii
2008-05-28 19:31         ` Aleksandar Ristovski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g1hknu$ap3$1@ger.gmane.org' \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox