Dave's Brain

Browse - programming tips - linux stack trace

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

What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, 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.
Advertisements: