How to get Qt Creator to work with CDB?
Asked Answered
R

4

10

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.

Reborn answered 15/3, 2011 at 22:7 Comment(0)
M
5

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.

Moriahmoriarty answered 15/3, 2011 at 22:34 Comment(3)
Didn't realize they had 2.1. I just downloaded the SDK package (only a few weeks ago) and it was 2.0.1. I'll get the new version.Reborn
After installing 2.1, when I went to setup CDB, the path was already filled out for the Debugger Tools For Windows redist directory. Inside there I found the 32-bit version of windows debugger so I installed it and then set the path to that install directory. So I think it's working, I think the problem is that I'm debugging a dll.Reborn
The 2.2 branch is currently not buildable from source-- someone checked in something that's causing it to break. That frustrates me.Presentationism
G
3

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.

Goraud answered 14/6, 2011 at 2:1 Comment(0)
E
0

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.

Epp answered 5/12, 2011 at 19:49 Comment(0)
J
0
  1. tools
  2. options...
  3. kits
  4. choose your kit
  5. select debugger

enter image description here

Jeana answered 3/8, 2020 at 9:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.