public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Gareth Rees <grees@undo.io>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb/mi] Don't treat references to compound values as "simple".
Date: Thu, 08 Sep 2022 16:30:06 +0300	[thread overview]
Message-ID: <834jxif0yp.fsf@gnu.org> (raw)
In-Reply-To: <20220908110248.1084-1-grees@undo.io> (message from Gareth Rees via Gdb-patches on Thu, 8 Sep 2022 12:02:48 +0100)

> Date: Thu,  8 Sep 2022 12:02:48 +0100
> From: Gareth Rees via Gdb-patches <gdb-patches@sourceware.org>
> 
> There are two ways we could fix this problem, depending on whether we
> consider the current behaviour to be a bug.
> 
> 1. If the current behaviour is a bug, then we can update the behaviour
>    of '--simple-values' so that it takes reference types into account:
>    that is, a value is simple if it is neither an array, struct, or
>    union, nor a reference to an array, struct or union.
> 
>    In this case we must add a feature to the '-list-features' command so
>    that IDEs can detect that it is safe to use the '--simple-values'
>    argument when refreshing the call stack.
> 
> 2. If the current behaviour is not a bug, then we can add a new option
>    for the PRINT-VALUES argument, for example, '--simplest-values' (3),
>    that would be suitable for use by IDEs.
> 
>    In this case we must add a feature to the '-list-features' command so
>    that IDEs can detect that the '--simplest-values' argument is
>    available for use when refreshing the call stack.
> 
> PATCH
> 
> This patch implements solution (1) as I think the current behaviour of
> not printing structures, but printing references to structures, is
> contrary to reasonable expectation.

Thanks.  FWIW, I think we should implement 2, not 1.

> --- a/gdb/NEWS
> +++ b/gdb/NEWS
> @@ -114,6 +114,18 @@ maintenance info line-table
>    entry corresponds to an address where a breakpoint should be placed
>    to be at the first instruction past a function's prologue.
>  
> +* MI changes
> +
> +  ** The '--simple-values' argument to the '-stack-list-arguments',
> +     '-stack-list-locals', '-stack-list-variables', and
> +     '-var-list-children' commands takes reference types into account:
> +     that is, a value is now considered simple if it is neither an
> +     array, structure, or union, nor a reference to an array, structure,
> +     or union.

Isn't it easier to say "only if the value is a scalar"?

> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 238a49b027d..5ccf6609709 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -37295,6 +37295,13 @@ option (@pxref{GDB/MI Program Execution}).
>  @item data-disassemble-a-option
>  Indicates that the @code{-data-disassemble} command supports the @option{-a}
>  option (@pxref{GDB/MI Data Manipulation}).
> +@item simple-values-ref-types
> +Indicates that the @code{--simple-values} argument to the
> +@code{-stack-list-arguments}, @code{-stack-list-locals},
> +@code{-stack-list-variables}, and @code{-var-list-children} commands
> +takes reference types into account: that is, a value is considered
> +simple if it neither an array, structure, or union, nor a reference to
> +an array, structure, or union.
>  @end ftable

Same here.

Other than that, the documentation parts are OK.

  reply	other threads:[~2022-09-08 13:30 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  7:18 [PATCH] " Gareth Rees
2022-09-08 10:27 ` Andrew Burgess
2022-09-08 11:02   ` [PATCH v2] " Gareth Rees
2022-09-08 13:30     ` Eli Zaretskii [this message]
2022-09-08 13:58       ` Gareth Rees
2022-09-08 14:07         ` Eli Zaretskii
2022-09-09  8:01       ` [PATCH v3] [PR mi/29554] New PRINT-VALUES option '--scalar-values' Gareth Rees
2022-09-15  9:06         ` [PING] " Gareth Rees
2022-09-25  8:15         ` Gareth Rees
2022-09-25  8:25           ` Eli Zaretskii
2022-09-25  9:00             ` Gareth Rees
2022-09-25 10:16               ` Eli Zaretskii
2022-09-26 12:48                 ` Gareth Rees
2022-09-25 10:16           ` Eli Zaretskii
2022-09-26 12:46         ` [PATCH v4] " Gareth Rees
2022-10-04  9:08           ` [PING] " Gareth Rees
2022-10-18 11:59             ` Gareth Rees
2022-10-12 16:38           ` Andrew Burgess
2022-10-20 17:47             ` [PATCH v5] " Gareth Rees
2022-10-20 18:00               ` Eli Zaretskii
2022-11-03 16:20               ` [PING] " Gareth Rees
2022-11-14  9:25                 ` Gareth Rees
2022-12-01 13:41                 ` Gareth Rees
2022-12-14  8:50                 ` Gareth Rees
2023-02-01 10:00                 ` Gareth Rees
2023-02-16 10:08                 ` Gareth Rees
2023-03-06  9:52                 ` Gareth Rees
2023-03-08 12:35               ` Andrew Burgess
2023-03-10 11:04                 ` Gareth Rees
2023-03-10 12:05                   ` Eli Zaretskii
2023-03-10 12:58                     ` Gareth Rees
2023-03-13 17:17                     ` Andrew Burgess
2023-03-16 12:28                       ` Gareth Rees
2023-03-11 11:58                   ` Gareth Rees
2023-04-11 13:15                     ` Pedro Alves
2023-03-11 11:49               ` [PATCH v6] [gdb/mi] Don't treat references to compound values as "simple" Gareth Rees
2023-03-21  9:50                 ` [PING] " Gareth Rees
2023-03-26  9:56                   ` Gareth Rees
2023-04-03  9:22                     ` Gareth Rees
2023-05-04 15:08                       ` Tom Tromey
2023-04-18  9:23                   ` Gareth Rees
2023-04-24  9:53                   ` Gareth Rees
2023-05-02  9:13                   ` Gareth Rees
2023-03-27 14:34                 ` Tom Tromey
2023-03-29  9:14                   ` Gareth Rees
2023-04-06 17:18                   ` Gareth Rees
2022-10-20 17:58             ` [PATCH v4] [PR mi/29554] New PRINT-VALUES option '--scalar-values' Gareth Rees
2022-09-09  8:04       ` [PATCH v2] [gdb/mi] Don't treat references to compound values as "simple" Gareth Rees
2022-09-08 11:09   ` [PATCH] " Gareth Rees

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=834jxif0yp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=grees@undo.io \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).