Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: E-man96 on June 17, 2010, 08:11:54 am

Title: Help with debugger
Post by: E-man96 on June 17, 2010, 08:11:54 am
My program compiles fine, but when I try to run the debugger I get nothing, just a blank console. When I try to move to a next step, the console exits, bypassing all I have coded. It tells me "The program is not being run" but I don't know how to "run" the program.
If your interested in the code it is somewhere here. (I've made it from cpp to txt)
I have Ubuntu linux, codeblocks version 8.02, g++, gdb.

[attachment deleted by admin]
Title: Re: Help with debugger
Post by: MortenMacFly on June 17, 2010, 01:21:27 pm
My program compiles fine, but when I try to run the debugger I get nothing, just a blank console. When I try to move to a next step, the console exits, bypassing all I have coded. It tells me "The program is not being run" but I don't know how to "run" the program.
If your interested in the code it is somewhere here. (I've made it from cpp to txt)
I have Ubuntu linux, codeblocks version 8.02, g++, gdb.
Most likely you forgot to enable producing debugging symbols or you have stripped them. Verify that the compiler options "-g" is on and "-s" (as well as ALL optimisations) is off.
Title: Re: Help with debugger
Post by: E-man96 on June 17, 2010, 10:41:07 pm
Well that's the thing, I have -g checked and nothing else checked (including -s).
Also, it turns out the program can be run from the debug console but it behaves weirdly. Because when I press:

"Debug/continue"
it runs the program but it has no control (ignores breakpoints and goes through everything as if it was being compiled) ,and it gives me in the console in which the program is being run in "warning: GDB: Failed to set controlling terminal: operation not permitted"

"run to crusor"      
the same effect as above

"next line"
It gives me in the debugger log "The program is not being run"

"next instruction"
the same effect as above

"step into"
the same effect as above

"step out"
It doesn't do anything at all.
Title: Re: Help with debugger
Post by: oBFusCATed on June 18, 2010, 12:26:04 am
Have you read this:
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks

especially this:

http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks#Notes_on_Setting_Breakpoints