bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34589: 26.1.91; GDB-MI Display Complex Data Types


From: Gustaf Waldemarson
Subject: bug#34589: 26.1.91; GDB-MI Display Complex Data Types
Date: Thu, 21 Feb 2019 14:42:54 +0100

I took a stab at it, but it turned out to be a bit more complicated
than I thought:

- The `-stack-list-locals` accepts one of three flags, 0, 1, or 2 (or
equivalently, --no-values, --all-values or --simple-values).
   - No-values only prints the variable name,
   - All values print the variable name and the associated value.
   - Simple-values print the name, type and value for simple types.
   - There is no option to print everything (name, type and value),
this feels like an oversight in the API, but can be worked around,
sort of.

What I ended up doing was to create a new "handler" that runs before
the original one that records the variable name/value pair in a
hash-table, that the original handler can refer to for the value of
complex data-types. This works. but feels like a significant
work-around.

Additionally, when I was going through the GDB-MI documentation, I
noticed that `-stack-list-locals` is deprecated and should be replaced
with `-stack-list-variables`, so the second patch fixes that.
Incidentally, this also allow function arguments (argv, argc, etc) to
show up in the variable buffer.

I've attached the patches that accomplishes the above, but you may
want to have someone review it that actually knows at bit more about
gdb-mi.el.

I haven't contributed anything before either, so there might very well
be some other details that I've missed.

Best regards,
Gustaf


Den ons 20 feb. 2019 kl 18:16 skrev Eli Zaretskii <eliz@gnu.org>:
>
> > From: Gustaf Waldemarson <gustaf.waldemarson@gmail.com>
> > Date: Wed, 20 Feb 2019 11:08:15 +0100
> >
> > Since as C++ (and other languages) is moving more and more towards these
> > kinds non-simple data types, I figured I should send out a feature
> > request for something like the following:
> >
> > - Remove "--simple-values" by default.
> >
> > - Add a customizable variable such as `gdb-simple-values-only`, which
> >   adds the above flag.
> >
> > - Add a customizable variable such as `gdb-locals-value-limit` to limit
> >   the length a value is allowed to be shown.
> >
> > - Add a simple filter of the retrieved value string to make it fit on a
> >   single line (e.g., a simple version could just remove all newlines).
>
> Thanks.  We don't have an active developer for gdb-mi.el for the
> moment, so please consider writing these changes and submitting the
> patches here.

Attachment: 0002-gdb-mi.el-Use-stack-list-variables.patch
Description: Text Data

Attachment: 0001-gdb-mi.el-Display-complex-data-types.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]