Boost logo

Boost :

Subject: Re: [boost] Stacktrace library starts review today 14th Dec
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-12-17 13:17:02


On 17 Dec 2016 at 20:05, Antony Polukhin wrote:

> Most of the compilers use DWARF debugging because all the tools
> (debuggers,addr2line) understand it.
> The problem is that addr2line may not be installed. I'll clarify
> addr2line requirement in the docs and will try to find another way of
> getting debug info from address.

addr2line is also borked on some distros. I've found llvm-symbolizer
to be much more reliable.

> > Also, I get why there's the stack-trace function at the top of the
> > stacktrace, and it would be the wrong approach to remove it manually. I
> > would however like a workaround, so that the stacktrace doesn't include
> > those calls.
>
> That top level frame may dissappear/reapper depending on the compiler
> version and even compiler flags. I was experimenting with skipping the
> first frame or forcing inlinement. I've found no good way to resolve
> that issue.

As I mentioned in a previous post, you want to use noinline to force
a guaranteed first entry to strip. As it's a header only library,
you'll get this perversity:

__declspec(noinline) inline void make_backtrace(...)

... which is completely legal because you want inline linkage
semantics, but to never inline the function.

Niall

-- 
ned Productions Limited Consulting
http://www.nedproductions.biz/ 
http://ie.linkedin.com/in/nialldouglas/

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