You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!--p class='notes'>Green lines are notes for the <b>editor</b> or for the <b>SG14</b> that must not be treated as part of the wording.</p-->
35
+
<pclass='changed-added'>Significant changes to <ahref="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0881r0.html">P0881R0</a> are marked with blue.<p>
36
+
<p><inputtype="checkbox" id="show_deletions" onchange="show_hide_deleted()"> Show deleted lines from P0881R0.</p>
37
+
36
38
<h2>I. Motivation</h2>
37
39
<p>In the current working draft [<ahref="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4713.pdf">N4713</a>] there is no way to get,store and decode the current call sequence.
38
40
Such call sequences are useful for debugging and post mortem debugging. They are popular in other programming languages (like Java, C#, Python).</p>
@@ -65,8 +67,21 @@ <h2>II. Impact on the Standard</h2>
65
67
<h2>III. Design Decisions</h2>
66
68
<p>The design is based on the Boost.Stacktrace library, a popular library that does not depend on any non-standard library components.</p>
67
69
<p><b>Note about signal safety:</b> this proposal does not attempt to provide a signal-safe solution for capturing and decoding stacktraces.
68
-
Such functionality currently is not implementable on some of the popular platforms. However, the paper attempts to provide extendable solution, that may be made signal safe some day.</p>
69
-
<p><b>Note on performance:</b> during Boost.Stacktrace development phase many users requested a fast way to store stack trace, without decoding the function names. This functionality is preserved in the paper.</p>
70
+
Such functionality currently is not implementable on some of the popular platforms. However, the paper attempts to provide extensible solution, that may be made signal safe some day
71
+
<spanclass="changed-added">by providing a signal safe allocator and changing the <code>stacktrace</code> implementation details</span>.</p>
72
+
<p><b>Note on performance:</b> during Boost.Stacktrace development phase many users requested a fast way to store stack trace, without decoding the function names. This functionality is preserved in the paper.
73
+
<spanclass="changed-added">All the <code>stack_frame</code> functions and constructors are lazy and won't decode the pointer information if there was no explicit request from class user.</span></p>
74
+
<pclass="changed-added"><b>Note on allocations:</b> initial implementations of Boost.Stacktrace were not using allocator and all the frames were placed inside a fixed size internal storage.
75
+
That was a mistake! Sometimes the most important information is located at the bottom of the stack. For example if you run Boost.Test, then the test name will be located low on the stack.
76
+
With a fixed size storage the bottom of the stack could be lost along with the information.</p>
77
+
<pclass="changed-added">Current design assumes that by default users wish to see the whole stack and OK with dynamic allocations, because do not construct <code>stacktrace</code>
78
+
in performance critical places.
79
+
For those users, who wish to use <code>stacktrace</code> on a hot path or in embedded environments <code>basic_stacktrace</code> allows to provide a custom allocator that allocates
80
+
on the stack or in some other place, where users thinks it is appropriate.</p>
81
+
<pclass="changed-added"><b>Note on returning <code>std::string</code> and not having <code>noexcept</code> on <code>stack_frame::source_line()</code></b>:
82
+
Unfortunately this is a necessarity on some platforms, where getting source line requires allocating or where source
83
+
file name <ahref="https://github.com/boostorg/stacktrace/blob/a0f948e9f505cb53baf582fccbcb3024fd255ee1/include/boost/stacktrace/detail/frame_msvc.ipp#L213-L219">retuned into</a> a storage
84
+
<ahref="http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fb%2Fbt_get_backtrace.html"> provided by user</a>.</p>
0 commit comments