Boost logo

Boost :

Subject: Re: [boost] [Stacktrace] Second review begins today 17th Mar ends 26th Mar
From: Peter Dimov (lists_at_[hidden])
Date: 2017-03-17 16:15:28

> You can find the documentation at
> and the github repo at

A few quick comments.

1. The library should try to not #include <windows.h> unless necessary.
Constructing a stacktrace object and most of its operations besides
operator<< / to_string do not need <windows.h> and it should be possible to
avoid it. The functionality that needs <windows.h> needs to be defined in a
separate header, for example <boost/stacktrace/output.hpp>.

This allows use of the library in header-only mode while still isolating
<windows.h> use into its own source file.

For example, consider throw_with_trace in the documentation; the throw
points, which in a header-only library will be in headers, do not need
<windows.h> and should not drag it in. Only the catch point, which resides
safely in its own source file, does.

Incidentally, safe_dump_win.ipp includes <windows.h>, but does not need to.

2. There should exist a documented way to construct a stacktrace from an
array of void const*. This is currently possible via from_dump, but it's not
guaranteed to work; the format of the dump is technically an implementation
detail of the library and may change.

3. detail::try_demangle is unnecessary, as it does the same thing as
core::demangle. :-)

Apart from that, looks like a substantial improvement. More comments and a
vote possibly coming later.

Boost list run by bdawes at, gregod at, cpdaniel at, john at