1 //! `gimli` is a library for reading and writing the
2 //! [DWARF debugging format](http://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 // Allow clippy warnings when we aren't building with clippy.
30 #![allow(unknown_lints)]
31 // False positives with `fallible_iterator`.
32 #![allow(clippy::should_implement_trait)]
33 // Many false positives involving `continue`.
34 #![allow(clippy::never_loop)]
35 // False positives when block expressions are used inside an assertion.
36 #![allow(clippy::panic_params)]
37 #![no_std]
38 
39 #[allow(unused_imports)]
40 #[cfg(any(feature = "read", feature = "write"))]
41 #[macro_use]
42 extern crate alloc;
43 
44 #[cfg(any(feature = "std", feature = "write"))]
45 #[macro_use]
46 extern crate std;
47 
48 #[cfg(feature = "stable_deref_trait")]
49 pub use stable_deref_trait::{CloneStableDeref, StableDeref};
50 
51 mod common;
52 pub use crate::common::*;
53 
54 mod arch;
55 pub use crate::arch::*;
56 
57 pub mod constants;
58 // For backwards compat.
59 pub use crate::constants::*;
60 
61 mod endianity;
62 pub use crate::endianity::{BigEndian, Endianity, LittleEndian, NativeEndian, RunTimeEndian};
63 
64 pub mod leb128;
65 
66 #[cfg(feature = "read-core")]
67 pub mod read;
68 // For backwards compat.
69 #[cfg(feature = "read-core")]
70 pub use crate::read::*;
71 
72 #[cfg(feature = "write")]
73 pub mod write;
74 
75 #[cfg(test)]
76 mod test_util;
77