This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Piping stdin to debug program


On Sat, Mar 1, 2008 at 12:04 PM, Tron Thomas <tron.thomas@verizon.net> wrote:
> Given that someone might want to invoke a program in this manner:
>
>  cat TextFile.txt | Program
>
>  How can someone use GDB to debug Program?

For the simple case of just taking input from a file, how about

(gdb) run <TextFile.txt

?

E.g.

bash$ gdb cat
(gdb) r </etc/passwd
Starting program: /bin/cat </etc/passwd
[...]
root:x:0:0:root:/root:/bin/bash
[...]
Program exited normally.
(gdb)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]