Skip to content

Commit dcfd22d

Browse files
Test for 'noexcept' (and related fixes)
1 parent bac38c3 commit dcfd22d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+681
-459
lines changed

libcxx/include/__stacktrace/base.h

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,9 @@ class _LIBCPP_EXPORTED_FROM_ABI stacktrace_entry;
4242

4343
namespace __stacktrace {
4444

45-
struct _LIBCPP_HIDE_FROM_ABI alloc final {
46-
function<byte*(size_t)> __alloc_bytes_;
47-
function<void(byte*, size_t)> __dealloc_bytes_;
48-
49-
template <class _Allocator>
50-
_LIBCPP_HIDE_FROM_ABI alloc(_Allocator __alloc) {
51-
using _AT = allocator_traits<_Allocator>;
52-
using _BA = typename _AT::template rebind_alloc<byte>;
53-
auto __ba = _BA(__alloc);
54-
__alloc_bytes_ = [__ba](size_t __sz) mutable { return __ba.allocate(__sz); };
55-
__dealloc_bytes_ = [__ba](void* __ptr, size_t __sz) mutable { __ba.deallocate((byte*)__ptr, __sz); };
56-
}
45+
struct _LIBCPP_HIDE_FROM_ABI entry_base;
5746

47+
struct _LIBCPP_EXPORTED_FROM_ABI base {
5848
template <typename _Tp>
5949
struct _LIBCPP_HIDE_FROM_ABI Alloc {
6050
function<byte*(size_t)> __alloc_bytes_;
@@ -66,6 +56,7 @@ struct _LIBCPP_HIDE_FROM_ABI alloc final {
6656
template <typename _T2 = _Tp>
6757
Alloc(Alloc<_T2> const& __rhs) : Alloc(__rhs.__alloc_bytes_, __rhs.__dealloc_bytes_) {}
6858

59+
// XXX Alignment?
6960
using value_type = _Tp;
7061
[[nodiscard]] _Tp* allocate(size_t __sz) { return (_Tp*)__alloc_bytes_(__sz * sizeof(_Tp)); }
7162
void deallocate(_Tp* __ptr, size_t __sz) { __dealloc_bytes_((byte*)__ptr, __sz * sizeof(_Tp)); }
@@ -103,30 +94,53 @@ struct _LIBCPP_HIDE_FROM_ABI alloc final {
10394
_LIBCPP_HIDE_FROM_ABI list<_Tp> make_list(_Args... __args) {
10495
return list(std::forward<_Args>(__args)..., make_alloc<_Tp>());
10596
}
97+
98+
template <class _Allocator>
99+
auto _LIBCPP_HIDE_FROM_ABI __alloc_wrap(_Allocator const& __alloc) {
100+
using _AT = allocator_traits<_Allocator>;
101+
using _BA = typename _AT::template rebind_alloc<byte>;
102+
auto __ba = _BA(__alloc);
103+
return [__ba = std::move(__ba)](size_t __sz) mutable { return __ba.allocate(__sz); };
104+
}
105+
106+
template <class _Allocator>
107+
auto _LIBCPP_HIDE_FROM_ABI __dealloc_wrap(_Allocator const& __alloc) {
108+
using _AT = allocator_traits<_Allocator>;
109+
using _BA = typename _AT::template rebind_alloc<byte>;
110+
auto __ba = _BA(__alloc);
111+
return [__ba = std::move(__ba)](void* __ptr, size_t __sz) mutable { __ba.deallocate((byte*)__ptr, __sz); };
112+
}
113+
114+
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_EXPORTED_FROM_ABI void
115+
build_stacktrace(size_t __skip, size_t __max_depth);
116+
117+
base();
118+
119+
template <class _Allocator>
120+
explicit _LIBCPP_EXPORTED_FROM_ABI base(_Allocator __alloc);
121+
122+
function<byte*(size_t)> __alloc_bytes_;
123+
function<void(byte*, size_t)> __dealloc_bytes_;
124+
vec<entry_base> __entries_;
125+
str __main_prog_path_;
106126
};
107127

108128
struct _LIBCPP_HIDE_FROM_ABI entry_base {
109-
uintptr_t __addr_actual_{}; // this address, as observed in this current process
110-
uintptr_t __addr_unslid_{}; // address adjusted for ASLR
111-
optional<__stacktrace::alloc::str> __desc_{}; // uses wrapped _Allocator from caller
112-
optional<__stacktrace::alloc::str> __file_{}; // uses wrapped _Allocator from caller
129+
uintptr_t __addr_actual_{}; // this address, as observed in this current process
130+
uintptr_t __addr_unslid_{}; // address adjusted for ASLR
131+
optional<__stacktrace::base::str> __desc_{}; // uses wrapped _Allocator from caller
132+
optional<__stacktrace::base::str> __file_{}; // uses wrapped _Allocator from caller
113133
uint_least32_t __line_{};
114134

115135
_LIBCPP_HIDE_FROM_ABI stacktrace_entry to_stacktrace_entry() const;
116136
};
117137

118-
struct _LIBCPP_EXPORTED_FROM_ABI builder final {
119-
alloc __alloc_; // wraps the caller-provided allocator
120-
alloc::vec<entry_base> __entries_;
121-
alloc::str __main_prog_path_;
122-
123-
template <class _Allocator>
124-
explicit _LIBCPP_EXPORTED_FROM_ABI builder(_Allocator __alloc)
125-
: __alloc_(__alloc), __entries_(__alloc_.make_vec<entry_base>()), __main_prog_path_(__alloc_.make_str()) {}
126-
127-
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_EXPORTED_FROM_ABI void
128-
build_stacktrace(size_t __skip, size_t __max_depth);
129-
};
138+
template <class _Allocator>
139+
_LIBCPP_EXPORTED_FROM_ABI base::base(_Allocator __alloc)
140+
: __alloc_bytes_(__alloc_wrap(__alloc)),
141+
__dealloc_bytes_(__dealloc_wrap(__alloc)),
142+
__entries_(make_vec<entry_base>()),
143+
__main_prog_path_(make_str()) {}
130144

131145
} // namespace __stacktrace
132146

libcxx/include/__stacktrace/basic.h

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4343
class stacktrace_entry;
4444

4545
template <class _Allocator>
46-
class _LIBCPP_EXPORTED_FROM_ABI basic_stacktrace {
46+
class _LIBCPP_EXPORTED_FROM_ABI basic_stacktrace : private __stacktrace::base {
4747
friend struct hash<basic_stacktrace<_Allocator>>;
4848
friend struct __stacktrace::__to_string;
4949

5050
using _ATraits _LIBCPP_NODEBUG = allocator_traits<_Allocator>;
51-
constexpr static bool __kPropOnCopy = _ATraits::propagate_on_container_copy_assignment::value;
52-
constexpr static bool __kPropOnMove = _ATraits::propagate_on_container_move_assignment::value;
51+
constexpr static bool __kPropOnCopyAssign = _ATraits::propagate_on_container_copy_assignment::value;
52+
constexpr static bool __kPropOnMoveAssign = _ATraits::propagate_on_container_move_assignment::value;
5353
constexpr static bool __kPropOnSwap = _ATraits::propagate_on_container_swap::value;
5454
constexpr static bool __kAlwaysEqual = _ATraits::is_always_equal::value;
5555
constexpr static bool __kNoThrowDflConstruct = is_nothrow_default_constructible_v<_Allocator>;
5656
constexpr static bool __kNoThrowAlloc =
5757
noexcept(noexcept(_Allocator().allocate(1)) && noexcept(_Allocator().allocate_at_least(1)));
5858

59-
[[no_unique_address]] _Allocator __alloc_;
59+
[[no_unique_address]]
60+
_Allocator __alloc_;
6061

6162
using __entry_vec _LIBCPP_NODEBUG = vector<stacktrace_entry, _Allocator>;
6263
__entry_vec __entries_;
@@ -94,7 +95,7 @@ class _LIBCPP_EXPORTED_FROM_ABI basic_stacktrace {
9495
current(size_type __skip,
9596
size_type __max_depth,
9697
const allocator_type& __caller_alloc = allocator_type()) noexcept(__kNoThrowAlloc) {
97-
__stacktrace::builder __builder(__caller_alloc);
98+
__stacktrace::base __builder(__caller_alloc);
9899
__builder.build_stacktrace(__skip + 1, __max_depth);
99100
basic_stacktrace<_Allocator> __ret{__caller_alloc};
100101
__ret.__entries_.reserve(__builder.__entries_.size());
@@ -109,57 +110,39 @@ class _LIBCPP_EXPORTED_FROM_ABI basic_stacktrace {
109110
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace() noexcept(__kNoThrowDflConstruct) : basic_stacktrace(allocator_type()) {}
110111

111112
_LIBCPP_EXPORTED_FROM_ABI explicit basic_stacktrace(const allocator_type& __alloc) noexcept
112-
: __alloc_(__alloc), __entries_(__alloc_) {}
113+
: base(__alloc), __entries_(__alloc_) {}
113114

114-
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace const& __other) = default;
115+
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace const& __other)
116+
: basic_stacktrace(__other, _ATraits::select_on_container_copy_construction(__other.__alloc_)) {}
115117

116-
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace&& __other) noexcept = default;
118+
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace&& __other) noexcept
119+
: __alloc_(std::move(__other.__alloc_)), __entries_(std::move(__other.__entries_)) {}
117120

118121
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace const& __other, allocator_type const& __alloc)
119-
: __alloc_(__alloc), __entries_(__other.__entries_, __alloc) {}
122+
: base(__alloc), __alloc_(__alloc), __entries_(__other.__entries_, __alloc) {}
120123

121124
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace(basic_stacktrace&& __other, allocator_type const& __alloc)
122-
: __alloc_(__alloc) {
123-
if (__kAlwaysEqual || __alloc_ == __other.__alloc_) {
124-
__entries_ = std::move(__other.__entries_);
125-
} else {
126-
// "moving" from a container with a different allocator; we're forced to copy items instead
127-
for (auto const& __entry : __other.__entries_) {
128-
__entries_.push_back(__entry);
129-
}
130-
}
125+
: base(__alloc) {
126+
__entries_ = {std::move(__other.__entries_), __alloc_};
131127
}
132128

133129
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace& operator=(const basic_stacktrace& __other) {
134-
if (this == std::addressof(__other)) {
135-
return *this;
136-
}
137-
if (__kPropOnCopy) {
138-
__alloc_ = __other.__alloc_;
130+
if (this != std::addressof(__other)) {
131+
if (__kPropOnCopyAssign) {
132+
__alloc_ = __other.__alloc_;
133+
}
134+
__entries_ = {__other.__entries_, __alloc_};
139135
}
140-
__entries_ = {__other.__entries_, __alloc_};
141136
return *this;
142137
}
143138

144139
_LIBCPP_EXPORTED_FROM_ABI basic_stacktrace&
145-
operator=(basic_stacktrace&& __other) noexcept(__kPropOnMove || __kAlwaysEqual) {
146-
if (this == std::addressof(__other)) {
147-
return *this;
148-
}
149-
if (__kPropOnMove) {
150-
__alloc_ = __other.__alloc_;
151-
__entries_ = std::move(__other.__entries_);
152-
} else {
153-
auto __allocs_eq = __kAlwaysEqual || __alloc_ == __other.__alloc_;
154-
if (__allocs_eq) {
155-
__entries_ = std::move(__other.__entries_);
156-
} else {
157-
// "moving" from a container with a different allocator;
158-
// we're forced to copy items instead
159-
for (auto const& __entry : __other.__entries_) {
160-
__entries_.push_back(__entry);
161-
}
140+
operator=(basic_stacktrace&& __other) noexcept(__kPropOnMoveAssign || __kAlwaysEqual) {
141+
if (this != std::addressof(__other)) {
142+
if (__kPropOnMoveAssign) {
143+
__alloc_ = std::move(__other.__alloc_);
162144
}
145+
__entries_ = {std::move(__other.__entries_), __alloc_};
163146
}
164147
return *this;
165148
}
@@ -229,7 +212,9 @@ class _LIBCPP_EXPORTED_FROM_ABI basic_stacktrace {
229212
// (19.6.4.5)
230213
// [stacktrace.basic.mod], modifiers
231214

232-
_LIBCPP_EXPORTED_FROM_ABI void swap(basic_stacktrace<_Allocator>& __other) noexcept {
215+
_LIBCPP_EXPORTED_FROM_ABI void swap(basic_stacktrace& __other) noexcept(
216+
allocator_traits<_Allocator>::propagate_on_container_swap::value ||
217+
allocator_traits<_Allocator>::is_always_equal::value) {
233218
std::swap(__entries_, __other.__entries_);
234219
if (__kPropOnSwap) {
235220
std::swap(__alloc_, __other.__alloc_);

libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,9 @@
983983
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace11__to_stringclERKNS_16stacktrace_entryE', 'type': 'FUNC'}
984984
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace11__to_stringclERNS_13basic_ostreamIcNS_11char_traitsIcEEEEPKNS_16stacktrace_entryEm', 'type': 'FUNC'}
985985
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace11__to_stringclERNS_13basic_ostreamIcNS_11char_traitsIcEEEERKNS_16stacktrace_entryE', 'type': 'FUNC'}
986-
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace7builder16build_stacktraceEmm', 'type': 'FUNC'}
986+
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace4base16build_stacktraceEmm', 'type': 'FUNC'}
987+
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace4baseC1Ev', 'type': 'FUNC'}
988+
{'is_defined': True, 'name': '__ZNSt3__112__stacktrace4baseC2Ev', 'type': 'FUNC'}
987989
{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
988990
{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
989991
{'is_defined': True, 'name': '__ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@
627627
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace11__to_stringclERKNS_16stacktrace_entryE', 'type': 'FUNC'}
628628
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace11__to_stringclERNS_13basic_ostreamIcNS_11char_traitsIcEEEEPKNS_16stacktrace_entryEm', 'type': 'FUNC'}
629629
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace11__to_stringclERNS_13basic_ostreamIcNS_11char_traitsIcEEEERKNS_16stacktrace_entryE', 'type': 'FUNC'}
630-
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace7builder16build_stacktraceEmm', 'type': 'FUNC'}
630+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace4base16build_stacktraceEmm', 'type': 'FUNC'}
631+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace4baseC1Ev', 'type': 'FUNC'}
632+
{'is_defined': True, 'name': '_ZNSt3__112__stacktrace4baseC2Ev', 'type': 'FUNC'}
631633
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD0Ev', 'type': 'FUNC'}
632634
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD1Ev', 'type': 'FUNC'}
633635
{'is_defined': True, 'name': '_ZNSt3__112bad_weak_ptrD2Ev', 'type': 'FUNC'}
@@ -1624,9 +1626,11 @@
16241626
{'is_defined': True, 'name': '_ZTCNSt3__19strstreamE16_NS_13basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 80, 'type': 'OBJECT'}
16251627
{'is_defined': True, 'name': '_ZTINSt12experimental15fundamentals_v112bad_any_castE', 'size': 24, 'type': 'OBJECT'}
16261628
{'is_defined': True, 'name': '_ZTINSt12experimental19bad_optional_accessE', 'size': 24, 'type': 'OBJECT'}
1629+
{'is_defined': True, 'name': '_ZTINSt3__110__function6__baseIFPSt4bytemEEE', 'size': 16, 'type': 'OBJECT'}
16271630
{'is_defined': True, 'name': '_ZTINSt3__110__function6__baseIFbRKNS_12__stacktrace3elf6SymbolEEEE', 'size': 16, 'type': 'OBJECT'}
16281631
{'is_defined': True, 'name': '_ZTINSt3__110__function6__baseIFbRKNS_12__stacktrace3elf7SectionEEEE', 'size': 16, 'type': 'OBJECT'}
16291632
{'is_defined': True, 'name': '_ZTINSt3__110__function6__baseIFbRKNS_12__stacktrace4toolEEEE', 'size': 16, 'type': 'OBJECT'}
1633+
{'is_defined': True, 'name': '_ZTINSt3__110__function6__baseIFvPSt4bytemEEE', 'size': 16, 'type': 'OBJECT'}
16301634
{'is_defined': True, 'name': '_ZTINSt3__110__time_getE', 'size': 16, 'type': 'OBJECT'}
16311635
{'is_defined': True, 'name': '_ZTINSt3__110__time_putE', 'size': 16, 'type': 'OBJECT'}
16321636
{'is_defined': True, 'name': '_ZTINSt3__110ctype_baseE', 'size': 16, 'type': 'OBJECT'}
@@ -1766,9 +1770,11 @@
17661770
{'is_defined': True, 'name': '_ZTISt19bad_optional_access', 'size': 24, 'type': 'OBJECT'}
17671771
{'is_defined': True, 'name': '_ZTSNSt12experimental15fundamentals_v112bad_any_castE', 'size': 50, 'type': 'OBJECT'}
17681772
{'is_defined': True, 'name': '_ZTSNSt12experimental19bad_optional_accessE', 'size': 40, 'type': 'OBJECT'}
1773+
{'is_defined': True, 'name': '_ZTSNSt3__110__function6__baseIFPSt4bytemEEE', 'size': 41, 'type': 'OBJECT'}
17691774
{'is_defined': True, 'name': '_ZTSNSt3__110__function6__baseIFbRKNS_12__stacktrace3elf6SymbolEEEE', 'size': 64, 'type': 'OBJECT'}
17701775
{'is_defined': True, 'name': '_ZTSNSt3__110__function6__baseIFbRKNS_12__stacktrace3elf7SectionEEEE', 'size': 65, 'type': 'OBJECT'}
17711776
{'is_defined': True, 'name': '_ZTSNSt3__110__function6__baseIFbRKNS_12__stacktrace4toolEEEE', 'size': 58, 'type': 'OBJECT'}
1777+
{'is_defined': True, 'name': '_ZTSNSt3__110__function6__baseIFvPSt4bytemEEE', 'size': 42, 'type': 'OBJECT'}
17721778
{'is_defined': True, 'name': '_ZTSNSt3__110__time_getE', 'size': 21, 'type': 'OBJECT'}
17731779
{'is_defined': True, 'name': '_ZTSNSt3__110__time_putE', 'size': 21, 'type': 'OBJECT'}
17741780
{'is_defined': True, 'name': '_ZTSNSt3__110ctype_baseE', 'size': 21, 'type': 'OBJECT'}

libcxx/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ set(LIBCXX_SOURCES
4040
ryu/d2fixed.cpp
4141
ryu/d2s.cpp
4242
ryu/f2s.cpp
43-
stacktrace/builder.cpp
43+
stacktrace/base.cpp
4444
stacktrace/linux/elf.cpp
4545
stacktrace/linux/images.cpp
4646
stacktrace/linux/impl.cpp

libcxx/src/stacktrace/builder.cpp renamed to libcxx/src/stacktrace/base.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
namespace __stacktrace {
2323

24+
base::base() : base(std::allocator<std::stacktrace_entry>()) {}
25+
2426
_LIBCPP_NO_TAIL_CALLS _LIBCPP_NOINLINE _LIBCPP_EXPORTED_FROM_ABI void
25-
builder::build_stacktrace(size_t skip, size_t max_depth) {
27+
base::build_stacktrace(size_t skip, size_t max_depth) {
2628
#if defined(_LIBCPP_WIN32API)
2729
// Windows implementation
2830
win_impl dbghelp{*this};

libcxx/src/stacktrace/linux/impl.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ void linux::ident_modules() {
3535

3636
auto mainProg = images.mainProg();
3737
if (mainProg) {
38-
builder_.__main_prog_path_ = mainProg->name_;
38+
base_.__main_prog_path_ = mainProg->name_;
3939
}
4040

4141
unsigned index = 1; // Starts at one, and is moved around in this loop
42-
for (auto& entry : builder_.__entries_) {
42+
for (auto& entry : base_.__entries_) {
4343
while (images[index].loaded_at_ > entry.__addr_actual_) {
4444
--index;
4545
}
4646
while (images[index + 1].loaded_at_ <= entry.__addr_actual_) {
4747
++index;
4848
}
4949
entry.__addr_unslid_ = entry.__addr_actual_ - images[index].slide_;
50-
entry.__file_ = builder_.__alloc_.make_str(images[index].name_);
50+
entry.__file_ = base_.make_str(images[index].name_);
5151
}
5252
}
5353

@@ -65,28 +65,28 @@ void linux::resolve_main_elf_syms(std::string_view main_elf_name) {
6565
if (_mm) {
6666
static elf::ELF _this_elf(_mm.addr_);
6767
if (_this_elf) {
68-
for (auto& entry : builder_.__entries_) {
68+
for (auto& entry : base_.__entries_) {
6969
if (entry.__desc_->empty() && entry.__file_ == main_elf_name) {
7070
auto name = _this_elf.getSym(entry.__addr_unslid_).name();
71-
entry.__desc_ = builder_.__alloc_.make_str(name);
71+
entry.__desc_ = base_.make_str(name);
7272
}
7373
}
7474
}
7575
}
7676
}
7777

78-
bool symbolize_entry(alloc& alloc, entry_base& entry) {
78+
bool symbolize_entry(base& base, entry_base& entry) {
7979
bool ret = false;
8080
Dl_info info;
8181
if (dladdr((void*)entry.__addr_actual_, &info)) {
8282
ret = true; // at least partially successful
8383
if (info.dli_fname && entry.__file_->empty()) {
8484
// provide at least the binary filename in case we cannot lookup source location
85-
entry.__file_ = alloc.make_str(info.dli_fname);
85+
entry.__file_ = base.make_str(info.dli_fname);
8686
}
8787
if (info.dli_sname && entry.__desc_->empty()) {
8888
// provide at least the mangled name; try to unmangle in a later step
89-
entry.__desc_ = alloc.make_str(info.dli_sname);
89+
entry.__desc_ = base.make_str(info.dli_sname);
9090
}
9191
}
9292
return ret;
@@ -96,8 +96,8 @@ bool symbolize_entry(alloc& alloc, entry_base& entry) {
9696
// except for symbols in the main program. If addr2line-style tools are enabled, that step
9797
// might also be able to get symbols directly from the binary's debug info.
9898
void linux::symbolize() {
99-
for (auto& entry : builder_.__entries_) {
100-
symbolize_entry(builder_.__alloc_, entry);
99+
for (auto& entry : base_.__entries_) {
100+
symbolize_entry(base_, entry);
101101
}
102102
// Symbols might be missing, because both (1) Linux's `dladdr` won't try to resolve non-exported symbols,
103103
// which can be the case for the main program executable; and (2) debug info was not preserved.

libcxx/src/stacktrace/linux/impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
1515
namespace __stacktrace {
1616

1717
struct linux {
18-
builder& builder_;
18+
base& base_;
1919

2020
#if defined(__linux__)
2121
// defined in linux.cpp

0 commit comments

Comments
 (0)