Last active
January 16, 2016 05:47
-
-
Save kmcallister/7047619 to your computer and use it in GitHub Desktop.
Run a Rust program and print a stack backtrace on failure (old)
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
#!/bin/bash | |
### NOTE ### You probably don't need this anymore! | |
# Just set RUST_BACKTRACE=1 | |
# Usage: rust-backtrace ./my-rust-prog args... | |
exec gdb -batch -n -x /dev/fd/3 --args "$@" 3<<ENDGDB | |
set height 0 | |
set breakpoint pending on | |
break rust_fail | |
commands 1 | |
backtrace | |
quit | |
end | |
run | |
ENDGDB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace
backtrace
withthread apply all backtrace
to get a stack from every thread.