Enum debug_info::DebugSymbols
source · pub enum DebugSymbols {
Unloaded(WeakFileRef),
Loaded(DebugSections),
}
Expand description
An enum describing the possible forms of debug information for a crate.
Variants§
Unloaded(WeakFileRef)
Debug information that hasn’t yet been parsed from the given file. We use a weak reference to the file because it’s not mandatory to have debug symbols.
Loaded(DebugSections)
The debug information has already been parsed from the file
Implementations§
source§impl DebugSymbols
impl DebugSymbols
sourcepub fn load(
&mut self,
loaded_crate: &StrongCrateRef,
namespace: &CrateNamespace
) -> Result<&DebugSections, &'static str>
pub fn load( &mut self, loaded_crate: &StrongCrateRef, namespace: &CrateNamespace ) -> Result<&DebugSections, &'static str>
Loads the debug symbols from the enclosed weak file reference
that correspond to the given LoadedCrate
and using symbols from the given CrateNamespace
.
If these DebugSymbols
are already loaded, this is a no-op and simply returns those loaded DebugSections
.
sourcepub fn get_loaded(&self) -> Option<&DebugSections>
pub fn get_loaded(&self) -> Option<&DebugSections>
A convenience method for accessing the already-loaded DebugSections
within.
Returns None
if the symbols are not currently loaded.
sourcepub fn unload(&mut self) -> Option<DebugSections>
pub fn unload(&mut self) -> Option<DebugSections>
Unloads these DebugSymbols
, returning the enclosed DebugSections
if they were already loaded.
If not, this is a no-op and returns None
.
This is useful to free the large memory regions needed for debug information, and also to release dependencies on other crates’ sections.