Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: ahlongxp on October 05, 2006, 10:17:23 am

Title: how to input to a console program in debug mode
Post by: ahlongxp on October 05, 2006, 10:17:23 am
besides that, can we add agruments when excuting program in C::B?
Title: Re: how to input to a console program in debug mode
Post by: killerbot on October 05, 2006, 10:20:51 am
Project menu -> Set Programs' arguments
Title: Re: how to input to a console program in debug mode
Post by: mandrav on October 05, 2006, 05:17:10 pm
What do you mean? If you debug a console program, a console is launched for it. Just switch to that console and type away...
Title: Re: how to input to a console program in debug mode
Post by: sque on October 05, 2006, 05:21:59 pm
I am having same problem, but I thought it was my problem. At linux the debug doesn't pop-up a console window. But the program runs in the background.

(Am I so unlucky that I am always aware of all the bugs? Or the linux version is not paied so much attention? I wish I could help giving patches... :( )
Title: Re: how to input to a console program in debug mode
Post by: mandrav on October 05, 2006, 10:32:50 pm
I am having same problem, but I thought it was my problem. At linux the debug doesn't pop-up a console window.

That's true.

Or the linux version is not paied so much attention? I wish I could help giving patches... :( )

It's not a matter of attention. Just like I can't make gdb stop by using the "Stop" button in windows, I can't make a new console for debugging in linux. Patches are always welcome :).
Title: Re: how to input to a console program in debug mode
Post by: ahlongxp on October 09, 2006, 04:42:35 am
At linux the debug doesn't pop-up a console window. But the program runs in the background.
This is what I mean.
Title: Re: how to input to a console program in debug mode
Post by: elindio on November 13, 2006, 08:19:55 pm
At linux the debug doesn't pop-up a console window. But the program runs in the background.
This is what I mean.

I've just downloaded the Linux version of Code::Blocks for my laptop. It is really useful!
It would be great having the console window when we are in debug mode as in the
Windows version.

When debugging programs with lines asking for an input,  that is a real problem. We
do not have any interaction with the program.

Thanks a lot!

elindio

Title: Re: how to input to a console program in debug mode
Post by: dmoore on November 13, 2006, 10:55:26 pm
As a short term fix, can you just use "Debug -> Send user command to debugger" to send your input? (I'm assuming gdb will just pass this information onto your program if they share the same stdin, but maybe not...)
Title: Re: how to input to a console program in debug mode
Post by: elindio on November 14, 2006, 07:07:47 pm
Actually I can't...

When the program is waiting for the input, the button "Debug->Send user command to debugger" is disabled.

Whenever that button is enabled is to send some command to gdb,... but it does not work for the inputs.

Thanks though.