[−][src]Trait symbolic::debuginfo::DebugSession
A stateful session for interfacing with debug information.
Debug sessions can be obtained via ObjectLike::debug_session
. Since computing a session may
be a costly operation, try to reuse the session as much as possible.
Implementing DebugSession
Reading debug information from object files usually requires loading multiple sections into
memory and computing maps for quick random access to certain information. Since this can be a
quite costly process, this is encapsulated into a DebugSession
. The session may hold whatever
data and caches may be necessary for efficiently interfacing with the debug info.
All trait methods on a DebugSession
receive &mut self
, to allow mutation of internal cache
structures. Lifetimes of returned types are tied to this session's lifetime, which allows to
borrow data from the session.
Examples for things to compute when building a debug session are:
- Decompress debug information if it is stored with compression.
- Build a symbol map for random access to public symbols.
- Map string tables and other lookup tables.
- Read headers of compilation units (compilands) to resolve cross-unit references.
Associated Types
type Error
The error returned when reading debug information fails.
Required methods
fn functions(&self) -> Box<dyn Iterator<Item = Result<Function, Self::Error>>>
Returns an iterator over all functions in this debug file.
Functions are iterated in the order they are declared in their compilation units. The functions yielded by this iterator include all inlinees and line records resolved.
Note that the iterator holds a mutable borrow on the debug session, which allows it to use caches and optimize resources while resolving function and line information.
fn files(&self) -> Box<dyn Iterator<Item = Result<FileEntry, Self::Error>>>
Returns an iterator over all source files referenced by this debug file.
fn source_by_path(&self, path: &str) -> Result<Option<Cow<str>>, Self::Error>
Looks up a file's source contents by its full canonicalized path.
The given path must be canonicalized.
Implementors
impl<'_> DebugSession for ObjectDebugSession<'_>
[src]
type Error = ObjectError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <ObjectDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <ObjectDebugSession<'_> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <ObjectDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <ObjectDebugSession<'_> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <ObjectDebugSession<'_> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <ObjectDebugSession<'_> as DebugSession>::Error>
impl<'_> DebugSession for PdbDebugSession<'_>
[src]
type Error = PdbError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <PdbDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <PdbDebugSession<'_> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <PdbDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <PdbDebugSession<'_> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <PdbDebugSession<'_> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <PdbDebugSession<'_> as DebugSession>::Error>
impl<'_> DebugSession for PeDebugSession<'_>
[src]
type Error = PeError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <PeDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <PeDebugSession<'_> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <PeDebugSession<'_> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <PeDebugSession<'_> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <PeDebugSession<'_> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <PeDebugSession<'_> as DebugSession>::Error>
impl<'d> DebugSession for BreakpadDebugSession<'d>
[src]
type Error = BreakpadError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <BreakpadDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <BreakpadDebugSession<'d> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <BreakpadDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <BreakpadDebugSession<'d> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <BreakpadDebugSession<'d> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <BreakpadDebugSession<'d> as DebugSession>::Error>
impl<'d> DebugSession for DwarfDebugSession<'d>
[src]
type Error = DwarfError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <DwarfDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <DwarfDebugSession<'d> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <DwarfDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <DwarfDebugSession<'d> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <DwarfDebugSession<'d> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <DwarfDebugSession<'d> as DebugSession>::Error>
impl<'d> DebugSession for SourceBundleDebugSession<'d>
[src]
type Error = SourceBundleError
fn functions(
&self
) -> Box<dyn Iterator<Item = Result<Function, <SourceBundleDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<Function, <SourceBundleDebugSession<'d> as DebugSession>::Error>>>
fn files(
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <SourceBundleDebugSession<'d> as DebugSession>::Error>>>
[src]
&self
) -> Box<dyn Iterator<Item = Result<FileEntry, <SourceBundleDebugSession<'d> as DebugSession>::Error>>>
fn source_by_path(
&self,
path: &str
) -> Result<Option<Cow<str>>, <SourceBundleDebugSession<'d> as DebugSession>::Error>
[src]
&self,
path: &str
) -> Result<Option<Cow<str>>, <SourceBundleDebugSession<'d> as DebugSession>::Error>