gdb doesn't accept input on stdin

[prev] [thread] [next] [lurker] [Date index for 2004/09/21]

From: David King
Subject: gdb doesn't accept input on stdin
Date: 20:57 on 21 Sep 2004
When I write a unix program, I go to great pains to make sure that it 
reads and writes data like every other unix program. This is vital. I 
wouldn't use it if I couldn't say

ps axu|grep ^ket.*[A-Za-z]+d\>

to pull all of the daemons running as me. So when I say

(make program && ./program) || echo "info registers"|gdb -c `ls *.core|head -n 1`

I expect it to build the program, if it succeeds, run it. If it fails
at running, launch gdb, pull up the first core file, and tell me about
the registers when the program failed. Which would work great, if gdb
accepted input on stdin. Instead, it tells me:

(gdb) Hangup detected on fd 0; error detected on stdin

What kind of moron decided that this was a good idea? All I want is the 
register contents. I don't want to have to type "info registers" every 
damned time I want a quick dump of them. That's (carry the one...) 15 keys 
for every (possibly single character) change in a source file. I can only 
imagine if I wanted to do something more complicated, like dump the last 
five instructions at the time of core dump.

Stupid stupid stupid...

Generated at 12:01 on 24 Sep 2004 by mariachi 0.52