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