using '-x -' to read gdb script from stdin
J.T. Conklin
jtc@redback.com
Thu Dec 2 00:50:00 GMT 1999
I updated one of our year old GDB executables a week or so ago, and
was notified that one of the scripts used by SQA failed to work. I
tracked it down to the following bit of code that was ifdef'd out
earlier this year.
>From main.c:
/* NOTE: I am commenting this out, because it is not clear
where this feature is used. It is very old and
undocumented. ezannoni: 1999-05-04 */
#if 0
if (cmdarg[i][0] == '-' && cmdarg[i][1] == '\0')
read_command_file (stdin);
else
#endif
The script invoked gdb like this:
echo list "*$addr" | $gdb -batch -x - $file | head -1
[ I know, I should be using addr2line. But this script was written
before addr2line existed. ]
Since all of our systems support /dev/stdin, I patched up our script
accordingly. But I wonder whether support for - should be reenabled.
Is there any reason why not?
--jtc
--
J.T. Conklin
RedBack Networks
More information about the Gdb
mailing list