|
5 | 5 | <br/>
|
6 | 6 | [-Community%20Discord-blue?labelColor=2C3239&color=7289DA&style=flat&logo=discord&logoColor=959DA5)](https://discord.gg/frjaAZvqUZ)
|
7 | 7 | <br/>
|
8 |
| -[](https://godbolt.org/z/c6TqTzqcf) |
| 8 | +[](https://godbolt.org/z/aP8PsxxeY) |
9 | 9 |
|
10 |
| -Cpptrace is a simple and portable C++ stacktrace library supporting C++11 and greater on Linux, macOS, |
11 |
| -and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once. |
| 10 | +Cpptrace is a simple and portable C++ stacktrace library supporting C++11 and greater on Linux, macOS, and Windows |
| 11 | +including MinGW and Cygwin environments. The goal: Make stack traces simple for once. |
| 12 | + |
| 13 | +In addition to providing access to stack traces, cpptrace also provides a mechanism for getting stacktraces from thrown |
| 14 | +exceptions which is immensely valuable for debugging and triaging. More info [below](#traces-from-all-exceptions-cpptrace_try-and-cpptrace_catch). |
12 | 15 |
|
13 | 16 | Cpptrace also has a C API, docs [here](docs/c-api.md).
|
14 | 17 |
|
@@ -87,22 +90,26 @@ Cpptrace can also retrieve function inlining information on optimized release bu
|
87 | 90 |
|
88 | 91 | 
|
89 | 92 |
|
90 |
| -Cpptrace provides access to resolved stack traces as well as lightweight raw traces (just addresses) that can be |
91 |
| -resolved later: |
| 93 | +Cpptrace provides access to resolved stack traces as well as fast and lightweight raw traces (just addresses) that can |
| 94 | +be resolved later: |
92 | 95 |
|
93 | 96 | ```cpp
|
94 | 97 | const auto raw_trace = cpptrace::generate_raw_trace();
|
95 | 98 | // then later
|
96 | 99 | raw_trace.resolve().print();
|
97 | 100 | ```
|
98 | 101 |
|
99 |
| -Cpptrace provides a way to produce stack traces on arbitrary exceptions. More information on this system |
100 |
| -[below](#traces-from-all-exceptions). |
| 102 | +One of the most important features cpptrace offers is the ability to retrieve stack traces on arbitrary exceptions. |
| 103 | +More information on this system [below]((#traces-from-all-exceptions-cpptrace_try-and-cpptrace_catch)). |
101 | 104 | ```cpp
|
102 | 105 | #include <cpptrace/from_current.hpp>
|
| 106 | +#include <iostream> |
| 107 | +#include <stdexcept> |
| 108 | + |
103 | 109 | void foo() {
|
104 | 110 | throw std::runtime_error("foo failed");
|
105 | 111 | }
|
| 112 | + |
106 | 113 | int main() {
|
107 | 114 | CPPTRACE_TRY {
|
108 | 115 | foo();
|
@@ -135,8 +142,9 @@ Additional notable features:
|
135 | 142 | - Utilities for demangling
|
136 | 143 | - Utilities for catching `std::exception`s and wrapping them in traced exceptions
|
137 | 144 | - Signal-safe stack tracing
|
| 145 | + - As far as I can tell cpptrace is the only library which can truly do this in a signal-safe manner |
138 | 146 | - Source code snippets in traces
|
139 |
| -- Extensive configuration options for [trace formatting](#formatting) |
| 147 | +- Extensive configuration options for [trace formatting](#formatting) and pretty-printing |
140 | 148 |
|
141 | 149 | 
|
142 | 150 |
|
|
0 commit comments