Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: geronet on July 31, 2006, 05:41:14 pm
-
Hello, perhaps it's not a fault of CodeBlocks, but if it try to add a breakpoint while the debugger and the program is running, it doesn't set it.
I'm using C:B nightly build from 29/06, gcc as the compiler and gdb. If i add a breakpoint before the debugger starts or while the program is halted, it works like it should. (build target is debug, and "produce debugging symbols is also set)
The problem is, if i make breakpoints, the program stops there every time, but i need to run it some time and then set a breakpoint.. is this possible?
Thanks, Stefan
-
I've been annoyed by this too but have come up with a few work-arounds that actually have worked out better than planned. (Sorry if this is off topic from the original thread)
1. Conditional breakpoints on hit count.
2. Coding a conditional line of code that a breakpoint can be set at in the block of code you are trying to debug. If you can afford the additional code, this works well as addtional code to enable the breakpoint from other events can be coded. This also seems to avoid side effects from "real" conditional breakpoints such as a change in execution speed.
3. If your project is a GUI, create a "Breakpoint" button. Create a basic event handler on the button click and then put a breakpoint at the button the event handler. When the code is stopped by the manual breakpoint, set your desired breakpoint in the main application. You could hard-code an assembly breakpoint instruction in the button hander as well.
-
Hi!
I miss this feature too :(
A special button like "Break execution" as in Visual C++ would be nice too. Is it possible?
-
Is it possible?
Not as far as I know, not under windows with gdb.
-
Presumably, this works by sending Ctrl-C to gdb.
(Edit: actually it is SIGINT which gdb catches. So it may be possible that it indeed does not work under Windows...)
-
Presumably, this works by sending Ctrl-C to gdb.
Have you tried this under windows? It doesn't work...