From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17583 invoked by alias); 10 Nov 2013 06:29:44 -0000 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 Received: (qmail 17573 invoked by uid 89); 10 Nov 2013 06:29:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_05,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from Unknown (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 10 Nov 2013 06:29:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 52CD111642B; Sun, 10 Nov 2013 01:30:05 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OfCl2HxPI+3c; Sun, 10 Nov 2013 01:30:05 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CEE981163AE; Sun, 10 Nov 2013 01:30:04 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 97A97E05D6; Sun, 10 Nov 2013 10:29:30 +0400 (RET) Date: Sun, 10 Nov 2013 09:49:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: gdb-patches@sourceware.org Subject: Re: [RFA/Ada(v2) 3/3] Document "info exceptions" and "-info-ada-exception" new commands. Message-ID: <20131110062930.GD4585@adacore.com> References: <1383912219-13012-1-git-send-email-brobecker@adacore.com> <1383912219-13012-4-git-send-email-brobecker@adacore.com> <8338n756ih.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="bAmEntskrkuBymla" Content-Disposition: inline In-Reply-To: <8338n756ih.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2013-11/txt/msg00264.txt.bz2 --bAmEntskrkuBymla Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 320 > OK with those changes. Thanks. Thank you for the review and corrections. Attached is what I will commit once the code is approved. In addition to making the required fixes, I noticed that I had made the same mistake in NEWS ("whose names", with an 's' at the end of "name"), so I fixed that too. Cheers :) -- Joel --bAmEntskrkuBymla Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0003-Document-info-exceptions-and-info-ada-exception-new-.patch" Content-length: 6512 >From b8534d6b307497793d2f3dca065cb1b72858c071 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 8 Nov 2013 14:21:14 +0400 Subject: [PATCH 3/3] Document "info exceptions" and "-info-ada-exception" new commands. gdb/doc/ChangeLog: * gdb.texinfo (Ada): Add entry in menu for new "Ada Exceptions" node. (Ada Exceptions): New node. (GDB/MI): Add entry in menu for new "GDB/MI Ada Exceptions Commands" node. (GDB/MI Ada Exceptions Commands): New node. (GDB/MI Miscellaneous Commands): Document new "info-ada-exceptions" field in the output of the "-list-features" command. * NEWS: Add entry for the new "info exceptions" CLI command, and for the new "-info-ada-exceptions" GDB/MI command. --- gdb/NEWS | 9 +++++ gdb/doc/gdb.texinfo | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/gdb/NEWS b/gdb/NEWS index efeda68..6c3c272 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -80,6 +80,12 @@ remove-symbol-file -a ADDRESS can be identified by its filename or by an address that lies within the boundaries of this symbol file in memory. +info exceptions +info exceptions REGEXP + Display the list of Ada exceptions defined in the program being + debugged. If provided, only the exceptions whose names match REGEXP + are listed. + * New options set debug symfile off|on @@ -163,6 +169,9 @@ show startup-with-shell ** The new commands -catch-assert and -catch-exceptions insert catchpoints stopping the program when Ada exceptions are raised. + ** The new command -info-ada-exceptions provides the equivalent of + the new "info exceptions" command. + * 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 39498d7..9127f94 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -14965,6 +14965,7 @@ to be difficult. * Omissions from Ada:: Restrictions on the Ada expression syntax. * Additions to Ada:: Extensions of the Ada expression syntax. * Stopping Before Main Program:: Debugging the program during elaboration. +* Ada Exceptions:: Ada Exceptions * Ada Tasks:: Listing and setting breakpoints in tasks. * Ada Tasks and Core Files:: Tasking Support when Debugging Core Files * Ravenscar Profile:: Tasking Support when using the Ravenscar @@ -15289,6 +15290,42 @@ Manual, the elaboration code is invoked from a procedure called elaboration, simply use the following two commands: @code{tbreak adainit} and @code{run}. +@node Ada Exceptions +@subsubsection Ada Exceptions + +A command is provided to list all Ada exceptions: + +@table @code +@kindex info exceptions +@item info exceptions +@itemx info exceptions @var{regexp} +The @code{info exceptions} command allows you to list all Ada exceptions +defined within the program being debugged, as well as their addresses. +With a regular expression, @var{regexp}, as argument, only those exceptions +whose names match @var{regexp} are listed. +@end table + +Below is a small example, showing how the command can be used, first +without argument, and next with a regular expression passed as an +argument. + +@smallexample +(@value{GDBP}) info exceptions +All defined Ada exceptions: +constraint_error: 0x613da0 +program_error: 0x613d20 +storage_error: 0x613ce0 +tasking_error: 0x613ca0 +const.aint_global_e: 0x613b00 +(@value{GDBP}) info exceptions const.aint +All Ada exceptions matching regular expression "const.aint": +constraint_error: 0x613da0 +const.aint_global_e: 0x613b00 +@end smallexample + +It is also possible to ask @value{GDBN} to stop your program's execution +when an exception is raised. For more details, see @ref{Set Catchpoints}. + @node Ada Tasks @subsubsection Extensions for Ada Tasks @cindex Ada, tasking @@ -28603,6 +28640,7 @@ may repeat one or more times. @end ignore * GDB/MI Target Manipulation:: * GDB/MI File Transfer Commands:: +* GDB/MI Ada Exceptions Commands:: * GDB/MI Miscellaneous Commands:: @end menu @@ -34692,6 +34730,59 @@ The corresponding @value{GDBN} command is @samp{remote delete}. @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Ada Exceptions Commands +@section Ada Exceptions @sc{gdb/mi} Commands + +@subheading The @code{-info-ada-exceptions} Command +@findex -info-ada-exceptions + +@subsubheading Synopsis + +@smallexample + -info-ada-exceptions [ @var{regexp}] +@end smallexample + +List all Ada exceptions defined within the program being debugged. +With a regular expression @var{regexp}, only those exceptions whose +names match @var{regexp} are listed. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info exceptions}. + +@subsubheading Result + +The result is a table of Ada exceptions. The following columns are +defined for each exception: + +@table @samp +@item name +The name of the exception. + +@item address +The address of the exception. + +@end table + +@subsubheading Example + +@smallexample +-info-ada-exceptions aint +^done,ada-exceptions=@{nr_rows="2",nr_cols="2", +hdr=[@{width="1",alignment="-1",col_name="name",colhdr="Name"@}, +@{width="1",alignment="-1",col_name="address",colhdr="Address"@}], +body=[@{name="constraint_error",address="0x0000000000613da0"@}, +@{name="const.aint_global_e",address="0x0000000000613b00"@}]@} +@end smallexample + +@subheading Catching Ada Exceptions + +The commands describing how to ask @value{GDBN} to stop when a program +raises an exception are described at @ref{Ada Exception GDB/MI +Catchpoint Commands}. + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Miscellaneous Commands @section Miscellaneous @sc{gdb/mi} Commands @@ -34877,7 +34968,9 @@ Indicates support for the @code{-data-read-memory-bytes} and the Indicates that changes to breakpoints and breakpoints created via the CLI will be announced via async records. @item ada-task-info -Indicates support for the @code{-ada-task-info} command. +indicates support for the @code{-ada-task-info} command. +@item info-ada-exceptions +indicates support for the @code{-info-ada-exceptions} command. @end table @subheading The @code{-list-target-features} Command -- 1.8.1.2 --bAmEntskrkuBymla--