Skip to content

Commit 8a0bda5

Browse files
committed
Update revision to R1 with new proposed remarks
1 parent 9680ea7 commit 8a0bda5

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

stacktrace.html

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,19 @@
2222
</style>
2323
</head>
2424
<body bgcolor="#ffffff">
25-
<address>Document number: D0881R0</address>
25+
<address>Document number: D0881R1</address>
2626
<address>Project: Programming Language C++</address>
2727
<address>Audience: Library Evolution</address>
2828
<address>&nbsp;</address>
2929
<address>Alexey Gorgurov &lt;<a href="mailto:leha-bot@yandex.ru">leha-bot@yandex.ru</a>&gt;, &lt;<a href="mailto:no-vista@yandex.ru">no-vista@yandex.ru</a>&gt;</address>
3030
<address>Antony Polukhin &lt;<a href="mailto:antoshkka@gmail.com">antoshkka@gmail.com</a>&gt;, &lt;<a href="mailto:antoshkka@yandex-team.ru">antoshkka@yandex-team.ru</a>&gt;</address>
3131
<address>&nbsp;</address>
32-
<address>Date: 2018-01-23</address>
32+
<address>Date: 2018-04-13</address>
3333
<h1>A Proposal to add stack trace library</h1>
3434

35-
<!--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+
<p class='changed-added'>Significant changes to <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0881r0.html">P0881R0</a> are marked with blue.<p>
36+
<p><input type="checkbox" id="show_deletions" onchange="show_hide_deleted()"> Show deleted lines from P0881R0.</p>
37+
3638
<h2>I. Motivation</h2>
3739
<p>In the current working draft [<a href="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.
3840
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>
6567
<h2>III. Design Decisions</h2>
6668
<p>The design is based on the Boost.Stacktrace library, a popular library that does not depend on any non-standard library components.</p>
6769
<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+
<span class="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+
<span class="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+
<p class="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+
<p class="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+
<p class="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 <a href="https://github.com/boostorg/stacktrace/blob/a0f948e9f505cb53baf582fccbcb3024fd255ee1/include/boost/stacktrace/detail/frame_msvc.ipp#L213-L219">retuned into</a> a storage
84+
<a href="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>
7085

7186

7287
<h2>IV. Proposed Interface</h2>
@@ -113,7 +128,7 @@ <h3>Class stack_frame</h3>
113128
// construct/copy/destruct
114129
constexpr stack_frame() noexcept;
115130
constexpr stack_frame(const stack_frame&amp;) noexcept = default;
116-
constexpr stack_frame&amp; operator=(const stack_frame&amp;) = default;
131+
constexpr stack_frame&amp; operator=(const stack_frame&amp;)<span class="changed-added"> noexcept</span> = default;
117132

118133
constexpr explicit stack_frame(native_frame_ptr_t f) noexcept;
119134
template&lt;typename T&gt; explicit stack_frame(T* address) noexcept;
@@ -123,7 +138,7 @@ <h3>Class stack_frame</h3>
123138

124139
constexpr strong_ordering operator &lt;=&gt;(const stack_frame&amp; rhs) = default;
125140

126-
// functions that querying information about stored address
141+
// functions that query<span class="changed-deleted">ing</span> information about stored address
127142
string name() const;
128143
string source_file() const;
129144
size_t source_line() const;
@@ -172,7 +187,8 @@ <h3>Class template &lt;basic_stacktrace&gt;</h3>
172187
using const_reference = const value_type &amp;;
173188
using size_type = <i>implementation-defined</i>;
174189
using const_iterator = <i>implementation-defined</i>;
175-
using allocaotr_type = Allocator;
190+
<span class="changed-added">using allocator_type = Allocator;</span>
191+
<span class="changed-deleted">using allocaotr_type = Allocator;</span>
176192

177193
// functions that capture current call sequence
178194
basic_stacktrace() noexcept;
@@ -183,7 +199,7 @@ <h3>Class template &lt;basic_stacktrace&gt;</h3>
183199
basic_stacktrace(const basic_stacktrace &);
184200
basic_stacktrace(basic_stacktrace &&) noexcept;
185201
basic_stacktrace & operator=(const basic_stacktrace &);
186-
basic_stacktrace & operator=(basic_stacktrace &&);
202+
basic_stacktrace & operator=(basic_stacktrace &&)<span class="changed-added"> noexcept</span>;
187203
~basic_stacktrace();
188204

189205
// public member functions
@@ -195,7 +211,7 @@ <h3>Class template &lt;basic_stacktrace&gt;</h3>
195211
explicit operator bool() const noexcept;
196212

197213
template &lt;typename Allocator2&gt;
198-
strong_ordering operator &lt;=&gt;(const basic_stacktrace&lt; Allocator2 &gt;&amp; rhs) = default;
214+
strong_ordering operator &lt;=&gt;(const basic_stacktrace&lt; Allocator2 &gt;&amp; rhs) <span class="changed-added"> noexcept</span> = default;
199215

200216
private:
201217
vector&lt;value_type&gt; stack_frames; // exposition only
@@ -242,14 +258,11 @@ <h2>V. Feature-testing macro</h2>
242258
colorize_texts(document.getElementsByTagName("pre"));
243259
colorize_texts(document.getElementsByTagName("code"));
244260

245-
var show = false;
246261
function show_hide_deleted() {
247262
var to_change = document.getElementsByClassName('changed-deleted');
248263
for (var i = 0; i < to_change.length; ++i) {
249-
to_change[i].style.display = (show ? 'block' : 'none');
264+
to_change[i].style.display = (document.getElementById("show_deletions").checked ? 'block' : 'none');
250265
}
251-
252-
show = !show;
253266
}
254267
show_hide_deleted()
255268
</script>

0 commit comments

Comments
 (0)