This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
using '-x -' to read gdb script from stdin
- To: gdb at sourceware dot cygnus dot com
- Subject: using '-x -' to read gdb script from stdin
- From: jtc at redback dot com (J.T. Conklin)
- Date: 02 Dec 1999 00:50:22 -0800
- Reply-To: jtc at redback dot com
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