pub struct SourceBundle<'data> { /* private fields */ }
Expand description
A bundle of source code files.
To create a source bundle, see SourceBundleWriter
. For more information, see the module
level documentation.
Implementations§
Source§impl<'data> SourceBundle<'data>
impl<'data> SourceBundle<'data>
Sourcepub fn parse(
data: &'data [u8],
) -> Result<SourceBundle<'data>, SourceBundleError>
pub fn parse( data: &'data [u8], ) -> Result<SourceBundle<'data>, SourceBundleError>
Tries to parse a SourceBundle
from the given slice.
Sourcepub fn version(&self) -> SourceBundleVersion
pub fn version(&self) -> SourceBundleVersion
Returns the version of this source bundle format.
Sourcepub fn file_format(&self) -> FileFormat
pub fn file_format(&self) -> FileFormat
The container file format, which is always FileFormat::SourceBundle
.
Sourcepub fn code_id(&self) -> Option<CodeId>
pub fn code_id(&self) -> Option<CodeId>
The code identifier of this object.
This is only set if the source bundle was created from an ObjectLike
. It can also be set
in the SourceBundleWriter
by setting the "code_id"
attribute.
Sourcepub fn debug_id(&self) -> DebugId
pub fn debug_id(&self) -> DebugId
The code identifier of this object.
This is only set if the source bundle was created from an ObjectLike
. It can also be set
in the SourceBundleWriter
by setting the "debug_id"
attribute.
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The debug file name of this object.
This is only set if the source bundle was created from an ObjectLike
. It can also be set
in the SourceBundleWriter
by setting the "object_name"
attribute.
Sourcepub fn arch(&self) -> Arch
pub fn arch(&self) -> Arch
The CPU architecture of this object.
This is only set if the source bundle was created from an ObjectLike
. It can also be set
in the SourceBundleWriter
by setting the "arch"
attribute.
Sourcepub fn load_address(&self) -> u64
pub fn load_address(&self) -> u64
The address at which the image prefers to be loaded into memory.
Because source bundles do not contain this information is always 0
.
Sourcepub fn has_symbols(&self) -> bool
pub fn has_symbols(&self) -> bool
Determines whether this object exposes a public symbol table.
Source bundles never have symbols.
Sourcepub fn symbols(&self) -> SourceBundleSymbolIterator<'data>
pub fn symbols(&self) -> SourceBundleSymbolIterator<'data>
Returns an iterator over symbols in the public symbol table.
Sourcepub fn symbol_map(&self) -> SymbolMap<'data>
pub fn symbol_map(&self) -> SymbolMap<'data>
Returns an ordered map of symbols in the symbol table.
Sourcepub fn has_debug_info(&self) -> bool
pub fn has_debug_info(&self) -> bool
Determines whether this object contains debug information.
Source bundles never have debug info.
Sourcepub fn debug_session(
&self,
) -> Result<SourceBundleDebugSession<'data>, SourceBundleError>
pub fn debug_session( &self, ) -> Result<SourceBundleDebugSession<'data>, SourceBundleError>
Constructs a debugging session.
A debugging session loads certain information from the object file and creates caches for efficient access to various records in the debug information. Since this can be quite a costly process, try to reuse the debugging session as long as possible.
Sourcepub fn has_unwind_info(&self) -> bool
pub fn has_unwind_info(&self) -> bool
Determines whether this object contains stack unwinding information.
Sourcepub fn has_sources(&self) -> bool
pub fn has_sources(&self) -> bool
Determines whether this object contains embedded source.
Sourcepub fn is_malformed(&self) -> bool
pub fn is_malformed(&self) -> bool
Determines whether this object is malformed and was only partially parsed