Skip to content

Commit fde2cef

Browse files
committed
Update README with new from current exception behavior
1 parent 3abeea4 commit fde2cef

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ int main() {
123123

124124
![from_current](res/from_current.png)
125125

126-
There are a few extraneous frames at the top of the stack corresponding to internals of exception handling in the
127-
standard library. These are a small price to pay for stack traces on all exceptions.
128-
129126
Cpptrace also provides a handful of traced exception objects that store stack traces when thrown. This is useful when
130127
the exceptions might not be caught by `CPPTRACE_CATCH`:
131128
```cpp
@@ -556,9 +553,6 @@ Any declarator `catch` accepts works with `CPPTRACE_CATCH`, including `...`. Thi
556553

557554
![from_current](res/from_current.png)
558555

559-
There are a few extraneous frames at the top of the stack corresponding to standard library exception handling
560-
internals. These are a small price to pay for stack traces on all exceptions.
561-
562556
API functions:
563557
- `cpptrace::raw_trace_from_current_exception`: Returns `const raw_trace&` from the current exception.
564558
- `cpptrace::from_current_exception`: Returns a resolved `const stacktrace&` from the current exception. Invalidates
@@ -605,6 +599,10 @@ CPPTRACE_TRY {
605599
}
606600
```
607601

602+
Note: Internally the trace contains some extra frames for calls like `__cxa_throw`, `_UnwindRaiseException`, etc. These
603+
are filtered out during stacktrace printing but they will be present if you manually inspect the vector of stacktrace
604+
frames.
605+
608606
> [!IMPORTANT]
609607
> There is an unfortunate limitation with `return` statements in these try/catch macros: The implementation on Windows
610608
> requires wrapping the try body in an immediately-invoked lambda and as such `return` statements would return from the

res/from_current.png

-36.5 KB
Loading

0 commit comments

Comments
 (0)