Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: RFA: [1/2] add "catch-type" to all catchpoints
Date: Thu, 03 Jan 2013 18:16:00 -0000	[thread overview]
Message-ID: <87obh62ku3.fsf_-_@fleche.redhat.com> (raw)
In-Reply-To: <87y5hfvu5v.fsf@fleche.redhat.com>

[ re-sending since something went weird ]

This patch adds the "catch-type" field to the description of all
catchpoints in gdb.  This was agreed upon in the "catch signal" thread.

It needs at least a doc review.

Any comments?

Built and regtested on x86-64 Fedora 16.

Tom

2013-01-03  Tom Tromey  <tromey@redhat.com>

	* breakpoint.c (print_one_catch_fork, print_one_catch_vfork)
	(print_one_catch_solib, print_one_catch_syscall)
	(print_one_catch_exec, print_one_exception_catchpoint): Emit
	"catch-type".

2013-01-03  Tom Tromey  <tromey@redhat.com>

	* gdb.texinfo (GDB/MI Breakpoint Information): Document
	"catch-type" field.
	(GDB/MI Catchpoint Commands): Add "catch-type" to examples.

2013-01-03  Tom Tromey  <tromey@redhat.com>

	* gdb.mi/mi-catch-load.exp: Look for "catch-type".

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index e56d9df..81271c8 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -7538,6 +7538,9 @@ print_one_catch_fork (struct breakpoint *b, struct bp_location **last_loc)
                         ptid_get_pid (c->forked_inferior_pid));
       ui_out_spaces (uiout, 1);
     }
+
+  if (ui_out_is_mi_like_p (uiout))
+    ui_out_field_string (uiout, "catch-type", "fork");
 }
 
 /* Implement the "print_mention" breakpoint_ops method for fork
@@ -7651,6 +7654,9 @@ print_one_catch_vfork (struct breakpoint *b, struct bp_location **last_loc)
                         ptid_get_pid (c->forked_inferior_pid));
       ui_out_spaces (uiout, 1);
     }
+
+  if (ui_out_is_mi_like_p (uiout))
+    ui_out_field_string (uiout, "catch-type", "vfork");
 }
 
 /* Implement the "print_mention" breakpoint_ops method for vfork
@@ -7849,6 +7855,10 @@ print_one_catch_solib (struct breakpoint *b, struct bp_location **locs)
     }
   ui_out_field_string (uiout, "what", msg);
   xfree (msg);
+
+  if (ui_out_is_mi_like_p (uiout))
+    ui_out_field_string (uiout, "catch-type",
+			 self->is_load ? "load" : "unload");
 }
 
 static void
@@ -8260,6 +8270,9 @@ print_one_catch_syscall (struct breakpoint *b,
   else
     ui_out_field_string (uiout, "what", "<any syscall>");
   ui_out_text (uiout, "\" ");
+
+  if (ui_out_is_mi_like_p (uiout))
+    ui_out_field_string (uiout, "catch-type", "syscall");
 }
 
 /* Implement the "print_mention" breakpoint_ops method for syscall
@@ -8497,6 +8510,9 @@ print_one_catch_exec (struct breakpoint *b, struct bp_location **last_loc)
       ui_out_field_string (uiout, "what", c->exec_pathname);
       ui_out_text (uiout, "\" ");
     }
+
+  if (ui_out_is_mi_like_p (uiout))
+    ui_out_field_string (uiout, "catch-type", "exec");
 }
 
 static void
@@ -11545,9 +11561,17 @@ print_one_exception_catchpoint (struct breakpoint *b,
   if (b->loc)
     *last_loc = b->loc;
   if (strstr (b->addr_string, "throw") != NULL)
-    ui_out_field_string (uiout, "what", "exception throw");
+    {
+      ui_out_field_string (uiout, "what", "exception throw");
+      if (ui_out_is_mi_like_p (uiout))
+	ui_out_field_string (uiout, "catch-type", "throw");
+    }
   else
-    ui_out_field_string (uiout, "what", "exception catch");
+    {
+      ui_out_field_string (uiout, "what", "exception catch");
+      if (ui_out_is_mi_like_p (uiout))
+	ui_out_field_string (uiout, "catch-type", "catch");
+    }
 }
 
 static void
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index dbd0c77..fd8e58e 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -27982,6 +27982,10 @@ of a multi-location breakpoint, this will be a dotted pair, like
 The type of the breakpoint.  For ordinary breakpoints this will be
 @samp{breakpoint}, but many values are possible.
 
+@item catch-type
+If the type of the breakpoint is @samp{catchpoint}, then this
+indicates the exact type of catchpoint.
+
 @item disp
 This is the breakpoint disposition---either @samp{del}, meaning that
 the breakpoint will be deleted at the next stop, or @samp{keep},
@@ -28892,7 +28896,7 @@ The corresponding @value{GDBN} command is @samp{catch load}.
 @smallexample
 -catch-load -t foo.so
 ^done,bkpt=@{number="1",type="catchpoint",disp="del",enabled="y",
-what="load of library matching foo.so",times="0"@}
+what="load of library matching foo.so",catch-type="load",times="0"@}
 (gdb)
 @end smallexample
 
@@ -28921,7 +28925,7 @@ The corresponding @value{GDBN} command is @samp{catch unload}.
 @smallexample
 -catch-unload -d bar.so
 ^done,bkpt=@{number="2",type="catchpoint",disp="keep",enabled="n",
-what="load of library matching bar.so",times="0"@}
+what="load of library matching bar.so",catch-type="unload",times="0"@}
 (gdb)
 @end smallexample
 
diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp
index 34494a2..7ebf225 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp
@@ -49,7 +49,7 @@ mi_run_to_main
 # test -catch-load
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-load: auto-solib-add on"
 mi_gdb_test "222-catch-load -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"load of library matching mi-catch-load-so\.so\\*\",catch-type=\"load\",times=\"0\"\}" \
     "catch-load: catch load"
 mi_send_resuming_command "exec-continue" "catch-load: continue"
 
@@ -76,7 +76,7 @@ mi_run_to_main
 # test -catch-unload
 mi_gdb_test "111-gdb-set auto-solib-add on" "111\\^done" "catch-unload: auto-solib-add on"
 mi_gdb_test "222-catch-unload -t mi-catch-load-so.so*" \
-    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",times=\"0\"\}" \
+    "222\\^done,bkpt=\{number=\"2\",type=\"catchpoint\",disp=\"del\",enabled=\"y\",what=\"unload of library matching mi-catch-load-so\.so\\*\",catch-type=\"unload\",times=\"0\"\}" \
     "catch-unload: catch unload"
 mi_send_resuming_command "exec-continue" "catch-unload: continue"
 


  parent reply	other threads:[~2013-01-03 18:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-16 19:07 RFC: implement "catch signal" Tom Tromey
2012-11-16 19:49 ` Eli Zaretskii
2012-11-17  2:22 ` Yao Qi
2012-12-02  9:38 ` Jan Kratochvil
2012-12-03 18:59   ` Tom Tromey
2012-12-03 19:37     ` Jan Kratochvil
2012-12-03 19:39       ` Tom Tromey
2012-12-03 20:22         ` André Pönitz
2012-12-03 20:31           ` Jan Kratochvil
2012-12-07 18:42             ` Tom Tromey
2012-12-07 19:28               ` Jan Kratochvil
2012-12-07 19:47                 ` Tom Tromey
2012-12-07 20:04                   ` Jan Kratochvil
2012-12-17 21:43                     ` Tom Tromey
2012-12-18 16:39                       ` Jan Kratochvil
2012-12-18 16:45                         ` Tom Tromey
2012-12-18 16:50                           ` Jan Kratochvil
2012-12-19 19:32                       ` Tom Tromey
2012-12-19 20:11                         ` Marc Khouzam
2012-12-20  8:58                         ` Dodji Seketeli
2013-01-03 18:06                           ` Tom Tromey
2012-12-07 18:41           ` Tom Tromey
2013-01-03 18:16     ` Tom Tromey [this message]
2013-01-03 18:39       ` RFA: [1/2] add "catch-type" to all catchpoints Eli Zaretskii
2013-01-16 17:23       ` Tom Tromey
2013-01-03 18:23     ` RFA: [2/2] catch signal Tom Tromey
2013-01-16 17:28       ` Tom Tromey

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=87obh62ku3.fsf_-_@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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