diff options
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 16 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/atomic_base.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/std/stacktrace | 28 |
3 files changed, 42 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0449198..c292b3f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,19 @@ +2025-10-17 Tomasz KamiĆski <tkaminsk@redhat.com> + + * include/bits/atomic_base.h + (__atomic_ref_base::_S_required_alignment): Renamed from... + (__atomic_ref_base::_S_required_aligment): Renamed. + +2025-10-16 Jonathan Wakely <jwakely@redhat.com> + + * include/std/stacktrace + (operator<<(ostream&, const stacktrace_entry&)): Improve output + when description() or source_file() returns an empty string, + or the stacktrace_entry is invalid. Append frame address to + output. + (operator<<(ostream&, const basic_stacktrace<A>&)): Use the + size_type of the correct specialization. + 2025-10-15 Jonathan Wakely <jwakely@redhat.com> * python/libstdcxx/v6/printers.py (StdStacktraceEntryPrinter): diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 7e4ad2b..ccea132 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -1535,7 +1535,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } static consteval int - _S_required_aligment() + _S_required_alignment() { if constexpr (is_floating_point_v<_Vt> || is_pointer_v<_Vt>) return __alignof__(_Vt); @@ -1555,7 +1555,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION static_assert(is_always_lock_free || !is_volatile_v<_Tp>, "atomic operations on volatile T must be lock-free"); - static constexpr size_t required_alignment = _S_required_aligment(); + static constexpr size_t required_alignment = _S_required_alignment(); __atomic_ref_base() = delete; __atomic_ref_base& operator=(const __atomic_ref_base&) = delete; diff --git a/libstdc++-v3/include/std/stacktrace b/libstdc++-v3/include/std/stacktrace index b9e260e..587a163 100644 --- a/libstdc++-v3/include/std/stacktrace +++ b/libstdc++-v3/include/std/stacktrace @@ -683,13 +683,32 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline ostream& operator<<(ostream& __os, const stacktrace_entry& __f) { + if (!__f) [[unlikely]] + return __os << "<unknown>"; + string __desc, __file; int __line; - if (__f._M_get_info(&__desc, &__file, &__line)) + if (__f._M_get_info(&__desc, &__file, &__line)) [[likely]] { - __os.width(4); - __os << __desc << " at " << __file << ':' << __line; + __os << ' '; + if (__desc.empty()) [[unlikely]] + __os << "<unknown>"; + else + __os << __desc; + if (!__file.empty()) [[likely]] + __os << " at " << __file << ':' << __line; } + + struct _Flag_guard // Set and restore hex format + { + _Flag_guard(ios& __s) : _M_ios(__s) { } + ~_Flag_guard() { _M_ios.setf(_M_f); } + + ios& _M_ios; + ios::fmtflags _M_f = _M_ios.setf(ios::hex, ios::basefield); + }; + _Flag_guard __g(__os); + __os << " [0x" << __f.native_handle() << ']'; return __os; } @@ -697,7 +716,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline ostream& operator<<(ostream& __os, const basic_stacktrace<_Allocator>& __st) { - for (stacktrace::size_type __i = 0; __i < __st.size(); ++__i) + using size_type = typename basic_stacktrace<_Allocator>::size_type; + for (size_type __i = 0, __size = __st.size(); __i < __size; ++__i) { __os.width(4); __os << __i << "# " << __st[__i] << '\n'; |