C++ – How to get Qt Creator to work with CDB

cqtqt-creatorqt4windbg

I'm using Qt Creator 2.01 32-bit with Qt 4.7.1 on Windows 7 64-bit. I compiled my Qt library using Microsoft Visual C++ 2010. Now I want to use CDB with Qt Creator (or GDB if that works, or whatever is the best option). What exactly do I need to do to be able to debug with CDB (so I can set break points and see symbols)?

Please don't just point me to http://qt-project.org/doc/qtcreator-2.8/creator-debugger-engines.html because I've been there and I'm still missing something. I have Windows SDK installed with debugger tools (but I think it's the 64-bit version). What I'm looking for is what options I need to set in Qt Creator to get this all setup.

EDIT:
Also I should clarify I think the debugger kind of works because I can hit F5 and my application starts and then I can select "debug->interrupt" and it seems to stop. But in the call stack the function names look mangled and breakpoints set in the editor don't break. If I hit F10, then it steps through the code in what looks like assembly. Maybe it's because I'm building a DLL and I set F5 to run the parent application which in turn loads and calls my DLL.

Best Answer

Since your Qt is compiled with MSVC the best option is indeed CDB (for GDB you would need, for example, a MinGW compiled version).

Debugging should be out of the box. One first point I could think is whether for some reason Qt Creator doesn't see your debugging tools for Windows. Have you made sure that the path (and the version) for it is correctly specified in the CDB options page?

Also, have you considered switching to Qt Creator 2.1 (it has a lot of improvements in the area)? Or even better, a self-compiled version of the 2.2 branch, which includes a total refactoring of the CDB engine.

Related Topic