Boost logo

Boost :

Subject: Re: [boost] Checking interest in stacktrace library
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2016-06-20 22:26:40


On 19/06/2016 09:18, Klemens Morgenstern wrote:
>>> What functionality would you like to have in it?
>> file & line number ... at least for the top frame and possibly
>> optional. this would require a macro, but might be useful for
>> debugging ...
> With gcc you can find that out with addr2line if you have the address of
> the function and or the source of the call (i.e. address of the statement).
> Not sure if that would need to be in the library then, though I don't
> know the other compilers.

You typically can't assume that you'll be able to get file and line from
an address on a live system.

Most installed software (via "install" on Linux or omitting the pdb file
on Windows) consists of stripped binaries that specifically have the
necessary information to do that omitted. (Since it can be quite large,
and exposes things that proprietary folks prefer not to.)

However it's still useful to be able to log a stack trace consisting
only of addresses (and a build identifier) to a log file, that can then
be reconstructed into line number info (via addr2line and similar tools)
on another machine that has the non-stripped binaries (or PDB files)
from the same build available.

If the line number info is available at the time of the trace then it's
nice to provide it when possible, to skip the extra step -- but this
must be configurable, as often looking these up is much slower than
generating the address-only trace, and some applications/threads won't
want to pay for that.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk