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
Copy file name to clipboardExpand all lines: stacktrace.html
+41-27Lines changed: 41 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@
33
33
<h1>A Proposal to add stack trace library</h1>
34
34
35
35
<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
-
<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>
36
+
<pclass='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>
37
37
<h2>I. Motivation</h2>
38
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
39
</p>
@@ -44,6 +44,20 @@ <h2>I. Motivation</h2>
44
44
Aborted (core dumped)</code>
45
45
</p>
46
46
<p>This assert can be in any translation unit including the <code>boost/array.hpp</code> header.</p>
47
+
<p>With adding of the proposed classes you may see the following message:
48
+
<pre>
49
+
Expression 'i <N' is false in function 'T& boost::array<T,N>::operator[](boost::array<T,N>::size_type) [with T = int; long unsigned int N = 5ul; boost::array<T,N>::reference = int&; boost::array<T,N>::size_type = long unsigned int]': out of range.
1# boost::array<int,5ul>::operator[](unsigned long) at ../../../boost/array.hpp:124
53
+
2# bar(int) at ../example/assert_handler.cpp:17
54
+
3# foo(int) at ../example/assert_handler.cpp:25
55
+
4# bar(int) at ../example/assert_handler.cpp:17
56
+
5# foo(int) at ../example/assert_handler.cpp:25
57
+
6# main at ../example/assert_handler.cpp:54
58
+
7# 0x00007F991FD69F45 in /lib/x86_64-linux-gnu/libc.so.6
59
+
8# 0x0000000000401139
60
+
</pre>
47
61
<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
62
49
63
<!--<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>
template<typename Allocator> class basic_stacktrace;
84
98
85
-
typedef basic_stacktrace stacktrace; // This is the typedef to use unless you'd like to provide a specific allocator to boost::stacktrace::basic_stacktrace.
typedef basic_stacktrace stacktrace; // This is the typedef to use unless you'd like to provide a specific allocator to boost::stacktrace::basic_stacktrace.
// Comparison operators that provide platform dependant ordering and have amortized O(1) complexity; O(size()) worst case complexity; are Async-Handler-Safe.
// Comparison operators that provide platform dependant ordering and have amortized O(1) complexity; O(size()) worst case complexity; are Async-Handler-Safe.
0 commit comments