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
<spanclass='changed-added'>Significant changes to <ahref="http://github.com/leha-bot/cpp-stacktrace-proposal">P????R?</a> are marked with blue.</span><buttononclick="show_hide_deleted()">Show/Hide deleted lines from P????R?</button>
36
36
<pclass='notes'>Green lines are notes for the <b>editor</b> or for the <b>SG6</b> that must not be treated as part of the wording.</p>
37
-
<h2>I. Introduction and Motivation</h2>
38
-
<p>Current compilers can print a stack trace while debugging or crash dump for debugging purposes. The compiler's users also can get a stack trace via implementation-defined API. But there is no cross-platform solution (except Boost.Stacktrace on which this Proposal is based of).</p>
37
+
<h2>I. Motivation</h2>
38
+
<p>At this time there is no standard solution to get the calls sequence that results in unhandled exception, std::terminate or assertion failure. That sequence is widely used in another programming languages (like Java, C#, Python) for debugging and post mortem debugging.
39
+
</p>
40
+
<p>Pretty often assertions can't describe the whole picture of bug and does not provide enough information to locate the problem. For example, you can see the following message on out-of-range access:
41
+
</p>
42
+
<p><code>
43
+
../../../boost/array.hpp:123: T& boost::array<T,N>::operator[](boost::array<T,N>::size_type) [with T = int; long unsigned int N = 5ul]: Assertion '(i <N)&&("out of range")' failed.
44
+
Aborted (core dumped)</code>
45
+
</p>
46
+
<p>This assert can be in any translation unit including the <code>boost/array.hpp</code> header.</p>
47
+
<p>We propose two headers (<code><stacktrace></code> and <code><frame></code>), two classes (<code>template <typename Allocator>class basic_stacktrace</code> and <code>class frame</code>) and several functions for safe stack frames dump.</p>
48
+
49
+
<!--<p>Current compilers can print a stack trace while debugging or crash dump for debugging purposes. The compiler's users also can get a stack trace via implementation-defined API. But there is no cross-platform solution (except Boost.Stacktrace on which this Proposal is based of).</p>
39
50
<p>This is an attempt to solve the problem in a generic way on a library level and provide wording for thing being a standard de-facto on all compilers.</p>
40
51
<p>A proof of concept implementation available at: <a href="https://github.com/boostorg/stacktrace">https://github.com/boostorg/stacktrace</a>.</p>
0 commit comments