1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! `lsda` is a library for reading and writing the language-specific data
//! area (LSDA) of GCC-compatible exception handling, as stored in the
//! `.gcc_except_table` section.
//!
//! An LSDA describes, for one function, which call sites may throw, where
//! their landing pads are, and which exception types each landing pad
//! handles. The personality routine (such as `__gxx_personality_v0`) finds it
//! through the `L` augmentation of the function's FDE in `.eh_frame`, or,
//! on Arm, at the end of the function's `.ARM.extab` entry.
//!
//! The format has no standalone specification. It is defined by its producers
//! and consumers, which this crate follows:
//!
//! * GCC `gcc/except.cc` (`output_one_function_exception_table`), the
//! original producer;
//! * libstdc++ `libsupc++/eh_personality.cc` and libgcc `unwind-pe.h`, the
//! reference consumer, including its Arm EHABI and SJLJ variants;
//! * LLVM `CodeGen/AsmPrinter/EHStreamer.cpp` and libc++abi
//! `cxa_personality.cpp`.
//!
//! Pointer encodings are the `DW_EH_PE_*` values of the Linux Standard Base
//! Core Specification 5.0, "Exception Frames".
//!
//! The API is organised as follows:
//!
//! * The [`read`] module parses an LSDA at a given offset through the
//! [`Reader`](read::Reader) trait, with zero-copy
//! [`EndianSlice`](read::EndianSlice) as the usual implementation.
//! Iterators return `Result<Option<T>>`.
//!
//! * The [`write`](mod@write) module builds an in-memory
//! [`GccExceptTable`](write::GccExceptTable) and writes it to a
//! [`Writer`](write::Writer) such as [`EndianVec`](write::EndianVec),
//! optionally recording relocations.
//!
//! * [`Encoding`] and [`Format`] are shared by both.
//!
//! The [`read`] and [`write`](mod@write) module documentation each start with
//! a complete example.
//!
//! ## Cargo features
//!
//! * `read` (default): the [`read`] module.
//! * `write` (default): the [`write`](mod@write) module.
//! * `fallible-iterator`: implement `fallible_iterator::FallibleIterator`
//! for the iterators.
//!
//! The crate is `no_std` and requires `alloc`. The error types implement
//! `core::error::Error`.
// Iterators have an inherent `next` returning `Result<Option<T>>`, so that
// errors propagate with `?`; they also implement `Iterator`.
extern crate alloc;
pub use crate*;
pub use crate*;