gdb – Grey Panthers Savannah https://grey-panther.net Just another WordPress site Fri, 30 Oct 2009 15:29:00 +0000 en-US hourly 1 https://wordpress.org/?v=7.0 206299117 How to generate a stackdump with GDB https://grey-panther.net/2009/10/how-to-generate-a-stackdump-with-gdb.html https://grey-panther.net/2009/10/how-to-generate-a-stackdump-with-gdb.html#respond Fri, 30 Oct 2009 15:29:00 +0000 https://grey-panther.net/?p=179 4054760074_609af75332_o I’m not a big GDB guy, but Google always helps:

  • Create a textfile with the following content:
    set height 0
    thread apply all bt
    detach
    quit
  • Run the following command:
    gdb $EXE -pid $PID -command $TEXTFILE > $OUTPUTFILE

    where:

    • $EXE is the path to the executable
    • $PID is the PID it is running under
    • $TEXTFILE is the file where your’ve saved the previous commands
    • $OUTPUTFILE is the file where you would like your stackdump to be saved.

The cool little crawling logo was taken from HiR, head over there for an explanation.

]]>
https://grey-panther.net/2009/10/how-to-generate-a-stackdump-with-gdb.html/feed 0 179