pub struct HotpatchModuleCache {
pub lib: PathBuf,
pub symbols: SymbolTable,
pub aslr_reference: u64,
}Expand description
Pre-parsed snapshot of the original (== “fat”) binary. Built once per dev-server run; subsequent JumpTable construction reads from here without touching the disk again.
Fields§
§lib: PathBufOriginal binary path on the host. Useful in error messages.
symbols: SymbolTableAll symbols projected through parse_symbol_table_from_bytes.
aslr_reference: u64Static virtual address of whisker_aslr_anchor in the host
binary. Goes straight into
subsecond_types::JumpTable::aslr_reference. See module
docs for why this is the anchor symbol’s address rather than
the file’s image base, and why we use a dedicated anchor
rather than upstream subsecond’s main.
Implementations§
Source§impl HotpatchModuleCache
impl HotpatchModuleCache
Sourcepub fn from_path(path: impl Into<PathBuf>) -> Result<Self>
pub fn from_path(path: impl Into<PathBuf>) -> Result<Self>
Read the binary at path and capture everything we’ll need
for hot-patching. Errors out (rather than partially populating
the struct) on read / parse failure — there’s no useful cache
to keep around if the original binary is malformed.
Sourcepub fn symbol_count(&self) -> usize
pub fn symbol_count(&self) -> usize
Convenience accessor (saves the caller a cache.symbols.by_name
where they really just want a lookup).
Trait Implementations§
Source§impl Clone for HotpatchModuleCache
impl Clone for HotpatchModuleCache
Source§fn clone(&self) -> HotpatchModuleCache
fn clone(&self) -> HotpatchModuleCache
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more