简体   繁体   中英

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...):

在此处输入图片说明

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM