This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

using '-x -' to read gdb script from stdin


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]