@@ -32,6 +32,7 @@ _LIBCPP_PUSH_MACROS
3232#include < __type_traits/is_nothrow_constructible.h>
3333#include < __vector/vector.h>
3434#include < cstddef>
35+ #include < iostream>
3536#include < string>
3637#include < utility>
3738
@@ -102,7 +103,12 @@ class basic_stacktrace : private __stacktrace::_Trace {
102103 friend struct __stacktrace ::_Trace;
103104
104105 vector<stacktrace_entry, _Allocator> __entries_;
105- _LIBCPP_HIDE_FROM_ABI _EntryIters entry_iters () { return {__entries_.data (), __entries_.size ()}; }
106+ _LIBCPP_HIDE_FROM_ABI _EntryIters entry_iters () {
107+ auto * __data = __entries_.data ();
108+ auto __size = __entries_.size ();
109+ std::cerr << " @@@ data:" << __data << " size:" << __size << ' \n ' ;
110+ return {__data, __size};
111+ }
106112 _LIBCPP_HIDE_FROM_ABI __stacktrace::_Entry& entry_append () {
107113 return (__stacktrace::_Entry&)__entries_.emplace_back ();
108114 }
@@ -133,14 +139,12 @@ class basic_stacktrace : private __stacktrace::_Trace {
133139 // Creation and assignment [stacktrace.basic.cons]
134140
135141 _LIBCPP_ALWAYS_INLINE // Omit this function from the trace
136- static basic_stacktrace
137- current (const allocator_type& __alloc = allocator_type()) noexcept {
142+ static basic_stacktrace current (const allocator_type& __alloc = allocator_type()) noexcept {
138143 return current (0 , __default_max_depth, __alloc);
139144 }
140145
141146 _LIBCPP_ALWAYS_INLINE // Omit this function from the trace
142- static basic_stacktrace
143- current (size_type __skip, const allocator_type& __alloc = allocator_type()) noexcept {
147+ static basic_stacktrace current (size_type __skip, const allocator_type& __alloc = allocator_type()) noexcept {
144148 return current (__skip, __default_max_depth, __alloc);
145149 }
146150
@@ -169,19 +173,32 @@ class basic_stacktrace : private __stacktrace::_Trace {
169173 _LIBCPP_HIDE_FROM_ABI explicit basic_stacktrace (const allocator_type& __alloc)
170174 : _Trace(entry_iters_fn(), entry_append_fn()), __entries_(__alloc) {}
171175
172- _LIBCPP_HIDE_FROM_ABI basic_stacktrace (const basic_stacktrace& __other) noexcept = default;
173- _LIBCPP_HIDE_FROM_ABI basic_stacktrace (basic_stacktrace&& __other) noexcept = default;
176+ _LIBCPP_HIDE_FROM_ABI basic_stacktrace (const basic_stacktrace& __other) noexcept
177+ : _Trace(entry_iters_fn(), entry_append_fn()) {
178+ __entries_ = __other.__entries_ ;
179+ }
180+
181+ _LIBCPP_HIDE_FROM_ABI basic_stacktrace (basic_stacktrace&& __other) noexcept
182+ : _Trace(entry_iters_fn(), entry_append_fn()) {
183+ __entries_ = std::move (__other.__entries_ );
184+ }
174185
175186 _LIBCPP_HIDE_FROM_ABI basic_stacktrace (const basic_stacktrace& __other, const allocator_type& __alloc)
176187 : _Trace(entry_iters_fn(), entry_append_fn()), __entries_(__other.__entries_, __alloc) {}
177188
178189 _LIBCPP_HIDE_FROM_ABI basic_stacktrace (basic_stacktrace&& __other, const allocator_type& __alloc)
179190 : _Trace(entry_iters_fn(), entry_append_fn()), __entries_(std::move(__other.__entries_), __alloc) {}
180191
181- _LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator =(const basic_stacktrace& __other) = default ;
192+ _LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator =(const basic_stacktrace& __other) {
193+ __entries_ = __other.__entries_ ;
194+ return *this ;
195+ }
182196 _LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator =(basic_stacktrace&& __other) noexcept (
183197 allocator_traits<_Allocator>::propagate_on_container_move_assignment::value ||
184- allocator_traits<_Allocator>::is_always_equal::value) = default ;
198+ allocator_traits<_Allocator>::is_always_equal::value) {
199+ __entries_ = std::move (__other.__entries_ );
200+ return *this ;
201+ }
185202
186203 _LIBCPP_HIDE_FROM_ABI ~basic_stacktrace () = default ;
187204
@@ -336,8 +353,8 @@ _LIBCPP_HIDE_FROM_ABI _LIBCPP_ALWAYS_INLINE inline void _Trace::populate_addrs(s
336353
337354# endif // _WIN32
338355
339- _Trace& _Trace::base (auto & __trace) { return *static_cast <_Trace*>(& __trace); }
340- _Trace const & _Trace::base (auto const & __trace) { return *static_cast <_Trace const *>(& __trace); }
356+ _Trace& _Trace::base (auto & __trace) { return *static_cast <_Trace*>(std::addressof ( __trace) ); }
357+ _Trace const & _Trace::base (auto const & __trace) { return *static_cast <_Trace const *>(std::addressof ( __trace) ); }
341358
342359} // namespace __stacktrace
343360_LIBCPP_END_NAMESPACE_STD
0 commit comments