Skip to content

Commit af42118

Browse files
Update headers to match standard text; fix windows impl; fix abilist
1 parent bd45075 commit af42118

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

libcxx/include/__stacktrace/basic_stacktrace.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class basic_stacktrace : private __stacktrace::_Trace {
117117
// Overview [stacktrace.basic.overview]
118118

119119
using value_type = stacktrace_entry;
120-
using const_reference = value_type const&;
120+
using const_reference = const value_type&;
121121
using reference = value_type&;
122122
using const_iterator = decltype(__entries_.cbegin());
123123
using iterator = const_iterator;
@@ -131,12 +131,14 @@ class basic_stacktrace : private __stacktrace::_Trace {
131131
// Creation and assignment [stacktrace.basic.cons]
132132

133133
_LIBCPP_ALWAYS_INLINE // Omit this function from the trace
134-
static basic_stacktrace current(const allocator_type& __alloc = allocator_type()) noexcept {
134+
static basic_stacktrace
135+
current(const allocator_type& __alloc = allocator_type()) noexcept {
135136
return current(0, __default_max_depth, __alloc);
136137
}
137138

138139
_LIBCPP_ALWAYS_INLINE // Omit this function from the trace
139-
static basic_stacktrace current(size_type __skip, const allocator_type& __alloc = allocator_type()) noexcept {
140+
static basic_stacktrace
141+
current(size_type __skip, const allocator_type& __alloc = allocator_type()) noexcept {
140142
return current(__skip, __default_max_depth, __alloc);
141143
}
142144

@@ -159,22 +161,25 @@ class basic_stacktrace : private __stacktrace::_Trace {
159161
return __ret;
160162
}
161163

164+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace() noexcept(is_nothrow_default_constructible_v<allocator_type>)
165+
: basic_stacktrace(allocator_type()) {}
166+
162167
_LIBCPP_HIDE_FROM_ABI explicit basic_stacktrace(const allocator_type& __alloc)
163168
: _Trace(entry_iters_fn(), entry_append_fn()), __entries_(__alloc) {}
164169

165-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace const& __other, allocator_type const& __alloc)
170+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(const basic_stacktrace& __other) noexcept = default;
171+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace&& __other) noexcept = default;
172+
173+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(const basic_stacktrace& __other, const allocator_type& __alloc)
166174
: _Trace(entry_iters_fn(), entry_append_fn()), __entries_(__other.__entries_, __alloc) {}
167175

168-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace&& __other, allocator_type const& __alloc)
176+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace&& __other, const allocator_type& __alloc)
169177
: _Trace(entry_iters_fn(), entry_append_fn()), __entries_(std::move(__other.__entries_), __alloc) {}
170178

171-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace() noexcept(is_nothrow_default_constructible_v<allocator_type>)
172-
: basic_stacktrace(allocator_type()) {}
173-
174-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace const& __other) noexcept = default;
175-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace(basic_stacktrace&& __other) noexcept = default;
176-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator=(const basic_stacktrace& __other) = default;
177-
_LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator=(basic_stacktrace&& __other) noexcept = default;
179+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator=(const basic_stacktrace& __other) = default;
180+
_LIBCPP_HIDE_FROM_ABI basic_stacktrace& operator=(basic_stacktrace&& __other) noexcept(
181+
allocator_traits<_Allocator>::propagate_on_container_move_assignment::value ||
182+
allocator_traits<_Allocator>::is_always_equal::value) = default;
178183

179184
_LIBCPP_HIDE_FROM_ABI ~basic_stacktrace() = default;
180185

libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.noexceptions.nonew.abilist

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_negative_signEv', 'type': 'FUNC'}
7676
{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_positive_signEv', 'type': 'FUNC'}
7777
{'is_defined': True, 'name': '_ZNKSt3__110moneypunctIwLb1EE16do_thousands_sepEv', 'type': 'FUNC'}
78-
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace10entry_base8write_toERNS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
79-
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace10entry_base9to_stringEv', 'type': 'FUNC'}
80-
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace4base8write_toERNS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
81-
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace4base9to_stringEv', 'type': 'FUNC'}
78+
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace6_Entry8write_toERNS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
79+
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace6_Entry9to_stringEv', 'type': 'FUNC'}
80+
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace6_Trace8write_toERNS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'type': 'FUNC'}
81+
{'is_defined': True, 'name': '_ZNKSt3__112__stacktrace6_Trace9to_stringEv', 'type': 'FUNC'}
8282
{'is_defined': True, 'name': '_ZNKSt3__112bad_weak_ptr4whatEv', 'type': 'FUNC'}
8383
{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE12find_last_ofEPKcmm', 'type': 'FUNC'}
8484
{'is_defined': True, 'name': '_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm', 'type': 'FUNC'}
@@ -598,9 +598,9 @@
598598
{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD1Ev', 'type': 'FUNC'}
599599
{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultD2Ev', 'type': 'FUNC'}
600600
{'is_defined': True, 'name': '_ZNSt3__112__rs_defaultclEv', 'type': 'FUNC'}
601-
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace4base12current_implEmm', 'type': 'FUNC'}
602-
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace6imagesC1Ev', 'type': 'FUNC'}
603-
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace6imagesC2Ev', 'type': 'FUNC'}
601+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace6_Trace15populate_imagesEv', 'type': 'FUNC'}
602+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace7_ImagesC1Ev', 'type': 'FUNC'}
603+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace7_ImagesC2Ev', 'type': 'FUNC'}
604604
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
605605
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
606606
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}

libcxx/src/stacktrace/windows_impl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
# include <psapi.h>
1818
# include <stacktrace>
1919

20+
# if defined(_MSC_VER)
21+
# pragma comment(lib, "dbghelp")
22+
# pragma comment(lib, "psapi")
23+
# endif
24+
2025
_LIBCPP_BEGIN_NAMESPACE_STD
2126
namespace __stacktrace {
2227

@@ -160,7 +165,7 @@ _LIBCPP_EXPORTED_FROM_ABI void _Trace::windows_impl(size_t skip, size_t max_dept
160165
IMAGEHLP_SYMBOL* sym = reinterpret_cast<IMAGEHLP_SYMBOL*>(space);
161166
sym->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
162167
sym->MaxNameLength = _Entry::__max_sym_len;
163-
uintptr_t symdisp{0};
168+
DWORD symdisp{0};
164169
DWORD linedisp{0};
165170
IMAGEHLP_LINE line;
166171
if (SymGetSymFromAddr(proc, entry.__addr_, &symdisp, sym)) {

0 commit comments

Comments
 (0)