[PATCH v2] [gdb/mi] Don't treat references to compound values as "simple".

Gareth Rees grees@undo.io
Fri Sep 9 08:04:47 GMT 2022


Eli Zaretskii <eliz@gnu.org> wrote:
> > 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.
>
> Thanks.  FWIW, I think we should implement 2, not 1.

I have prepared a new patch that implements solution (2), adding a
'--scalar-values' option for the PRINT-VALUES argument to
'-stack-list-arguments' and similar commands. This option prints the
value only for scalars and so matches the behaviour of the 'scalars'
argument to the 'set print frame-arguments' command. References to
structures are not scalars, and so the option is suitable for use by
IDEs.

See my e-mail with subject: "[PATCH v3] [PR mi/29554] New PRINT-VALUES
option '--scalar-values'."


More information about the Gdb-patches mailing list