Created
July 17, 2014 02:21
-
-
Save mpontillo/bd30e0ec345be1122a77 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# modified backtrace function (uses core file) courtesy of: | |
# http://blog.cryptomilk.org/2010/12/23/gdb-backtrace-to-file/ | |
bt() | |
{ | |
echo 0 | \ | |
gdb -batch-silent \ | |
-ex "core-file core" \ | |
-ex "set logging overwrite on" \ | |
-ex "set logging file gdb.bt" \ | |
-ex "set logging on" \ | |
-ex "set pagination off" \ | |
-ex "handle SIG33 pass nostop noprint" \ | |
-ex "echo backtrace:\n" \ | |
-ex "backtrace full" \ | |
-ex "echo \n\nregisters:\n" \ | |
-ex "info registers" \ | |
-ex "echo \n\ncurrent instructions:\n" \ | |
-ex "x/16i \$pc" \ | |
-ex "echo \n\nthreads backtrace:\n" \ | |
-ex "thread apply all backtrace" \ | |
-ex "set logging off" \ | |
-ex "quit" "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment