Boost logo

Boost :

Subject: Re: [boost] [Backtrace] Any interest in portable stack trace?
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-10-21 01:10:09

> My experience is that the stack is difficult to follow in debug builds
> and close to impossible in release builds. Highly optimized code sometimes
> discards the notion of a stack altogether in certain cases.
> I'm curious how you're going to accomplish this feat and make it portable
> If you are successful, this would definitely be a valuable tool to have.

Because I'm not trying to reinvent the wheel:

Linux, Solaris and Mac OS X have functions backtrace and backtrace_symbols
in libc: See:

Windows starting from XP has RtlCaptureBackTrace in kernel32.dll:

So the rest is translate symbols, under Unixes I have dladdr and under Windows

Of course for inlined functions or for functions with omitted frame pointer
not see their frame it the trace, but for rest of it, it should work.



Boost list run by bdawes at, gregod at, cpdaniel at, john at