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.