Fix some typos and do some minor rewording

This commit is contained in:
Jeremy Rifkin 2025-02-17 23:22:27 -06:00
parent e7f8521936
commit 6180399996
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -347,8 +347,8 @@ namespace cpptrace {
## Formatting ## Formatting
Cpptrace provides a configurable formatter for stack trace printing supporting common options. Formatters are configured Cpptrace provides a configurable formatter for stack trace printing which supports some common options. Formatters are
following a sort of builder pattern, e.g. configured with a sort of builder pattern, e.g.:
```cpp ```cpp
auto formatter = cpptrace::formatter{} auto formatter = cpptrace::formatter{}
.header("Stack trace:") .header("Stack trace:")
@ -356,7 +356,7 @@ auto formatter = cpptrace::formatter{}
.snippets(true); .snippets(true);
``` ```
To use this API be sure to `#include <cpptrace/formatting.hpp>`. This API is available through the `<cpptrace/formatting.hpp>` header.
Synopsis: Synopsis:
```cpp ```cpp
@ -411,9 +411,10 @@ Options:
| `filtered_frame_placeholders` | Whether to still print filtered frames as just `#n (filtered)` | `true` | | `filtered_frame_placeholders` | Whether to still print filtered frames as just `#n (filtered)` | `true` |
| `filter` | A predicate to filter frames with | None | | `filter` | A predicate to filter frames with | None |
The `automatic` color mode only works for a stream that may be attached to a terminal, e.g. `cout` or `stdout`, The `automatic` color mode attempts to detect if a stream that may be attached to a terminal. As such, it will not use
`formatter::format` and `formatter::print` methods have overloads taking a color parameter. This color parameter will colors for the `formatter::format` method and it may not be able to detect if some ostreams correspond to terminals or
override configured color mode. not. For this reason, `formatter::format` and `formatter::print` methods have overloads taking a color parameter. This
color parameter will override configured color mode.
Recommended practice with formatters: It's generally preferable to create formatters objects that are long-lived rather Recommended practice with formatters: It's generally preferable to create formatters objects that are long-lived rather
than to create them on the fly every time a trace needs to be formatted. than to create them on the fly every time a trace needs to be formatted.
@ -880,8 +881,8 @@ The main cpptrace header is `cpptrace/cpptrace.hpp` which includes everything ot
## Libdwarf Tuning ## Libdwarf Tuning
For extraordinarily large binaries (multiple gigabytes), cpptrace's internal caching can result in a lot of memory For extraordinarily large binaries (multiple gigabytes), cpptrace's internal caching can result in a lot of memory
usage. Cpptrace provides a couple options to control the caching done by libdwarf so that this memory usage can be usage. Cpptrace provides some options to reduce memory usage in exchange for performance in memory-constrained
reduced in exchange for performance. applications.
Synopsis: Synopsis:
@ -900,8 +901,8 @@ Explanation:
lots of debug info. Passing `nullable<std::size_t>::null()` will disable the cache size (which is the default lots of debug info. Passing `nullable<std::size_t>::null()` will disable the cache size (which is the default
behavior). behavior).
- `set_dwarf_resolver_disable_aranges` can be used to disable use of dwarf `.debug_aranges`, an accelerated range lookup - `set_dwarf_resolver_disable_aranges` can be used to disable use of dwarf `.debug_aranges`, an accelerated range lookup
table for compile units emitted by most compilers. Cpptrace uses these by default since they can speed up resolution, table for compile units emitted by many compilers. Cpptrace uses these by default if they are present since they can
however, they can also result in significant memory usage. speed up resolution, however, they can also result in significant memory usage.
# Supported Debug Formats # Supported Debug Formats