Boost logo

Boost :

Subject: Re: [boost] [stacktrace] Stacktrace library review
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2016-12-15 02:46:57


On 14 Dec 2016 at 22:01, Antony Polukhin wrote:

> 2016-12-14 12:55 GMT+03:00 Vladimir Batov <Vladimir.Batov_at_[hidden]>:
> <...>
> > I have not used the library. However, when it's in Boost I'll make use of it
> > immediately. Can't say much about implementation either. However, the
> > interface and the output seemed straightforward and sensible... Although in
> > my implementation I decided not to report the superfluous
> >
> > 0# boost::stacktrace::detail::backend::backend(void**, unsigned long)
>
> I've tried to do the same thing and failed:
> * BOOST_FORCEINLINE may be ignored by compilers (and even worse -
> produces a warning on some platforms when it is ignored).
> * skipping predefined frames count fail too - depending on the
> compiler/flags/version/platform different inlinement heuristics are
> used and a chance of skipping useful frames appears
>
> I'll try to do some more tweaking with BOOST_FORCEINLINE + warning
> suppression. It may get better, but in some cases will continue to
> output internals in backtraces.

The way I've always done it in my stacktrace implementations is to
force *noinline* the capture function, then ignore the first stack
frame. Unlike force inline, compilers may not ignore force noinline,
so this works and produces the desired result.

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