Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

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 ;-)

27 May 2009

QtCreator Debug Helper...

QtCreator (1.1 for now) is great tool to work with...

The whole Qt thing is, too.

I'm sharing some experience with the beast.

If you need some relevant debug infos concerning the Qt class guts, you need to instruct gdb on how to print them.

It's done via a 'debugging helper': some dll/plugin loaded by gdb on startup.

On my machine they didnt work without a rebuild after each Qt SDK every integration:

  • go to Tools->Options...->Qt4->Qt Versions,
  • check the active Qt SDK, and its path (QT_PATH).
  • *remove* the whole *QT_PATH/qtc-debugging-helper* directory via explorer
  • back to the Options Pane, select the active SDK, and press *Rebuild*
  • go to Options->Debugger->Debugging Helper, check 'Use debugging helper', uncheck 'Use debugging helper from custom location'
  • next time you debug your qt app, you should get some '43 custom... loaded' from gdb