Portable C++ stacktrace library. ; tests
This is a build2 package containing the test suite for the
cpptrace library. Currently
only the upstream unit tests (using gtest/gmock) are included.
Importable targets
This package exports no targets.
Configuration variables
This package provides no configuration variables.
| version | 1.0.4+3 |
|---|---|
| license | MITMIT License |
| repository | https://pkg.cppget.org/1/testing |
| download | libcpptrace-tests-1.0.4+3.tar.gz |
| sha256 | 72e37b59e105472540fef7907266ee6706a569333580c3aa68b146c9a0935d93 |
| project | cpptrace |
|---|---|
| url | github.com/jeremy-rifkin/cpptrace |
| package-url | github.com/build2-packaging/cpptrace |
| package-email | packaging@build2.orgMailing list |
Depends (3)
| gtest ^1.11.0+1 | |
| gmock ^1.11.0+1 | |
| libcpptrace |
Reviews
| fail | 0 |
|---|---|
| pass | 0 |
Changes
Changelog
- Changelog
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.1
- v0.2.0
- v0.1.1
- v0.1
v1.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
v1.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 https://github.com/jeremy-rifkin/cpptrace/pull/271 (@Xottab-DUTY)
v1.0.2
Added:
- Added
break_before_filenameformatting option https://github.com/jeremy-rifkin/cpptrace/issues/259 (@codeinred)
Fixes:
- Fixed 32-bit clang-cl build
- Fixed build on gcc 4.8.5
- Fixed StackWalk64 for 64-bit arm https://github.com/jeremy-rifkin/cpptrace/pull/270 (@mcourteaux)
- Fixed compatibility issue with cmake versions before 3.23
Other:
- Added a couple notes to the README
v1.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
v1.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, theZvariants 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: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 the
cpptrace::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 https://github.com/jeremy-rifkin/cpptrace/issues/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 https://github.com/jeremy-rifkin/cpptrace/pull/248
- Added
cpptrace::load_symbols_for_fileto support DLLs loaded at runtime when using dbghelp https://github.com/jeremy-rifkin/cpptrace/pull/247