31 July 2009

Obese debug information (sqlite and qtcreator)

SQLite.c is the 'amalgemon' version of the Database: a huge .c file containing all the dependencies to compile SQLite into our projects.

Using GCC, and standard mingw compilation option, we probably all notice the ton of compilation warning telling us that debug infos are too huge to be handled correctly (if you tried that, it's impossible to trace sqlite sources with gdb).
The problem is concerning the embedded debugging information in STABS format: GCC is handling more modern types of debugging info. We just have to tell it to use them (http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html)


in your .pro file (assuming you're using QtCreator), force these flags to be used:

#remove standard debug generation for c files
QMAKE_CFLAGS_DEBUG -= -g
#(*= 'if not present'), force uber debug infos, perfect for gdb
QMAKE_CFLAGS_DEBUG *= -ggdb


No more compilation warning=quickest compilation, and we're now able to trace sqlite.c in gdb... Another win ;-)

No comments: