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 allows
12//! using `gimli` in embedded environments that do not have access to `std`.
13//!
14//! * `read`: Enabled by default. Enables the `read` module. Use of `std` is optional.
15//! Requires the `alloc` crate.
16//!
17//! * `read-core`: Enabled by default. Enables a subset of the `read` module that does
18//! not require the `alloc` crate.
19//!
20//! * `endian-reader`: Enabled by default. Enables the [`EndianReader`] trait. This is
21//! a separate feature because it also depends on the `stable_deref_trait` crate.
22//!
23//! * `write`: Enabled by default. Enables the `write` module. Use of `std` is optional.
24//! Requires the `alloc` crate. Enabling both `read` and `write` will also enable
25//! conversion functionality in the `write` module.
26//!
27#![deny(missing_docs)]
28#![deny(missing_debug_implementations)]
29// Selectively enable rust 2018 warnings
30#![warn(bare_trait_objects)]
31#![warn(unused_extern_crates)]
32#![warn(ellipsis_inclusive_range_patterns)]
33#![warn(elided_lifetimes_in_paths)]
34#![warn(explicit_outlives_requirements)]
35// Style.
36#![allow(clippy::bool_to_int_with_if)]
37#![allow(clippy::collapsible_else_if)]
38#![allow(clippy::comparison_chain)]
39#![allow(clippy::manual_range_contains)]
40#![allow(clippy::needless_late_init)]
41#![allow(clippy::too_many_arguments)]
42#![allow(clippy::needless_lifetimes)]
43// False positives with `fallible_iterator`.
44#![allow(clippy::should_implement_trait)]
45// False positives.
46#![allow(clippy::derive_partial_eq_without_eq)]
47#![no_std]
48
49#[allow(unused_imports)]
50#[cfg(any(feature = "read", feature = "write"))]
51#[macro_use]
52extern crate alloc;
53
54#[cfg(feature = "std")]
55#[macro_use]
56extern crate std;
57
58#[cfg(feature = "endian-reader")]
59pub use stable_deref_trait::{CloneStableDeref, StableDeref};
60
61mod common;
62pub use crate::common::*;
63
64mod arch;
65pub use crate::arch::*;
66
67pub mod constants;
68// For backwards compat.
69pub use crate::constants::*;
70
71mod endianity;
72pub use crate::endianity::*;
73
74pub mod leb128;
75
76mod case_fold;
77pub use crate::case_fold::*;
78
79#[cfg(feature = "read-core")]
80pub mod read;
81// For backwards compat.
82#[cfg(feature = "read-core")]
83pub use crate::read::*;
84
85#[cfg(feature = "write")]
86pub mod write;
87
88#[cfg(test)]
89mod test_util;