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?
Asked
Active
Viewed 836 times
4

Xaldew
- 1,181
- 9
- 20
-
People tend to script their own gdb commands to do that, so I suspect this isn't Emacs-related anyway – wasamasa Feb 19 '19 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 Feb 20 '19 at 08:52
1 Answers
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.

Xaldew
- 1,181
- 9
- 20
-
[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](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34589) correct? – FrostKiwi Nov 03 '19 at 17:11
-
2That 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 Nov 04 '19 at 10:04
-
1Yes please! This would be great to have. Congratulations on figuring out the legal limbo, looking forward to using your patch. – Clément Nov 10 '19 at 05:22
-
For reference, the patches were merged to Emacs 29. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34589#74 – jobor Jun 22 '22 at 11:20