From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48898 invoked by alias); 4 Dec 2019 16:18:32 -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 48879 invoked by uid 89); 4 Dec 2019 16:18:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=1993, HX-Received:a5d X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Dec 2019 16:18:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575476309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ulMzpdn9DWsxYqbNEpDyO0abmh1NSQ7UorfSER+BboI=; b=h0d0Qd0s6S5l5mjRr3/73LibA8xjkCPEOVOlBGQKbOAsaCCkn6lJFFF9IPRkCKyYof+hFn wLOQ4uwMC5p6VxqRfMV2oOTobICfwzTnIXL83imW4WryppSPfwIyrt14un2CrdzGcnPjtb bVAGDV4dcmiZ9wN+Apo1D5QDNlvbOHM= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-wATqg9l8OSG_XgI8a9kIpg-1; Wed, 04 Dec 2019 11:18:26 -0500 Received: by mail-wr1-f72.google.com with SMTP id b2so80685wrj.9 for ; Wed, 04 Dec 2019 08:18:26 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id a14sm9174154wrx.81.2019.12.04.08.18.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Dec 2019 08:18:23 -0800 (PST) Subject: Re: PING^3 Re: [RFA] Implement 'print -raw-values' and 'set print raw-values on|off' To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20190807193924.32268-1-philippe.waroquiers@skynet.be> From: Pedro Alves Message-ID: <896334b9-1d3e-d485-7d1b-2e23dac2dfaa@redhat.com> Date: Wed, 04 Dec 2019 16:18:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-12/txt/msg00140.txt.bz2 On 10/20/19 11:26 AM, Philippe Waroquiers wrote: > --- a/gdb/printcmd.c > +++ b/gdb/printcmd.c > @@ -1152,6 +1152,9 @@ print_command_parse_format (const char **expp, const char *cmdname, > { > const char *exp = *expp; > > + /* opts->raw value might already have been set by 'set print raw-values' > + or by using 'print -raw-values'. > + So, do not set opts->raw to 0, only set it to 1 if /r is given. */ > if (exp && *exp == '/') Given this ... > diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp > index 82e7e65031..3d88f7e9f2 100644 > --- a/gdb/testsuite/gdb.python/py-prettyprint.exp > +++ b/gdb/testsuite/gdb.python/py-prettyprint.exp > @@ -199,3 +199,13 @@ gdb_test_no_output "python enable_lookup_function ()" > > gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>" \ > "print ss enabled #2" > + > +gdb_test "print -raw-values -- ss" " = {a = {a = 1, b = $hex}, b = {a = 2, b = $hex}}" \ > + "print -raw-values -- ss" > + > +gdb_test "print -raw-values on -- ss" " = {a = {a = 1, b = $hex}, b = {a = 2, b = $hex}}" \ > + "print -raw-values on -- ss" > + ... could you add some tests combining /r and -raw-values, to show & exercise what the comment above means? Thanks, Pedro Alves