From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [RFA/doco+NEWS] Document the -catch-assert and -catch-exception new GDB/MI commands.
Date: Fri, 11 Oct 2013 10:44:00 -0000 [thread overview]
Message-ID: <1381488255-7201-1-git-send-email-brobecker@adacore.com> (raw)
In-Reply-To: <1381232908-5868-1-git-send-email-brobecker@adacore.com>
Hello,
This patch adds documentation for the new GDB/MI commands "-catch-assert"
and "-catch-exception", meant to provide the same functionality as
the "catch assert", "catch exception" and "catch exception unhandled"
CLI commands.
In the GDB Manual, there was already a section for catchpoint comments,
so that seemed like a natural place to document the new commands. But
commands related to a given concept seem to have traditionally been
organized alphabetically, and I didn't want future commands to break
down logical pairing of various commands. For instance, "-catch-load"
and "-catch-unload" are quite "distant" from each other, and it is easy
to imagine a new comment which would alphabetically fall in between,
causing them to be separated. So I introduced subsections to prevent
that from happening.
gdb/ChangeLog:
* NEWS: Add entry documenting the new "-catch-assert" and
"-catch-exception" GDB/MI commands.
gdb/doc/ChangeLog:
* gdb.texinfo (Shared Library GDB/MI Catchpoint Commands):
New subsection inside which the "-catch-load" and "-catch-unload"
commands documentation is now placed.
(Ada Exception GDB/MI Catchpoint Commands): New subsection
documenting the "-catch-assert" and "-catch-exception" new
GDB/MI commands.
Tested on x86_64-linux. OK to apply?
Thank you,
--
Joel
---
gdb/NEWS | 3 ++
gdb/doc/gdb.texinfo | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 102 insertions(+)
diff --git a/gdb/NEWS b/gdb/NEWS
index 4e627b0..10834df 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -149,6 +149,9 @@ show range-stepping
command, stopping the program's execution at the start of its
main subprogram.
+ ** The new commands -catch-assert and -catch-exceptions insert
+ catchpoints stopping the program when Ada exceptions are raised.
+
* New system-wide configuration scripts
A GDB installation now provides scripts suitable for use as system-wide
configuration scripts for the following systems:
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 24773ea..44fb174 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -30328,6 +30328,14 @@ thread-groups=["i1"],times="1"@}]@}
This section documents @sc{gdb/mi} commands for manipulating
catchpoints.
+@menu
+* Shared Library GDB/MI Catchpoint Commands::
+* Ada Exception GDB/MI Catchpoint Commands::
+@end menu
+
+@node Shared Library GDB/MI Catchpoint Commands
+@subsection Shared Library @sc{gdb/mi} Catchpoints
+
@subheading The @code{-catch-load} Command
@findex -catch-load
@@ -30386,6 +30394,97 @@ what="load of library matching bar.so",catch-type="unload",times="0"@}
(gdb)
@end smallexample
+@node Ada Exception GDB/MI Catchpoint Commands
+@subsection Ada Exception @sc{gdb/mi} Catchpoints
+
+The following @sc{gdb/mi} commands can be used to create catchpoints
+that stop the execution when Ada exceptions are being raised.
+
+@subheading The @code{-catch-assert} Command
+@findex -catch-assert
+
+@subsubheading Synopsis
+
+@smallexample
+ -catch-assert [ -c @var{condition}] [ -d ] [ -t ]
+@end smallexample
+
+Add a catchpoint for failed Ada assertions.
+
+The possible optional parameters for this command are:
+
+@table @samp
+@item -c @var{condition}
+Make the catchpoint conditional on @var{condition}.
+@item -d
+Create a disabled catchpoint.
+@item -t
+Create a temporary catchpoint.
+@end table
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{catch assert}.
+
+@subsubheading Example
+
+@smallexample
+-catch-assert
+^done,bkptno="5",bkpt=@{number="5",type="breakpoint",disp="keep",
+enabled="y",addr="0x0000000000404888",what="failed Ada assertions",
+thread-groups=["i1"],times="0",
+original-location="__gnat_debug_raise_assert_failure"@}
+(gdb)
+@end smallexample
+
+@subheading The @code{-catch-exception} Command
+@findex -catch-exception
+
+@subsubheading Synopsis
+
+@smallexample
+ -catch-exception [ -c @var{condition}] [ -d ] [ -e @var{exception-name} ]
+ [ -t ] [ -u ]
+@end smallexample
+
+Add a catchpoint stopping when Ada exceptions are raised.
+By default, the command stops the program when any Ada exception
+gets raised. But it is also possible, by using some of the
+optional parameters described below, to create more selective
+catchpoints.
+
+The possible optional parameters for this command are:
+
+@table @samp
+@item -c @var{condition}
+Make the catchpoint conditional on @var{condition}.
+@item -d
+Create a disabled catchpoint.
+@item -e @var{exception-name}
+Only stop when @var{exception-name} is raised. This option cannot
+be used combined with @samp{-u}.
+@item -t
+Create a temporary catchpoint.
+@item -u
+Stop only when an unhandled exception gets raised. This option
+cannot be used combined with @samp{-e}.
+@end table
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} commands are @samp{catch exception}
+and @samp{catch exception unhandled}.
+
+@subsubheading Example
+
+@smallexample
+-catch-exception -e Program_Error
+^done,bkptno="4",bkpt=@{number="4",type="breakpoint",disp="keep",
+enabled="y",addr="0x0000000000404874",
+what="`Program_Error' Ada exception", thread-groups=["i1"],
+times="0",original-location="__gnat_debug_raise_exception"@}
+(gdb)
+@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Program Context
--
1.8.1.2
next prev parent reply other threads:[~2013-10-11 10:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 11:48 GDB/MI: New commands to catch Ada exceptions Joel Brobecker
2013-10-08 11:48 ` [RFA/commit 4/4] Adjust gdb.ada/mi_catch_ex.exp to use GDB/MI catch commands Joel Brobecker
2013-10-08 11:48 ` [commit/Ada 2/4] Add "ada_" prefix to enum ada_exception_catchpoint_kind Joel Brobecker
2013-10-08 11:48 ` [commit/Ada 1/4] Rework a bit Ada exception catchpoint support (in prep for GDB/MI) Joel Brobecker
2013-10-08 11:48 ` [RFA/RFC 3/4] New GDB/MI commands to catch Ada exceptions Joel Brobecker
2013-10-10 20:50 ` GDB/MI: New " Tom Tromey
2013-10-11 10:47 ` Joel Brobecker
2013-10-11 13:52 ` checked in: " Joel Brobecker
2013-10-11 10:44 ` Joel Brobecker [this message]
2013-10-11 11:21 ` [RFA/doco+NEWS] Document the -catch-assert and -catch-exception new GDB/MI commands Eli Zaretskii
2013-10-11 13:53 ` checked in: " Joel Brobecker
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=1381488255-7201-1-git-send-email-brobecker@adacore.com \
--to=brobecker@adacore.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