Introduce TinyHttp server
[lcapit-junk-code.git] / getbt
blob7176836e3c69d341596e440dc1baab0c93676de9
1 #!/bin/sh
3 # Print the stack backtrace of a crashed program
5 CORE=$2
6 BINARY=$1
8 usage()
10 echo -e "getbt: Print the stack backtrace of a crashed program"
11 echo -e "Usage: $(basename $0) < program > < core-file >"
14 if [ $# -eq 0 ]; then
15 usage
16 exit 1
19 if [ "$1" = "-h" -o "$1" = "--help" ]; then
20 usage
21 exit 0
24 # print only the trace
25 gdb -nx -silent $BINARY $CORE <<<bt | egrep '^#'