From 8ac3646fbbb5f1e0442caa55559513d593136f8c Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 16 Jan 2013 17:27:53 +0000 Subject: [PATCH] * 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". gdb/doc * gdb.texinfo (GDB/MI Breakpoint Information): Document "catch-type" field. (GDB/MI Catchpoint Commands): Add "catch-type" to examples. gdb/testsuite * gdb.mi/mi-catch-load.exp: Look for "catch-type". --- gdb/ChangeLog | 7 +++++++ gdb/breakpoint.c | 28 ++++++++++++++++++++++++-- gdb/doc/ChangeLog | 6 ++++++ gdb/doc/gdb.texinfo | 8 ++++++-- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.mi/mi-catch-load.exp | 4 ++-- 6 files changed, 51 insertions(+), 6 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1014bb4dcb4..f595d2e328d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2013-01-16 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-16 Yao Qi * printcmd.c (current_display_number): Make it static. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 4d76fa1be0f..bd6ceb89da7 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7529,6 +7529,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 @@ -7642,6 +7645,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 @@ -7840,6 +7846,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 @@ -8251,6 +8261,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 @@ -8488,6 +8501,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 @@ -11536,9 +11552,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/ChangeLog b/gdb/doc/ChangeLog index 0eb574d032c..906e56f9f72 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2013-01-16 Tom Tromey + + * gdb.texinfo (GDB/MI Breakpoint Information): Document + "catch-type" field. + (GDB/MI Catchpoint Commands): Add "catch-type" to examples. + 2013-01-07 Tom Tromey * gdb.texinfo (Mode Options): Don't mention -epoch. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f9732630ee8..89dc01086bd 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -27957,6 +27957,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}, @@ -28867,7 +28871,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 @@ -28896,7 +28900,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/ChangeLog b/gdb/testsuite/ChangeLog index d34f7c0e2f7..21d01ccf9a7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-01-16 Tom Tromey + + * gdb.mi/mi-catch-load.exp: Look for "catch-type". + 2013-01-15 Jan Kratochvil * gdb.dwarf2/dw2-restrict.exp: Skip compilation on non-x86_64 targets. diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp index 34494a29349..7ebf2257dce 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" -- 2.30.2