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?
-
People tend to script their own gdb commands to do that, so I suspect this isn't Emacs-related anyway– wasamasaCommented 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?– XaldewCommented Feb 20, 2019 at 8:52
1 Answer
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.
-
[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? Commented Nov 3, 2019 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– XaldewCommented Nov 4, 2019 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émentCommented 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– joborCommented Jun 22, 2022 at 11:20