public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Gareth Rees <grees@undo.io>
To: Eli Zaretskii <eliz@gnu.org>
Cc: aburgess@redhat.com, gdb-patches@sourceware.org
Subject: Re: [PATCH v5] [PR mi/29554] New PRINT-VALUES option '--scalar-values'.
Date: Fri, 10 Mar 2023 12:58:01 +0000	[thread overview]
Message-ID: <CAA8DSpGgAQWA2EH2Ctr3B0tpZ9BtZ4r9SZjbYALXJSur2TSa2g@mail.gmail.com> (raw)
In-Reply-To: <83r0twzu8r.fsf@gnu.org>

Eli Zaretskii wrote:
> The reason why I preferred #2 is simple: it avoids incompatible
> changes in the behavior of existing options.  Since it was not really
> clear-cut that the previous behavior was a bug, the backward
> incompatibility could cause trouble to some application or use case
> which didn't consider it was a bug and relied on that behavior.
> Introducing a new option is free from this problem.

Let me set out an argument for the existing behaviour being a bug. The
documentation for the -stack-list-arguments GDB/MI command [1] says:

> If print-values is [...] 2 or --simple-values, print the name, type
> and value for simple data types, and the name and type for arrays,
> structures and unions.

There is similar wording for the -stack-list-locals and
-stack-list-variables GDB/MI commands. The documentation does not say
what happens for reference types, but a natural way to read it is that
references to simple data types are simple, and references to compound
data types are not simple. That's certainly how I interpreted the
documentation when trying to fix the Visual Studio Code stack trace
performance issue [2]: my first attempt a pull request for this
problem used --simple-values [3] and you can see from the review
comments on the pull request that I wasn't the first developer to
interpret the documentation in this way: previously Visual Studio Code
had used --simple-values but this turned out not to work due to
references to compound types being considered simple [4].

This discrepancy between documentation and behaviour seems likely that
the current behaviour of --simple-values is a mistake (perhaps the
original implementer neglected to consider reference types, because
languages like C don't have them).

Anyway, this is not a blocker for me: I am happy to implement a new
option if that's what the GDB developers agree is the best approach.
But I also think the history of work on the Visual Studio Code issue
shows that the current behaviour of --simple-values is itself a bug
magnet.

[1] https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI-Stack-Manipulation.html
[2] https://github.com/microsoft/MIEngine/issues/1349
[3] https://github.com/microsoft/MIEngine/pull/1350
[4] https://github.com/microsoft/MIEngine/pull/673

  reply	other threads:[~2023-03-10 12:58 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  7:18 [PATCH] [gdb/mi] Don't treat references to compound values as "simple" 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
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 [this message]
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=CAA8DSpGgAQWA2EH2Ctr3B0tpZ9BtZ4r9SZjbYALXJSur2TSa2g@mail.gmail.com \
    --to=grees@undo.io \
    --cc=aburgess@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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).