From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26079 invoked by alias); 8 Aug 2019 17:25:49 -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 25944 invoked by uid 89); 8 Aug 2019 17:25:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Aug 2019 17:25:41 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hvmAU-0002iI-WC; Thu, 08 Aug 2019 13:25:39 -0400 Received: from [176.228.60.248] (port=4844 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hvmAU-0006aC-2b; Thu, 08 Aug 2019 13:25:38 -0400 Date: Thu, 08 Aug 2019 17:25:00 -0000 Message-Id: <8336ibbmd1.fsf@gnu.org> From: Eli Zaretskii To: Philippe Waroquiers CC: gdb-patches@sourceware.org In-reply-to: <20190807193924.32268-1-philippe.waroquiers@skynet.be> (message from Philippe Waroquiers on Wed, 7 Aug 2019 21:39:24 +0200) Subject: Re: [RFA] Implement 'print -raw-values' and 'set print raw-values on|off' References: <20190807193924.32268-1-philippe.waroquiers@skynet.be> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00207.txt.bz2 > From: Philippe Waroquiers > Cc: Philippe Waroquiers > Date: Wed, 7 Aug 2019 21:39:24 +0200 > > diff --git a/gdb/NEWS b/gdb/NEWS > index fa01adf6e8..8f27b102ea 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -101,6 +101,12 @@ 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 raw-values [on|off] > +show print raw-values > + By default, GDB applies the enabled pretty printers when printing a > + value. This allows to ignore the enabled pretty printers for a series > + of commands. The default is 'off'. > + > set logging debugredirect [on|off] > By default, GDB debug output will go to both the terminal and the logfile. > Set if you want debug output to go only to the log file. > @@ -200,6 +206,7 @@ maint show test-options-completion-result > -null-stop [on|off] > -object [on|off] > -pretty [on|off] > + -raw-values [on|off] > -repeats NUMBER|unlimited > -static-members [on|off] > -symbol [on|off] > @@ -244,11 +251,11 @@ maint show test-options-completion-result > "on" if omitted. This allows writing compact command invocations, > like for example: > > - (gdb) p -r -p -o 0 -- *myptr > + (gdb) p -ra -p -o 0 -- *myptr > > The above is equivalent to: > > - (gdb) print -raw -pretty -object off -- *myptr > + (gdb) print -raw-values -pretty -object off -- *myptr > > ** The "info types" command now supports the '-q' flag to disable > printing of some header information in a similar fashion to "info This part is OK. > +@item set print raw-values off > +Print values in pretty-printed form, if there is a pretty-printer > +for the value (@pxref{Pretty Printing}), > +otherwise print the value in raw form. > +This is the default. I suggest a slight rewording: +@anchor{set print raw-values} +@item set print raw-values on +Print values in raw form, without applying the pretty +printers for the value. + +@item set print raw-values off +Print values in pretty-printed form, if there is a pretty-printer +for the value (@pxref{Pretty Printing}), +otherwise print the value in raw form. + +The default setting is OFF. > +The print option @code{-raw-values} and @value{GDBN} setting @xref{set > +print raw-values} can be used to print values without applying the This use of @xref is a bad idea, because the printed output and even the Info output that result from this look like a typo. For starters, @xref produces a capitalized "See", which is inappropriate in the middle of a sentence. My suggestion is to use the following style: The print option @code{-raw-values} and @value{GDBN} setting @code{set print raw-values} (@pxref{set print raw-values}) can be used to print ... Yes, this repeats some of the text, but there's nothing much we can do about that. > +Similarly, the backtrace option @code{-raw-frame-arguments} and > +@value{GDBN} setting @xref{set print raw-frame-arguments} can be used > +to ignore the enabled pretty printers when printing frame argument > +values Likewise here. Also, a period is missing at the end of the last sentence. Thanks.