2022-03-19 04:34:14 +01:00
|
|
|
#!/usr/bin/env zsh
|
2022-03-19 03:54:51 +01:00
|
|
|
# Get backtrace from gdb
|
|
|
|
|
2022-04-03 05:47:50 +02:00
|
|
|
setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL
|
|
|
|
|
2022-04-03 06:43:18 +02:00
|
|
|
autoload -U die
|
|
|
|
|
|
|
|
[[ ${ARGC} -ne 2 ]] && die 1 "Usage: ${0} <executable> <core dump>"
|
2022-03-19 04:34:14 +01:00
|
|
|
local exe="${1}"
|
|
|
|
local core="${2}"
|
|
|
|
|
|
|
|
gdb "${exe}" \
|
|
|
|
--core "${core}" \
|
|
|
|
--batch \
|
|
|
|
--quiet \
|
|
|
|
-ex "thread apply all bt full" \
|
|
|
|
-ex "quit"
|