gimli/
lib.rs

1//! `gimli` is a library for reading and writing the
2//! [DWARF debugging format](https://dwarfstd.org/).
3//!
4//! See the [read](./read/index.html) and [write](./write/index.html) modules
5//! for examples and API documentation.
6//!
7//! ## Cargo Features
8//!
9//! Cargo features that can be enabled with `gimli`:
10//!
11//! * `std`: Enabled by default. Use the `std` library. Disabling this feature
12//!   allows using `gimli` in embedded environments that do not have access to
13//!   `std`. Note that even when `std` is disabled, `gimli` still requires an
14//!   implementation of the `alloc` crate.
15//!
16//! * `read`: Enabled by default. Enables the `read` module. Use of `std` is
17//!   optional.
18//!
19//! * `write`: Enabled by default. Enables the `write` module. Always uses
20//!   the `std` library.
21#![deny(missing_docs)]
22#![deny(missing_debug_implementations)]
23// Selectively enable rust 2018 warnings
24#![warn(bare_trait_objects)]
25#![warn(unused_extern_crates)]
26#![warn(ellipsis_inclusive_range_patterns)]
27#![warn(elided_lifetimes_in_paths)]
28#![warn(explicit_outlives_requirements)]
29// Style.
30#![allow(clippy::bool_to_int_with_if)]
31#![allow(clippy::collapsible_else_if)]
32#![allow(clippy::comparison_chain)]
33#![allow(clippy::manual_range_contains)]
34#![allow(clippy::needless_late_init)]
35#![allow(clippy::too_many_arguments)]
36#![allow(clippy::needless_lifetimes)]
37// False positives with `fallible_iterator`.
38#![allow(clippy::should_implement_trait)]
39// False positives.
40#![allow(clippy::derive_partial_eq_without_eq)]
41#![no_std]
42
43#[allow(unused_imports)]
44#[cfg(any(feature = "read", feature = "write"))]
45#[macro_use]
46extern crate alloc;
47
48#[cfg(any(feature = "std", feature = "write"))]
49#[macro_use]
50extern crate std;
51
52#[cfg(feature = "endian-reader")]
53pub use stable_deref_trait::{CloneStableDeref, StableDeref};
54
55mod common;
56pub use crate::common::*;
57
58mod arch;
59pub use crate::arch::*;
60
61pub mod constants;
62// For backwards compat.
63pub use crate::constants::*;
64
65mod endianity;
66pub use crate::endianity::*;
67
68pub mod leb128;
69
70#[cfg(feature = "read-core")]
71pub mod read;
72// For backwards compat.
73#[cfg(feature = "read-core")]
74pub use crate::read::*;
75
76#[cfg(feature = "write")]
77pub mod write;
78
79#[cfg(test)]
80mod test_util;