Releases: jeremy-rifkin/cpptrace
Version 1.0.4
Added
- Added filtering for C++ exception handling internals during printing. This cleans up output from current exceptions
and std::terminate traces.
Fixed:
- Fixed reported version number for cpptrace
Other:
- Bumped default libdwarf to 2.1.0
- Updated stacktrace output for the cpptrace terminate handler
- Updated demo program
Version 1.0.3
Added:
- Added line indicator to make source code snippets in case colors aren't being used
- Added column indicator to source code snippets
- Added 32-bit ARM support for StackWalk64 #271 (@Xottab-DUTY)
Version 1.0.2
Added:
- Added
break_before_filenameformatting option #259 (@codeinred)
Fixes:
- Fixed 32-bit clang-cl build
- Fixed build on gcc 4.8.5
- Fixed StackWalk64 for 64-bit arm #270 (@mcourteaux)
- Fixed compatibility issue with cmake versions before 3.23
Other:
- Added a couple notes to the README
Version 1.0.1
Added:
- Added from-current-exception utility for SEH on windows (
CPPTRACE_SEH_TRY/CPPTRACE_SEH_EXCEPT)
Fixes:
- Fixed a static assert without a message causing issues on some C++11 builds
- Fixed build 32-bit build on linux
- Fixed from-current-exception system for 32-bit windows where SEH behaves much differently
- Fixed clang-cl build
Version 1.0.0
Major changes:
- Overhauled how the from-current-exception system and
CPPTRACE_TRY/CPPTRACE_CATCHmacros work. They now check the
thrown exception type against the type the catch accepts to decide whether or not to collect a trace. This eliminates
the need for TheTRYZ/CATCHZvariants of the macros as now the normal macro is equally zero-overhead. As such, the
Zvariants have been removed.
Breaking changes:
-
CPPTRACE_TRYZandCPPTRACE_CATCHZhave been removed, change uses toCPPTRACE_TRY/CPPTRACE_CATCH -
CPPTRACE_TRY/CPPTRACE_CATCHmacros no longer support multiple handlers andCPPTRACE_CATCH_ALThas been removed.
Instead, usecpptrace::try_catch.Details
Author's note: I apologize for this non-trivial breaking change, however, it allows for a much improved
implementation of the from-current-exception system. The impact should be very minimal
for most codebases.Transitioning to
cpptrace::try_catchis straightforward:Before Now CPPTRACE_TRY { foo(); } CPPTRACE_CATCH(const std::logic_error& e) { handle_logic_error(e); } CPPTRACE_CATCH_ALT(const std::exception& e) { handle_exception(e); } CPPTRACE_CATCH_ALT(...) { handle_unknown_exception(); }cpptrace::try_catch( [&] { // try block foo(); }, [&] (const std::runtime_error& e) { handle_logic_error(e); }, [&] (const std::exception& e) { handle_exception(e); }, [&] () { // `catch(...)` handle_unknown_exception(); } );
Please note as well that code such as the following, which was valid before, will still compile now but may report a
misleading trace. The second catch handler will work but it cpptrace won't know about the handler's type and won't
collect a trace that doesn't match the first handler's type,std::logic_error.CPPTRACE_TRY { foo(); } CPPTRACE_CATCH(const std::logic_error& e) { ... } catch(const std::exception& e) { ... }
Potentially-breaking changes:
- This version of cpptrace reworks the public interface to use an inline ABI versioning namespace. All symbols in the
public interface are now secretly in thecpptrace::v1namespace. This is an ABI break, but any ABI mismatch will
result in linker errors instead of silent bugs. This change is an effort to allow future evolution of cpptrace in a
way that respects ABI. - This version fixes a problem with returns from
CPPTRACE_TRYblocks on windows. Unfortunately, this macro has to use
an IILE on windows and as suchreturnstatements won't properly return from the enclosing function. This was a
footgun and nowreturnstatements inCPPTRACE_TRYblocks are prevented from compiling on windows.
Added
- Added
cpptrace::try_catchfor handling multiple alternatives with access to current exception traces - Added
cpptrace::rethrowutility for rethrowing exceptions fromCPPTRACE_CATCHwhile preserving the stacktrace #214 - Added utilities for getting the current trace from the last rethrow point
(cpptrace::raw_trace_from_current_exception_rethrow,cpptrace::from_current_exception_rethrow,
cpptrace::current_exception_was_rethrown) - Added a logger system to allow cpptrace to report errors in a configurable manner. By default, cpptrace doesn't log
anything. The following functions can be used to change this: (cpptrace::set_log_level,
cpptrace::set_log_callback, andcpptrace::use_default_stderr_logger) - Added
cpptrace::basenameutility - Added
cpptrace::prettify_typeutility - Added
cpptrace::prune_symbolutility - Added formatter option for symbol formatting (
cpptrace::formatter::symbols) - Added
cpptrace::detail::lazy_trace_holder::is_resolved - Added support for C++20 modules #248
- Added
cpptrace::load_symbols_for_fileto support DLLs loaded at runtime when using dbghelp #247
Removed
- Removed
CPPTRACE_TRYZandCPPTRACE_CATCHZmacros - Removed the
CPPTRACE_CATCH_ALTmacro
Fixed
- Fixed a problem where
CPPTRACE_TRYblocks could containreturnstatements but not return on windows due to an IILE. This is now an error. #245 - Fixed cases where cpptrace could print to stderr on internal errors without the user desiring so #234
- Fixed a couple internal locking mistakes
- Fixed a couple of code paths that could be susceptible to static init order issues
- Fixed bug with loading elf symbol tables that contain zero-sized entries
- Fixed an incorrect assertion regarding looking up symbols at program counters that reside before any seen subprogram DIE #250
- Fixed issue with
cpptrace::stacktrace::to_string()ending with a newline on empty traces
Other
- Marked some paths in
CPPTRACE_CATCHandCPPTRACE_CATCHZas unreachable to improve usability in cases where the
compiler may warn about missing returns. - Improved resilience to libdwarf errors #251
- Removed internal use of
std::is_trivialwhich is deprecated in C++26 #236 - Bumped libdwarf to 2.0.0
- Added
--addressflag for internal symbol table tool - Various internal work to improve the codebase and reduce complexity
Version 0.8.3
Added:
- Added basic JIT support #226
- Added
cpptrace::formatter::transform#227 - Added support for gcc 4.8.5 #220
Fixed:
- Fixed bug related to calling
dwarf_deallocon strings fromdwarf_formstringanddwarf_dienamedavea42/libdwarf-code#279 - Fixed incorrect cmake version variable #231
- Fixed
address_mode::nonenot working #221 - Fixed use of
-Wallfor clang-cl
Other:
- Added ARM CI
- Miscellaneous work on supporting old compilers
- Updated cpptrace cmake target configuration to not add public compile definitions
- Internal refactoring, cleanup, and code improvements
Version 0.8.2
Fixed:
- Fixed printing of internal error messages when an object file can't be loaded, mainly affecting MacOS #217
Other:
- Bumped zstd via FetchContent to 1.5.7
Version 0.8.1
Fixed:
- Fixed compile error on msvc #215
Added:
- Added
cpptrace::can_get_safe_object_frame()
Breaking changes:
- Renamed ctrace's
can_signal_safe_unwindtoctrace_can_signal_safe_unwind. This was an oversight. Apologies for
including a breaking change in a patch release. Github code search suggests this API isn't used in public code, at
least.
Other:
- Added CI workflow to test on old msvc
- Made some internal improvements on robustness and cleanliness
Version 0.8.0
Added:
- Added support for resolving symbols from elf and mach-o symbol tables, allowing function names to be resolved even in
a build that doesn't include debug information #201 - Added a configurable stack trace formatter #164
- Added configuration options for the libdwarf back-end that can be used to lower memory usage on memory-constrained
systems #193 - Added
cpptrace::nullable<T>::null_value - Made
cpptrace::nullable<T>member functions conditionallyconstexprwhere possible
Fixed:
- Fixed handling of
SymInitializewhen other code has already calledSymInitialize.SymInitializemust only be
called once per handle and cpptrace now attempts to duplicate the current process handle to avoid conflicts.
#204 - Fixed a couple of locking edge cases surrounding dbghelp functions
- Fixed improper deallocation of
dwarf_errmsgin the libdwarf back-end
Breaking changes:
cpptrace::get_snippetpreviously included a newline at the end but it now does not. This also affects the behavior
of trace formatting with snippets enabled.
Other:
- Significantly improved memory usage and performance of the libdwarf back-end
- Improved implementation and organization of internal utility types, such as
optionalandResult - Improved trace printing and formatting implementation
- Added unit tests for library internal utilities
- Added logic to the cxxabi demangler to ensure external names begin with
_Zor__Zbefore attempting to demangle - Added various internal tools and abstractions to improve maintainability and clarity
- Various internal improvements for robustness
- Added a small handful of utility tool programs that are useful for continued development, maintenance, and debugging
- Improved library CI setup
- Marked the
CPPTRACE_BUILD_BENCHMARKoption as advanced