4

The GDB local variable window (in the multi-window view) usually works fine to track local variables. However, I've recently been coding a lot in C++, and almost all variables are some kind of struct/class, which is just displayed as <complex data type>, which isn't very useful. Is there any way of telling Emacs (or GDB?) to display said data type anyways? Maybe even with some upper limit?

2
  • People tend to script their own gdb commands to do that, so I suspect this isn't Emacs-related anyway
    – wasamasa
    Commented Feb 19, 2019 at 17:25
  • Hmm, aren't those kinds of scripts intended for pretty printing the types? Which isn't necessarily the same as displaying the data itself?
    – Xaldew
    Commented Feb 20, 2019 at 8:52

1 Answer 1

6

After some research, I found out that the <complex data type> string is indeed added by Emacs. In particular, Emacs uses the "--simple-values" flag sent to the GDB-MI interface to only retrieve values that are "simple". Currently, there is no way of customizing this behavior, save for editing the gdb-mi.el in the Emacs source itself.

For this reason I have submitted a feature request to the main Emacs developers, which you can view here. If you consider something like that useful, considering chiming in to the discussion there instead.

4
  • [Sry can't comment with sub 50 rep] I'm sick of using gud-watch + Speedbar to view structs, since under certain circumstances it's a buggy mess. I'm looking forward to the mentioned patch in gdb-mi.el.. ..but let me get this straigth: The patch was stopped due to legal issues in Feb/Mar and is now in limbo. Is my interpretation of the email chain correct?
    – FrostKiwi
    Commented Nov 3, 2019 at 17:11
  • 2
    That was correct up until about a month ago. The legal limbo has been resolved and I'm now allowed to submit patches to Emacs. Unfortunately, I've just not really had the time to finish up the patches and re-open the tickets, but since people are waiting on them I'll try to get on with it
    – Xaldew
    Commented Nov 4, 2019 at 10:04
  • 1
    Yes please! This would be great to have. Congratulations on figuring out the legal limbo, looking forward to using your patch.
    – Clément
    Commented Nov 10, 2019 at 5:22
  • For reference, the patches were merged to Emacs 29. See debbugs.gnu.org/cgi/bugreport.cgi?bug=34589#74
    – jobor
    Commented Jun 22, 2022 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.