dotfiles/.config/zsh/functions/gdb_get_backtrace

17 lines
298 B
Bash

#!/usr/bin/env zsh
# Get backtrace from gdb
if [[ ${ARGC} -ne 2 ]]; then
print -u 2 "Usage: ${0} <executable> <core dump>"
return 1
fi
local exe="${1}"
local core="${2}"
gdb "${exe}" \
--core "${core}" \
--batch \
--quiet \
-ex "thread apply all bt full" \
-ex "quit"