$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-06-12 09:22:48
From: <Schalk_Cronje_at_[hidden]>
> > I'd like to have assertions that include a stack traceback. Is it
> > possible to do this portably? Does such a lib already exist?
>
> One has to do a per platform implementation. Linux uses backtrace() and
> backtrace_symbols(). Solaris uses getcontext() and dladdr(). I think for
> Win32 one has to use StackWalk, but since I have never done a Win32
> stacktrace implementation I know no more.
If someone would like to contribute an interface for a backtrace library
with some (obviously platform-specific) implementations, I'm sure it would
see wide use. You can do all kinds of great things with this facility,
including useful memory leak detection.