From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18758 invoked by alias); 3 Jan 2013 18:16:53 -0000 Received: (qmail 18733 invoked by uid 22791); 3 Jan 2013 18:16:52 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jan 2013 18:16:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r03IGcxj025180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 3 Jan 2013 13:16:38 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r03IGaUb026228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 3 Jan 2013 13:16:37 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFA: [1/2] add "catch-type" to all catchpoints References: <874nkpv03j.fsf@fleche.redhat.com> <20121202093807.GA21883@host2.jankratochvil.net> <87y5hfvu5v.fsf@fleche.redhat.com> Date: Thu, 03 Jan 2013 18:16:00 -0000 Message-ID: <87obh62ku3.fsf_-_@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00050.txt.bz2 [ 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 * 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 * gdb.texinfo (GDB/MI Breakpoint Information): Document "catch-type" field. (GDB/MI Catchpoint Commands): Add "catch-type" to examples. 2013-01-03 Tom Tromey * 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", ""); 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"