Qt Creator won't stop at breakpoints



  • Hi,

    I'm debugging a Qt app. The project compiles, builds and runs properly however when I try to debug it I can't get it to stop at breakpoints. I've tried building a test app using the Qt Creator Qt GUI Application template and in this case breakpoints work properly. I've tried cleaning and rebuilding to no avail. I'm using the "Start Debugging" button to start the process.

    I'm working on Mac OS X 10.8.2 and using Qt Creator 2.6.1 with Qt 5.0.

    Any suggestions as to what to look for?

    Cheers,

    Chris


  • Moderators

    Are you building in Debug mode? If you compile in release, debugger has no symbols to catch on runtime.



  • Just to make sure I'm doing the right thing, how do I build in Debug mode?

    What I'm currently doing is:

    Clean All
    Rebuild All

    Then, with the Project set to Debug (the fourth button from the bottom in the lower left corner), I click on the Debug button (the second button from the bottom in the lower left corner).


  • Moderators

    Good steps but in wrong order :)

    Set Project to Debug mode (Projects pane on the left, or fourth icon from the bottom, as you already wrote).

    Clean All.

    Rebuild All / Run Debugger (second icon from the bottom or F5).



  • I also have the same problem. Now I install gdb from macports and (it seems) all works. I cannot say exactly yes, because I not use qt creator too often now. But kind of it works. The two things:

    1. You must sign your new gdb with codesign using self-created code certificate (create it using key chain application)
    2. You must edit /usr/bin/gdb script to make it to call your new gdb instead old one.


  • I tried what suggested by sierdzio above however the program is still not stopping at the breakpoint.

    Any other suggestions?



  • Try my method - replace gdb from XCode to gdb from macports.



  • Two things make me a bit reluctant to try your method:

    1. New Qt Creator projects debug properly, which makes me thing it's something to do with the particular project I'm trying to debug.

    2. Will installing a different gdb affect the working of Xcode?



  • Just a bit more on this problem - I checked the sizes of the two executables and they're identical - shouldn't the debug version be bigger?

    Also, the two paths are:

    /Users/chris/Desktop/pencil2d-code/debug shadow build/release

    /Users/chris/Desktop/pencil2d-code/release shadow build/release

    Does the fact that both paths put the executable in a "release" folder indicate anything?



  • [quote author="cpsmusic" date="1359163689"]Just a bit more on this problem - I checked the sizes of the two executables and they're identical - shouldn't the debug version be bigger?

    Also, the two paths are:

    /Users/chris/Desktop/pencil2d-code/debug shadow build/release

    /Users/chris/Desktop/pencil2d-code/release shadow build/release

    Does the fact that both paths put the executable in a "release" folder indicate anything?[/quote]

    Yes, debugging must me bigger and noticeably bigger. For example write simplest Hello World in usual C and compile it with and without -g flag. If you have the same executable sizes, this means that you have wrong settings. Check qmake flags for debugging target. It must be some like this:
    qmake /Users/eugenk/Projects/QT/qt-creator-2.6.1-src/qtcreator.pro -r -spec macx-g++ CONFIG+=debug CONFIG+=x86_64 CONFIG+=declarative_debug CONFIG+=qml_debug



  • I have same problem, I solved it with the following configuration the .pro

    CONFIG -= app_bundle


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.