Search code examples
gccqt-creator

How to make the "Locals and Expressions" debugging window operational with gcc 4.8?


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:

enter image description here

While gcc 4.7 works fine:

enter image description here

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.


Solution

  • 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.