[ale] OT: Sending Commands to GDB

Michael Potter michael at potter.name
Tue Jan 18 23:47:00 EST 2011


I am going to guess that gdb opens the file with mmap and therefore cannot
read from stdin or the named pipe.

I am basing that guess on my other guess that gdb would want easy access to
randomly access the file it is working on.

For the benefit of others who are reading this post:  <(...) is just bash
syntax for a named pipe.

-- 
Michael Potter


On Tue, Jan 18, 2011 at 10:53 PM, Brian Pitts <brian at polibyte.com> wrote:

> Hi,
>
> I'm trying to non-interactively use gdb, but I can't get it to work.
> Below is an example of what I'm trying and failing to accomplish. I
> expected the first two commands to print the same thing that the third
> command does. Instead, they print nothing. Can anyone explain why and/or
> show me a workaround that doesn't involve a temporary file?
>
> $ echo pwd | gdb -batch -x /dev/stdin /bin/true
>
> $ gdb -batch -x <(/bin/echo pwd) /bin/true
>
> $ echo pwd > gdb_script && gdb -batch -x gdb_script /bin/true
> Working directory /home/brian.
>
> Without batch mode, gdb reports for command #1
>
> /dev/stdin: No such file or directory.
> (gdb) Hangup detected on fd 0
> error detected on stdin
>
> and for command #2
>
> /proc/self/fd/63: No such file or directory.
>
> --
> All the best,
> Brian Pitts
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20110118/d6de9d3f/attachment.html 


More information about the Ale mailing list