Skip to content

Commit 9f3d01b

Browse files
committed
Reword I. Motivation
1. Add a problem description; 2. Add an example (from http://boostorg.github.io/stacktrace/stacktrace/getting_started.html#stacktrace.getting_started.better_asserts); 3. Comment out the old text just in case; 4. Change numbering in Feature-Testing Macro
1 parent b06b47a commit 9f3d01b

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

stacktrace.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,22 @@ <h1>A Proposal to add stack trace library</h1>
3434

3535
<span class='changed-added'>Significant changes to <a href="http://github.com/leha-bot/cpp-stacktrace-proposal">P????R?</a> are marked with blue.</span> <button onclick="show_hide_deleted()">Show/Hide deleted lines from P????R?</button>
3636
<p class='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>&lt;stacktrace&gt;</code> and <code>&lt;frame&gt;</code>), two classes (<code>template &lt;typename Allocator&gt;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>
3950
<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>
4051
<p>A proof of concept implementation available at: <a href="https://github.com/boostorg/stacktrace">https://github.com/boostorg/stacktrace</a>.</p>
52+
-->
4153
<!--
4254
NOTE: saved for example.
4355
<h2>II. Changelog</h2>
@@ -47,6 +59,7 @@ <h2>II. Changelog</h2>
4759
</ul>
4860
4961
-->
62+
<!--
5063
<h2>II. Proposed wording</h2>
5164
<p>X. Stacktrace library <span class="right">[stacktrace]</span></p>
5265
<p>X.1. General <span class="right">[stacktrace.general]</span></p>
@@ -56,7 +69,8 @@ <h2>II. Proposed wording</h2>
5669
<p>X.2.2.1. basic_stacktrace non-member functions <span class="right">[stacktrace.nonmembers]</span></p>
5770
<p>X.2.2.1.1. </p>
5871
<p>X.2.2. Header &lt;stacktrace_fwd&gt; <span class="right">[stacktrace.fwd]</span></p>
59-
<h2>III. Feature-testing macro</h2>
72+
-->
73+
<h2>II. Feature-testing macro</h2>
6074
<p>For the purposes of SG10 we recommend the feature-testing macro name <code>__cpp_lib_stacktrace</code>.</p>
6175

6276
<script type="text/javascript">
@@ -84,3 +98,4 @@ <h2>III. Feature-testing macro</h2>
8498
show_hide_deleted()
8599
</script>
86100
</body></html>
101+

0 commit comments

Comments
 (0)