Debugging with stdin
Posted: Tue Jan 06, 2015 7:50 am
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?
In my case I've captured the output from "ls -l" to file.txt, and would like to do something like...
...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:
Thank you in advance.
Best regards,
Rick C. Hodgin
Code: Select all
ls -l > myprog
Code: Select all
ls -l > file.txt
cat file.txt > myprog
Ordinarily it would be:
Code: Select all
gdb myprog
run < file.txt
Best regards,
Rick C. Hodgin