dotfiles/.config/zsh/functions/gdb_get_backtrace

18 lines
336 B
Plaintext
Raw Normal View History

#!/usr/bin/env zsh
# Get backtrace from gdb
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>"
local exe="${1}"
local core="${2}"
gdb "${exe}" \
--core "${core}" \
--batch \
--quiet \
-ex "thread apply all bt full" \
-ex "quit"