Skip to content

Commit bfe123d

Browse files
committed
Update and clarify a few changelog notes
1 parent 1b2b51c commit bfe123d

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
# v1.0.0
3434

3535
Major changes:
36-
- Overhauled how the from current exception system and `CPPTRACE_TRY`/`CPPTRACE_CATCH` macros work. They now check the
36+
- Overhauled how the from-current-exception system and `CPPTRACE_TRY`/`CPPTRACE_CATCH` macros work. They now check the
3737
thrown exception type against the type the catch accepts to decide whether or not to collect a trace. This eliminates
3838
the need for The `TRYZ`/`CATCHZ` variants of the macros as now the normal macro is equally zero-overhead. As such, the
3939
`Z` variants have been removed.
@@ -45,7 +45,8 @@ Breaking changes:
4545
> **Details**
4646
>
4747
> Author's note: I apologize for this non-trivial breaking change, however, it allows for a much improved
48-
> implementation of the from current exception system and the impact should be [minimal for most codebases](https://github.com/search?type=code&q=%2F%5CbCPPTRACE_CATCH_ALT%5Cb%2F+language%3Ac%2B%2B+-is%3Afork+-repo%3Ajeremy-rifkin%2Fcpptrace+-path%3Afrom_current.hpp).
48+
> implementation of the from-current-exception system. The impact should be [very minimal](https://github.com/search?type=code&q=%2F%5CbCPPTRACE_CATCH_ALT%5Cb%2F+language%3Ac%2B%2B+-is%3Afork+-repo%3Ajeremy-rifkin%2Fcpptrace+-path%3Afrom_current.hpp)
49+
> for most codebases.
4950
>
5051
> Transitioning to `cpptrace::try_catch` is straightforward:
5152
> <table>
@@ -71,7 +72,7 @@ Breaking changes:
7172
> } CPPTRACE_CATCH_ALT(const std::exception& e) {
7273
> handle_exception(e);
7374
> } CPPTRACE_CATCH_ALT(...) {
74-
> handle_unknown_exception(e);
75+
> handle_unknown_exception();
7576
> }
7677
> ```
7778
@@ -90,7 +91,7 @@ Breaking changes:
9091
> handle_exception(e);
9192
> },
9293
> [&] () { // `catch(...)`
93-
> handle_unknown_exception(e);
94+
> handle_unknown_exception();
9495
> }
9596
> );
9697
> ```
@@ -100,30 +101,31 @@ Breaking changes:
100101
> </tbody>
101102
> </table>
102103
>
103-
> Please note as well that code such as the following, which was valid before, will still compile now. The catch
104-
> handler will work but it won't receive a correct current trace.
104+
> Please note as well that code such as the following, which was valid before, will still compile now but may report a
105+
> misleading trace. The second catch handler will work but it cpptrace won't know about the handler's type and won't
106+
> collect a trace that doesn't match the first handler's type, `std::logic_error`.
105107
>
106108
> ```cpp
107109
> CPPTRACE_TRY {
108110
> foo();
109111
> } CPPTRACE_CATCH(const std::logic_error& e) {
110112
> ...
111113
> } catch(const std::exception& e) {
112-
> handle_exception(e);
114+
> ...
113115
> }
114116
> ```
115117
116118
Potentially-breaking changes:
117119
- This version of cpptrace reworks the public interface to use an inline ABI versioning namespace. All symbols in the
118-
public interface are now secretly in the `cpptrace::v1` namespace. This is an ABI break, but any abi mismatch will
120+
public interface are now secretly in the `cpptrace::v1` namespace. This is an ABI break, but any ABI mismatch will
119121
result in linker errors instead of silent bugs. This change is an effort to allow future evolution of cpptrace in a
120122
way that respects ABI.
121123
- This version fixes a problem with returns from `CPPTRACE_TRY` blocks on windows. Unfortunately, this macro has to use
122124
an IILE on windows and as such `return` statements won't properly return from the enclosing function. This was a
123125
footgun and now `return` statements in `CPPTRACE_TRY` blocks are prevented from compiling on windows.
124126
125127
Added
126-
- Added `cpptrace::try_catch` for handling multiple alternatives with stack traces access
128+
- Added `cpptrace::try_catch` for handling multiple alternatives with access to current exception traces
127129
- Added `cpptrace::rethrow` utility for rethrowing exceptions from `CPPTRACE_CATCH` while preserving the stacktrace https://github.com/jeremy-rifkin/cpptrace/issues/214
128130
- Added utilities for getting the current trace from the last rethrow point
129131
(`cpptrace::raw_trace_from_current_exception_rethrow`, `cpptrace::from_current_exception_rethrow`,
@@ -132,18 +134,22 @@ Added
132134
anything. The following functions can be used to change this: (`cpptrace::set_log_level`,
133135
`cpptrace::set_log_callback`, and `cpptrace::use_default_stderr_logger`)
134136
- Added `cpptrace::basename` utility
135-
- Added formatter option to clean up some long symbol names (`cpptrace::formatter::prettify_symbols`)
136137
- Added `cpptrace::prettify_type` utility
137138
- Added `cpptrace::prune_symbol` utility
139+
- Added formatter option for symbol formatting (`cpptrace::formatter::symbols`)
138140
- Added `cpptrace::detail::lazy_trace_holder::is_resolved`
139141
- Added support for C++20 modules https://github.com/jeremy-rifkin/cpptrace/pull/248
140142
- Added `cpptrace::load_symbols_for_file` to support DLLs loaded at runtime when using dbghelp https://github.com/jeremy-rifkin/cpptrace/pull/247
141143
144+
Removed
145+
- Removed `CPPTRACE_TRYZ` and `CPPTRACE_CATCHZ` macros
146+
- Removed the `CPPTRACE_CATCH_ALT` macro
147+
142148
Fixed
143149
- Fixed a problem where `CPPTRACE_TRY` blocks could contain `return` statements but not return on windows due to an IILE. This is now an error. https://github.com/jeremy-rifkin/cpptrace/issues/245
144150
- Fixed cases where cpptrace could print to stderr on internal errors without the user desiring so https://github.com/jeremy-rifkin/cpptrace/issues/234
145151
- Fixed a couple internal locking mistakes
146-
- Prevented a couple code paths that could be susceptible to static init order issues
152+
- Fixed a couple of code paths that could be susceptible to static init order issues
147153
- Fixed bug with loading elf symbol tables that contain zero-sized entries
148154
- Fixed an incorrect assertion regarding looking up symbols at program counters that reside before any seen subprogram DIE https://github.com/jeremy-rifkin/cpptrace/issues/250
149155
- Fixed issue with `cpptrace::stacktrace::to_string()` ending with a newline on empty traces

0 commit comments

Comments
 (0)