Search code examples
c++debuggingidegdbanjuta

Cannot debug variable value in anjuta IDE using gdb


I'm trying to debug local variables values of a C++ project using Anjuta IDE, but all I'm getting is {...} instead of the actual values. See for example the next picture and what happens with the buf and buf1 variables (with all of them actually...):

enter image description here

I've looked into pretty printers, but that seems to be for more complex objects and structures. My variables are simply std::string and I guess they should be displaying their values without much more trouble.

What am I doing wrong?

Thanks!


Solution

  • Although I've moved from anjuta to Eclipse CDT, I think this had nothing to do with anjuta itself, but with a problem in gdb configuration due to a known bug that prevents pretty printers from working.

    There seems to be a couple of workarounds. The one I've successfully tried is:

    • Create a ~/.gdbinit file to be used when running gdb.
    • Add python sys.path.append("/usr/share/gcc-4.8/python"); to it

    See Ubuntu 14.04, gcc 4.8.4: gdb pretty printing doesn't work because of Python issue for more info.