I've got the same problem under Ubuntu and found a solution for console programs.
(I didnt yet have to debug a GUI program, so i do not know if the the same debug error happens there.)
My workaround solution:
1. start a terminal like "xterm", "gterm", "konsole"
2. start codeblocks and do all you need to make a compilable console program (like "hello world")
3. be sure to have all these settings in your project:
http://forums.codeblocks.org/index.php?topic=4296.04. Build and run the program (F9)
5. use the terminal and type: ps -a
this will show running processes, for example:
PID TTY TIME CMD
5586 pts/2 00:00:00 my-running-codeblocks-program
5587 pts/1 00:00:00 ps
the number under "PID" in the line of my-running-codeblocks-program is the one we want.
(It is the Process ID and will each time be another one you start your program)
Remember it and finally under
6. Codeblocks menu "Debug" choose "Attach to process..." and enter the PID of my-running-codeblocks-program
Now debug like you want to
Now, hello world and such short programs will be terminated already by the time you got to enter "ps -a", but if you have at least one thing to type into your program (or it sleeps for a long time) it will be possible to attach the debugger at this point (first attach, then type in
).
It does not affect the program flow whether or not you have set a breakpoint BEFORE attaching the debugger because it's not attached :shock: