开发者

How to get Qt Creator to work with CDB?

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 bui开发者_高级运维lding a DLL and I set F5 to run the parent application which in turn loads and calls my DLL.


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.


Install the microsoft SDK for windows 7 (version 7.1 or later) and check the box for debugging tools for windows. Make sure you selected the msvc version of Qt, not mingw. As long as you have the debugging tools for windows installed the next time you go to debug your application it will prompt you to set up symbol server- click yes and then you are all set.


Just in case this helps anyone, I'm using Qt Creator 2.3.1 based on Qt 4.7.4 under Windows Vista.

I've been having awful problems getting it to debug. It wouldn't build into the project's /debug folder, so when I ran Debug (F5) it failed and said no such app or directory. Turns out changing the Build Settings and creating a new debug build but specifying the /release folder (where it was creating my app) works fine.


  1. tools
  2. options...
  3. kits
  4. choose your kit
  5. select debugger

How to get Qt Creator to work with CDB?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜