From patchwork Sat May 11 18:56:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 32650 Received: (qmail 59002 invoked by alias); 11 May 2019 18:56:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 58955 invoked by uid 89); 11 May 2019 18:56:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=influence, indicated, influencing, controls X-HELO: mailsec109.isp.belgacom.be Received: from mailsec109.isp.belgacom.be (HELO mailsec109.isp.belgacom.be) (195.238.20.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 11 May 2019 18:56:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1557600978; x=1589136978; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qpgznfS332yIjs81iVdRCAgXnUSYS21so4DjlvHykc4=; b=owuwyuAIFAv3cTFQLMxPGeC0ntQdmAA2b0WjxjlZraolbSYbPfhJACwG ijbU6z0FyUu8jo2dM7cigcj64vvBWw==; Received: from 59.151-129-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.129.151.59]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 11 May 2019 20:56:09 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFAv2 3/3] Document 'set print frame-info|frame-arguments presence'. Date: Sat, 11 May 2019 20:56:03 +0200 Message-Id: <20190511185603.17231-4-philippe.waroquiers@skynet.be> In-Reply-To: <20190511185603.17231-1-philippe.waroquiers@skynet.be> References: <20190511185603.17231-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes --- gdb/NEWS | 13 ++++++++++ gdb/doc/ChangeLog | 5 ++++ gdb/doc/gdb.texinfo | 58 ++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 73 insertions(+), 3 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 288615b8cd..b766d4394e 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -46,6 +46,19 @@ show print max-depth The default max-depth is 20, but this can be set to unlimited to get the old behavior back. +set print frame-info [short-location|location|location-and-address + |source-and-location|source-line|auto] +show print frame-info + This controls what frame information is printed by the commands printing + a frame. This setting will e.g. influence the behaviour of 'backtrace', + 'frame', stepi. The python frame filtering also respect this setting. + +* Changed commands + +set print frame-arguments + The new value 'presence' indicates to only indicate the presence of + arguments using ..., instead of printing argument names and values. + *** Changes in GDB 8.3 * GDB and GDBserver now support access to additional registers on diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index fe7f33ba7b..b252f066c0 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -12840,3 +12840,8 @@ fill-column: 74 version-control: never coding: utf-8 End: +2019-05-04 Philippe Waroquiers + + * gdb.texinfo (Print Settings): Document 'set|show print frame-info'. + (Backtraces): Reference 'set print frame-info'. + diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 1fb4e3df6a..f1f0a98d8c 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -7554,6 +7554,8 @@ The value of parameter @code{data} in frame 1 has been replaced by only if it is a scalar (integer, pointer, enumeration, etc). See command @kbd{set print frame-arguments} in @ref{Print Settings} for more details on how to configure the way function parameter values are printed. +The command @kbd{set print frame-info} (@pxref{Print Settings}) controls +what frame information is printed. @cindex optimized out, in backtrace @cindex function call arguments, optimized out @@ -10385,7 +10387,7 @@ If the number is 0, then the printing is unlimited. @cindex printing frame argument values @cindex print all frame argument values @cindex print frame argument values for scalars only -@cindex do not print frame argument values +@cindex do not print frame arguments This command allows to control how the values of arguments are printed when the debugger prints a frame (@pxref{Frames}). The possible values are: @@ -10413,6 +10415,17 @@ is replaced by @code{@dots{}}. In this case, the example above now becomes: #1 0x08048361 in call_me (i=@dots{}, s=@dots{}, ss=@dots{}, u=@dots{}, e=@dots{}) at frame-args.c:23 @end smallexample + +@item presence +Only the presence of arguments is indicated by @code{@dots{}}. +The @code{@dots{}} are not printed for function without any arguments. +None of the argument names and values are printed. +In this case, the example above now becomes: + +@smallexample +#1 0x08048361 in call_me (@dots{}) at frame-args.c:23 +@end smallexample + @end table By default, only scalar arguments are printed. This command can be used @@ -10423,8 +10436,8 @@ information printed in each frame, making the backtrace more readable. Also, it improves performance when displaying Ada frames, because the computation of large arguments can sometimes be CPU-intensive, especially in large applications. Setting @code{print frame-arguments} -to @code{scalars} (the default) or @code{none} avoids this computation, -thus speeding up the display of each Ada frame. +to @code{scalars} (the default), @code{none} or @code{presence} avoids +this computation, thus speeding up the display of each Ada frame. @item show print frame-arguments Show how the value of arguments should be displayed when printing a frame. @@ -10556,6 +10569,45 @@ entry resolution see @ref{set debug entry-values}. Show the method being used for printing of frame argument values at function entry. +@item set print frame-info @var{value} +@kindex set print frame-info +@cindex printing frame information +@cindex frame information, printing +This command allows to control the information printed when +the debugger prints a frame. See @ref{Frames}, @ref{Backtrace}, +for a general explanation about frames and frame information. +Note that some other settings (such as @code{set print frame-arguments} +and @code{set print address}) are also influencing if and how some frame +information is displayed. In particular, the frame program counter is never +printed if @code{set print address} is off. + +The possible values for @code{set print frame-info} are: +@table @code +@item short-location +Print the frame level, the program counter (if not at the +beginning of the location source line), the function, the function +arguments. +@item location +Same as @code{short-location} but also print the source file and source line +number. +@item location-and-address +Same as @code{location} but print the program counter even if located at the +beginning of the location source line. +@item source-line +Print the program counter (if not at the beginning of the location +source line), the line number and the source line. +@item source-and-location +Print what @code{location} and @code{source-line} are printing. +@item auto +The information printed for a frame is decided automatically +by the @value{GDBN} command that prints a frame. +For example, @code{frame} prints the information printed by +@code{source-and-location} while @code{stepi} will switch between +@code{source-line} and @code{source-and-location} depending on the program +counter. +The default value is @code{auto}. +@end table + @item set print repeats @var{number-of-repeats} @itemx set print repeats unlimited @cindex repeated array elements