From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ocIZDGxZ7V9iHAAAWB0awg (envelope-from ) for ; Wed, 30 Dec 2020 23:54:04 -0500 Received: by simark.ca (Postfix, from userid 112) id 22F2D1F0AA; Wed, 30 Dec 2020 23:54:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 761161E99A for ; Wed, 30 Dec 2020 23:54:03 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E284385802B; Thu, 31 Dec 2020 04:54:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E284385802B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609390442; bh=JLaVHJPPyc4x7ThQ/7yIwct4JmdmEM6KScYjIcOwhmU=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HuCyMR4182ZyNS2V0VbGJp/Jyt+2dgp4Fv0Nep28a2pj6DK8RI64tTpLXkvntOz7Y 3lV7L4ByvQFipFOdw2M51h/hl9ygv86wssmLSW5ScA3RY3XuiwAGhObrHwWZCiivgN 1Vt3I3Xe6JlRPLC5f0s8y9gj/bkpZCooUUwYM6zU= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 3E3D1385802B for ; Thu, 31 Dec 2020 04:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3E3D1385802B Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 0BV4rsqH015888 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Dec 2020 23:53:59 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 0BV4rsqH015888 Received: from [10.0.0.213] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A0B631E99A; Wed, 30 Dec 2020 23:53:54 -0500 (EST) Subject: Re: [PATCH 4/4] Fix raw-frame-arguments in combination with frame-filters To: Hannes Domani , gdb-patches@sourceware.org References: <20201229170227.821-1-ssbssa@yahoo.de> <20201229170227.821-4-ssbssa@yahoo.de> Message-ID: <52196aba-3452-5ff2-e2a0-14b0c554faa3@polymtl.ca> Date: Wed, 30 Dec 2020 23:53:54 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20201229170227.821-4-ssbssa@yahoo.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 31 Dec 2020 04:53:54 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2020-12-29 12:02 p.m., Hannes Domani via Gdb-patches wrote: > Currently, if frame-filters are active, raw-values is used instead of > raw-frame-arguments to decide if a pretty-printer should be invoked for > frame arguments in a backtrace. > > This adds the PRINT_RAW_FRAME_ARGUMENTS flag to frame_filter_flag which is > then used in the frame-filter to override the raw flag in enumerate_args. I'm not sure I understand the problem, but I have a small comment for the test case: > diff --git a/gdb/testsuite/gdb.python/py-frame-args.exp b/gdb/testsuite/gdb.python/py-frame-args.exp > index fd9c1f4342..7c621e1302 100644 > --- a/gdb/testsuite/gdb.python/py-frame-args.exp > +++ b/gdb/testsuite/gdb.python/py-frame-args.exp > @@ -34,6 +34,28 @@ gdb_test_no_output "source ${remote_python_file}" "load python file" > gdb_breakpoint [gdb_get_line_number "break-here"] > gdb_continue_to_breakpoint "break-here" ".* break-here .*" > > +# Test raw-frame-arguments on backtrace with and without frame-filter > +foreach filtered [list "enable" "disable"] { > + gdb_test_no_output "$filtered frame-filter global BasicFrameFilter" > + > + gdb_test "bt 1" \ > + ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \ > + "bt frame-filter=$filtered,pretty" > + > + gdb_test "bt -raw-frame-arguments on 1" \ > + ".*foo \\(x=42, ss=\[.\]{3}\\).*" \ > + "bt frame-filter=$filtered,raw" > + > + # "set print raw-values" should not affect frame arguments > + gdb_test_no_output "set print raw-values on" \ > + "raw-values-on,frame-filter=$filtered" > + gdb_test "bt 1" \ > + ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \ > + "bt frame-filter=$filtered,pretty,raw-values" > + gdb_test_no_output "set print raw-values off" \ > + "raw-values-off,frame-filter=$filtered" > +} You can use foreach_with_prefix, that will ensure test names are unique without having to include frame-filter=$filtered in each test name. Something like this: # Test raw-frame-arguments on backtrace with and without frame-filter foreach_with_prefix filtered {enable disable} { gdb_test_no_output "$filtered frame-filter global BasicFrameFilter" gdb_test "bt 1" \ ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \ "bt pretty" gdb_test "bt -raw-frame-arguments on 1" \ ".*foo \\(x=42, ss=\[.\]{3}\\).*" \ "bt raw" # "set print raw-values" should not affect frame arguments gdb_test_no_output "set print raw-values on" gdb_test "bt 1" \ ".*foo \\(x=42, ss=super struct = {\[.\]{3}}\\).*" \ "bt pretty,raw-values" gdb_test_no_output "set print raw-values off" } Simon