Values of std::vector not showing up in debug window
kfunk at kde.org
Wed Nov 21 16:37:24 GMT 2018
On Wednesday, 7 November 2018 17:09:01 CET zb4ng wrote:
> I am sitting on a small C++ project using the standard library
> "vector"-container and can't see the entries in a "std::vector<long>" in
> the "Variables" window while debugging.
> Even after I had installed the "DEBUG-INFO" packages (see below), they
> were missing.
> I don't know, if I've done sth wrong or if this is a known issue.
> As an alternative, it would be possible to use the "print" command in
> GDB, but it's a little too cumbersome.
> Distro: openSuSE Leap 15.0
> KDE: KDE Frameworks 5.45.0,
> Qt 5.9.4 (built against 5.9.4)
> KDevelop: 5.1.2
> "DEBUG-INFO" packages:
what you will definitely need are the STL GDB pretty printers (a file called
On Ubuntu they are in this package:
# Solution A
You'll also need to load them in KDevelop, for this, edit the gdbinit file
installed by KDevelop (for your probably somewhere in /usr/.../kdevgdb/
printers/gdbinit) and add this between "python & "end":
from libstdcxx.v6.printers import register_libstdcxx_printers
# Solution B
Since some version GDB also supports auto-loading them (this is what happens
here on my Ubuntu system), cf.:
This file here causes gdb to auto-load the pretty printers:
To check whether pretty-printing STL types works at all, probably try to debug
a simple test program creating a std::vector<> and debug it with command-line
GDB and print the vector.
Hope that helps.
> I checked the release notes of later versions, but didn't find sth there
Kevin Funk | kfunk at kde.org | http://kfunk.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: This is a digitally signed message part.
More information about the KDevelop