[lug] OT: Dumping gdb backtrace data to a file?

Tom Tromey tromey at redhat.com
Thu Oct 24 16:52:04 MDT 2002


>>>>> "Scott" == Scott Herod <herod at dimensional.com> writes:

Scott> A quick gdb question:  Is it possible to dump the results of a gdb
Scott> command to a file?  I'm trying debug a massively multi-threaded
Scott> app. which, not surprisingly, seems to have a problem with
Scott> thread-death.  The results of "thread apply all bt" goes on for
Scott> hundreds of lines. Is there some way to dump all of that to a file so
Scott> I can diff. multiple crashes?

You can run gdb under Emacs or script.  That's the easiest way.

Redirecting gdb's command output occasionally comes up on the gdb
list.  I thought I saw a completed patch for this but then it didn't
go in :-(.  Anyway, I have a patch that works but isn't perfect.  I
could send it to you if you want it.  The UI works like this:

    (gdb) transcript > output-file
    (gdb) ... stuff
    (gdb) transcript      # stop the redirection

Tom



More information about the LUG mailing list