Reproducing this problem is easy.
- Fire up Qt Creator and create a new Qt4 Console Application project.
- In main() set a breakpoint on the first line of code.
- Hit F5 to debug. The breakpoint is triggered.
- Quit the application, then set a new breakpoint, or remove the existing one and set it again.
- Hit F5 to debug. The breakpoint won't be triggered.
It looks like the second time gdb is started you can only set breakpoints once the application is being debugged. This is all well and good for a GUI app where you may have the opportunity to toggle the breakpoint as your app is running, but for applications such as unit test projects, you don't have time to do this before the application quits!
I find it hard to believe that something so fundamental is broken so if anyone has any hints, I'll be grateful. FWIW I am using the version of gdb that ships with Qt Creator 1.2.92. I have tried pointing this to the 2009.03 version instead, but it makes no difference at all.
Now, what I think is happening is this... when Qt Creator starts a debug session it should apply any breakpoints you've set by registering them with gdb. This explains why, until you debug your app, the breakpoint symbol in your code has a little wait cursor next to it:
When you debug your app the first time this icon changes as Qt Creator successfully applies the breakpoint:
Any new breakpoints you add stay displayed with the wait cursor so it looks like Qt Creator isn't applying them.
I'm also having trouble Qt neglecting all breakpoints when debugging. It used to work, but no longer. I new with Qt and C++, and find this bug/problem/whatever very, very troublesome.
ReplyDeleteWhat version of Creator are you using because this issue was fixed in the current build IIRC.
ReplyDeleteI just downloaded the latest 4.8 Qt Creator on March 15, 2012.
ReplyDeleteSame problem. It worked at first, then it started ignoring all breakpoints. I too get the timer symbol. No idea why.
If i click on projects button in lower left corner, i am definitely running Debug version.
This is really annoying. It's like having the best car on the block, the only problem is the ignition doesn't work.
any help?
kesten
Did you find any solution to that? I am having the same issue...
DeleteI had the same problem; for me, an old gdb version screwed it up. Make sure your gdb is up to date AND THAT QT IS USING THE NEWEST ONE ;-)
ReplyDeleteRegards,