This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Piping stdin to debug program
- From: "Doug Evans" <dje at google dot com>
- To: "Tron Thomas" <tron dot thomas at verizon dot net>
- Cc: gdb at sourceware dot org
- Date: Sat, 1 Mar 2008 12:14:48 -0800
- Subject: Re: Piping stdin to debug program
- References: <47C9B6D9.8070205@verizon.net>
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)