|
| 1 | +//! Serialized unwind data captured per shared object, used to unwind stacks |
| 2 | +//! during post-processing. |
| 3 | +//! |
| 4 | +//! [`UnwindData`] aliases the current version ([`UnwindDataV4`]). On-disk |
| 5 | +//! artifacts are wrapped in `UnwindDataCompat` so older versions can still be |
| 6 | +//! deserialized and (where possible) upgraded via `From` impls. |
| 7 | +//! |
| 8 | +//! # Version history |
| 9 | +//! |
| 10 | +//! - **V1** — Original format. Carries both the pid-agnostic unwind tables |
| 11 | +//! (`eh_frame`/`eh_frame_hdr`) and per-pid load info (`avma_range`, |
| 12 | +//! `base_avma`) in a single struct. |
| 13 | +//! - **V2** — Adds `timestamp: Option<u64>` to mark when the data was captured |
| 14 | +//! (`None` = valid for the whole execution). Upgradable from V1. |
| 15 | +//! - **V3** — Splits per-pid load info out into [`ProcessUnwindData`], leaving |
| 16 | +//! only the deduplicated, pid-agnostic tables. *Breaking*: cannot be parsed |
| 17 | +//! as V2 (the per-pid fields are gone). Upgradable from V2. |
| 18 | +//! - **V4** — Makes `eh_frame_hdr`/`eh_frame_hdr_svma` optional. The hdr is just |
| 19 | +//! a binary-search index into `.eh_frame`; some binaries (e.g. Valgrind's |
| 20 | +//! statically-linked tools, linked without `ld --eh-frame-hdr`) omit it and |
| 21 | +//! the parser rebuilds the index from `.eh_frame`. Upgradable from V3. |
| 22 | +//! |
| 23 | +//! When adding a version: add a `UnwindDataV{N}` struct, a `From<V{N-1}>` impl |
| 24 | +//! (if non-breaking), a `UnwindDataCompat` variant, update the `UnwindData` |
| 25 | +//! alias and `parse`/`save_to`, and append an entry above. |
| 26 | +
|
1 | 27 | use core::{ |
2 | 28 | fmt::Debug, |
3 | 29 | hash::{Hash, Hasher}, |
|
0 commit comments