Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Hannes Domani <ssbssa@yahoo.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] Fix raw-frame-arguments in combination with frame-filters
Date: Wed, 30 Dec 2020 23:53:54 -0500	[thread overview]
Message-ID: <52196aba-3452-5ff2-e2a0-14b0c554faa3@polymtl.ca> (raw)
In-Reply-To: <20201229170227.821-4-ssbssa@yahoo.de>

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

  reply	other threads:[~2020-12-31  4:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201229170227.821-1-ssbssa.ref@yahoo.de>
2020-12-29 17:02 ` [PATCH 1/4] Fix wrong method name Hannes Domani via Gdb-patches
2020-12-29 17:02   ` [PATCH 2/4] Return true in TuiWindow.is_valid only if TUI is enabled Hannes Domani via Gdb-patches
2020-12-31  4:24     ` Simon Marchi via Gdb-patches
2021-01-15 16:48     ` Andrew Burgess
2021-01-15 17:22       ` Hannes Domani via Gdb-patches
2021-01-17 11:31       ` Andrew Burgess
2021-01-17 13:19         ` Hannes Domani via Gdb-patches
2021-01-18 10:30           ` Andrew Burgess
2021-01-18 11:29             ` Hannes Domani via Gdb-patches
2021-01-23 17:54           ` Andrew Burgess
2021-01-23 17:55             ` Andrew Burgess
2021-01-24 12:33               ` Hannes Domani via Gdb-patches
2021-02-06 19:38               ` Tom Tromey
2021-02-08 11:58                 ` Andrew Burgess
2021-02-08 19:19                   ` Tom Tromey
2021-01-18 17:19       ` Eli Zaretskii via Gdb-patches
2020-12-29 17:02   ` [PATCH 3/4] Add optional styled argument to gdb.execute Hannes Domani via Gdb-patches
2020-12-29 17:19     ` Eli Zaretskii via Gdb-patches
2020-12-31  4:28     ` Simon Marchi via Gdb-patches
2020-12-29 17:02   ` [PATCH 4/4] Fix raw-frame-arguments in combination with frame-filters Hannes Domani via Gdb-patches
2020-12-31  4:53     ` Simon Marchi via Gdb-patches [this message]
2020-12-31 14:01       ` Hannes Domani via Gdb-patches
2021-01-31  7:13     ` Joel Brobecker
2020-12-29 17:18   ` [PATCH 1/4] Fix wrong method name Eli Zaretskii via Gdb-patches
2020-12-29 17:39     ` Hannes Domani via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52196aba-3452-5ff2-e2a0-14b0c554faa3@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=ssbssa@yahoo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox