This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Passing piped commands as argument to gdb
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Mahmood N <nt_mahmood at yahoo dot com>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Mon, 22 Dec 2014 15:46:36 +0100
- Subject: Re: Passing piped commands as argument to gdb
- Authentication-results: sourceware.org; auth=none
- References: <20141222135517 dot GA18541 at host2 dot jankratochvil dot net> <993728742 dot 194204 dot 1419259380485 dot JavaMail dot yahoo at jws106122 dot mail dot bf1 dot yahoo dot com>
On Mon, 22 Dec 2014 15:43:00 +0100, Mahmood N wrote:
> What you wrote, and what I tested results in the execution of the program
> under gdb. So it start and run the program. Now, I want to first set
> a breakpoint then run the program under gdb.
OK, sorry.
> $ g++ -g -ggdb -o dir-pred dir-pred.cpp
> $ rm pipe
> $ mknod pipe p
> $ bzcat file.bz2 > pipe &
> [1] 18321
> $ gdb
> GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6)
> (gdb) break dir-pred.cpp:26
> No symbol table is loaded. Use the "file" command.
> Make breakpoint pending on future shared library load? (y or [n])
When running just plain "gdb" you need to do what it says to you, that is:
(gdb) file ./run_prog
(gdb) break dir-pred.cpp:26
- There will be no question due to the "file" command above.
(gdb) run <pipe 6
Regards,
Jan