I am using gcc 4.7 and gcc 4.8 together with QtCreator 2.7.1.
The problem is that when I use gcc 4.8, I am unable to see the values of my variables in the "Locals and Expressions" window in debug mode:
While gcc 4.7 works fine:
I have tried to repair this by playing with the QtCreator options, but to no avail.
I am not sure, if this has actually something to do with the compiler version, but the problem goes away once I rebuild with the older version.
The reason probably is that gcc 4.8 is using by default newer format for storing debugging information (http://gcc.gnu.org/gcc-4.8/changes.html). If you are using gdb version less than 7.5 (see gdb --version
) you need to provide -gdwarf-3
argument for compiling with debug info using gcc 4.8.
The same symptom can result from having a debugger that is too new, instead of too old!
In this case it's not about the GDB version, it's about the version of Python which was embedded into it when it was built. Ubuntu 13.10 ships with a GDB that's built with embedded Python3 instead of Python2. Qt Creator (at the time of this writing) is not compatible with that.
You can check to see if you've got a Python2 GDB by running it from a terminal and typing:
(gdb) python print sys.version
If you get an invalid syntax error, you've probably got Python3. That requires parentheses around what to print, so try:
(gdb) python print(sys.version)
When that comes back with a 3.x.x
answer, Qt Creator's Python debugging scripts won't work (yet). So you'll need to get a GDB with Python2.
Here's my blog entry about it: QtCreator Debugger Not Showing Locals in Ubuntu 13.10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With