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 – wasamasa Feb 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 at 8:52

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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