Boost logo

Boost :

Subject: Re: [boost] Stacktrace library starts review today 14th Dec
From: Antony Polukhin (antoshkka_at_[hidden])
Date: 2016-12-17 13:43:31


2016-12-17 21:17 GMT+03:00 Niall Douglas <s_sourceforge_at_[hidden]>:
> 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.

I'll take a look at it. Thanks!

>> > 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.

Oh, now I've got that. I've been confused by the `__declspec(noinline)
inline`. Thanks again!
Does the `BOOST_NOINLINE inline` solution work well on GCC, CLANG and
other compilers?

-- 
Best regards,
Antony Polukhin

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