Dave's Brain

Browse - 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:

#!/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

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.