
________________________________ From: Nathan Ridge <zeratul976@hotmail.com> To: Boost Developers Mailing List <boost@lists.boost.org> Sent: Tuesday, January 10, 2012 11:48 PM Subject: Re: [boost] Request for Interest in several Modules
Boost.StackTrace
Collecting stack trace automatically from exception and printing it.
How does this work?
Very simple:
[snip]
In short.
Linux, Solaris, Mac OS X:
- execinfo.h backtrace+backtrace_symbols/dladdr
Windows
- RtlCaptureStackBackTrace
- SymFromAddr (for MSVC)
So where does the symbol information come from?
Under ELF platforms (Linux, Solaris, Mac OS X) it uses linking symbols, they are built in in shared objects and can be added by using -rdynamic flag (which is recommended flag to use in any case) They are usually resolved using dladdr library call. Under Windows/MSVC it uses debug information.
From the debug information compiled into the program?
Using MSVC it does not have to be compiled to the program, it may be external files (PDB files)
If so, what happens if I compile the program without debug info?
You would not get resolved symbol names under Visual Studio
What happens if I use an optimized build?
Optimization does not prevent generation of debug information. For example CMake's flag RelWithDebInfo does this automatically and perfectly for you, of course you can set your own flags in VS projects to make this work. If I remember correctly using /Zi would happily generate debug information (PDB files) for release builds
Thanks, Nate
Best, Artyom