symbolic_debuginfo/
lib.rs

1//! Abstractions for dealing with object files and debug information.
2//!
3//! This module defines the [`Object`] type, which is an abstraction over various object file
4//! formats used in different platforms. Also, since executables on MacOS might contain multiple
5//! object files (called a _"Fat MachO"_), there is an [`Archive`] type, that provides a uniform
6//! interface with access to an objects iterator in all platforms.
7//!
8//! Most processing of object files will happen on the `Object` type or its concrete implementation
9//! for one platform. To allow abstraction over this, there is the [`ObjectLike`] trait. It defines
10//! common attributes and gives access to a [`DebugSession`], which can be used to perform more
11//! stateful handling of debug information.
12//!
13//! See [`Object`] for the full API, or use one of the modules for direct access to the
14//! platform-dependent data.
15//!
16//! # Background
17//!
18//! The functionality of `symbolic::debuginfo` is conceptionally similar to the [`object crate`].
19//! However, there are key differences that warranted a separate implementation:
20//!
21//!  - `object` has a stronger focus on executable formats, while `symbolic` focusses on debugging
22//!    information. This is why `symbolic` also includes a variant for PDBs and Breakpad objects,
23//!    where `object` instead has a WASM variant.
24//!  - `object` contains far more generic access to the data within objects at the cost of
25//!    performance. `symbolic` tries to optimize for debugging scenarios at the cost of generic
26//!    usage.
27//!  - `symbolic` contains an abstraction for multi-object files ([`Archive`]), which is not easily
28//!    possible in `object` due to the use of lifetimes on the `object::Object` trait.
29//!
30//! [`Object`]: enum.Object.html
31//! [`Archive`]: enum.Archive.html
32//! [`ObjectLike`]: trait.ObjectLike.html
33//! [`DebugSession`]: trait.DebugSession.html
34//! [`object crate`]: https://docs.rs/object
35
36#![warn(missing_docs)]
37
38mod base;
39#[cfg(all(
40    feature = "breakpad",
41    feature = "dwarf",
42    feature = "elf",
43    feature = "macho",
44    feature = "ms",
45    feature = "sourcebundle",
46    feature = "wasm"
47))]
48mod object;
49
50#[cfg(feature = "breakpad")]
51pub mod breakpad;
52#[cfg(feature = "dwarf")]
53pub mod dwarf;
54#[cfg(feature = "elf")]
55pub mod elf;
56#[cfg(any(feature = "dwarf", feature = "breakpad"))]
57pub mod function_builder;
58#[cfg(feature = "ms")]
59pub(crate) mod function_stack;
60#[cfg(feature = "js")]
61pub mod js;
62#[cfg(feature = "macho")]
63pub mod macho;
64#[cfg(feature = "ms")]
65pub mod pdb;
66#[cfg(feature = "ms")]
67pub mod pe;
68#[cfg(feature = "ppdb")]
69pub mod ppdb;
70#[cfg(feature = "sourcebundle")]
71pub mod sourcebundle;
72#[cfg(feature = "wasm")]
73pub mod wasm;
74
75pub use crate::base::*;
76#[cfg(all(
77    feature = "breakpad",
78    feature = "dwarf",
79    feature = "elf",
80    feature = "macho",
81    feature = "ms",
82    feature = "ppdb",
83    feature = "sourcebundle",
84    feature = "wasm"
85))]
86pub use crate::object::*;