diff options
author | Joel Brobecker <brobecker@adacore.com> | 2017-11-24 17:09:42 -0500 |
---|---|---|
committer | Joel Brobecker <brobecker@adacore.com> | 2017-11-24 17:15:30 -0500 |
commit | e547c119d043f2ecffb70452020ab9150d083a91 (patch) | |
tree | a10b51c4f842670ed00ce3970ee54adbafa9d55a /gdb/doc | |
parent | 5f1ca24acd8fd4e21c4f6f3ed2bbc4e2365215fe (diff) | |
download | gdb-e547c119d043f2ecffb70452020ab9150d083a91.zip gdb-e547c119d043f2ecffb70452020ab9150d083a91.tar.gz gdb-e547c119d043f2ecffb70452020ab9150d083a91.tar.bz2 |
(Ada) provide the exception message when hitting an exception catchpoint
This patch enhances the debugger to print the exception message, when
available, as part of an exception catchpoint hit notification (both
GDB/CLI and GDB/MI). For instance, with the following code...
procedure A is
begin
raise Constraint_Error with "hello world";
end A;
... instead of printing...
Catchpoint 1, CONSTRAINT_ERROR at 0x000000000040245c in a () at a.adb:3
... it now prints:
Catchpoint 1, CONSTRAINT_ERROR (hello world) at 0x000000000040245c in a ()
^^^^^^^^^^^^^
This enhancement requires runtime support. If not present, the debugger
just behaves as before.
In GDB/MI mode, if the exception message is available, it is provided
as an extra field named "exception-message" in the catchpoint notification:
*stopped,bkptno="1",[...],exception-name="CONSTRAINT_ERROR",
exception-message="hello world",[...]
gdb/ChangeLog:
* ada-lang.c (ada_exception_message_1, ada_exception_message):
New functions.
(print_it_exception): If available, display the exception
message as well.
* NEWS: Document new feature.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Ada Exception Information): Document
new "exception-message" field.
gdb/testsuite/ChangeLog:
* gdb.ada/catch_ex.exp, gdb.ada/mi_catch_ex.exp,
gdb.ada/mi_ex_cond.exp: Accept optional exception message in
when hitting an exception catchpoint.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 79a4025..988b7b8 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2017-11-24 Joel Brobecker <brobecker@adacore.com> + + * gdb.texinfo (GDB/MI Ada Exception Information): Document + new "exception-message" field. + 2017-11-24 Simon Marchi <simon.marchi@ericsson.com> * gdb.texinfo (Memory Map Format): Update gdb-memory-map.dtd. @@ -12,7 +17,6 @@ * gdb.texinfo (Requirements): Document use of GNU MPFR. - 2017-11-16 Phil Muldoon <pmuldoon@redhat.com> * python.texi (Basic Python): Add rbreak documentation. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index f706746..00451d2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -27201,7 +27201,9 @@ thread was last seen on. This field is optional. Whenever a @code{*stopped} record is emitted because the program stopped after hitting an exception catchpoint (@pxref{Set Catchpoints}), @value{GDBN} provides the name of the exception that was raised via -the @code{exception-name} field. +the @code{exception-name} field. Also, for exceptions that were raised +with an exception message, @value{GDBN} provides that message via +the @code{exception-message} field. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Simple Examples |