#!/bin/sh usage() { echo "Usage: stack-trace <pgm> <core>" exit 1 } if [[ $# -ne 2 ]]; then usage fi PGM=$1 CORE=$2 ( echo bt echo quit sleep 10 ) | gdb $PGM $CORE
Programming Tips - I have a core files, now how can I get a stack trace from it?
Date: 2009jan24
OS: Linux
Q. I have a core files, now how can I get a stack trace from it?
A. Save this script as /usr/local/bin/stack-trace and use it: