Page 1 of 1

Debugging with stdin

Posted: Tue Jan 06, 2015 7:50 am
by foxmuldr
In CodeLite and GDB, how would I debug a process that expects input from stdin as would typically be re-directed from the command line?

Code: Select all

ls -l > myprog
In my case I've captured the output from "ls -l" to file.txt, and would like to do something like...

Code: Select all

ls -l > file.txt
cat file.txt > myprog
...so the results are reproducible over and over during testing. I can write my own code to read from the file rather than stdin, but if there's a way to read stdin that way I'd prefer it.

Ordinarily it would be:

Code: Select all

gdb myprog
run < file.txt
Thank you in advance.

Best regards,
Rick C. Hodgin

Re: Debugging with stdin

Posted: Wed Jan 07, 2015 8:10 pm
by eranif
You can't do this with codelite

Eran