Line data Source code
1 : //! Module for processing PDB file
2 : //!
3 : //! This module exposes an API similar to the [`crate::dwarf`] module to process PDB
4 : //! files.
5 : //!
6 : //! One can instantiate a [`crate::pdb::DebugInfo`] using either [`crate::generic::Binary::debug_info`] or
7 : //! [`crate::pdb::load`].
8 : //!
9 : //! ```
10 : //! fn read_pdb(file: &str) {
11 : //! let pdb = lief::pdb::load(file).unwrap();
12 : //! for symbol in pdb.public_symbols() {
13 : //! println!("name: {}", symbol.name());
14 : //! }
15 : //! }
16 : //! ```
17 :
18 : use lief_ffi as ffi;
19 :
20 : use crate::common::into_optional;
21 :
22 : pub mod debug_info;
23 : pub mod compilation_unit;
24 : pub mod public_symbol;
25 : pub mod function;
26 : pub mod types;
27 :
28 : #[doc(inline)]
29 : pub use debug_info::DebugInfo;
30 :
31 : #[doc(inline)]
32 : pub use compilation_unit::CompilationUnit;
33 :
34 : #[doc(inline)]
35 : pub use public_symbol::PublicSymbol;
36 :
37 : #[doc(inline)]
38 : pub use function::Function;
39 :
40 : #[doc(inline)]
41 : pub use types::Type;
42 :
43 : /// Load a PDB from its file path
44 0 : pub fn load(path: &str) -> Option<DebugInfo> {
45 0 : into_optional(ffi::PDB_DebugInfo::from_file(path))
46 0 : }
|