pub struct JitRuntime<L>{ /* private fields */ }Expand description
Uses a lifting callback so this crate does not depend on a specific guest architecture crate.
Implementations§
Source§impl<L> JitRuntime<L>
impl<L> JitRuntime<L>
Sourcepub fn new(
program: ProgramImage,
lift_region: L,
) -> Result<Self, Box<dyn Error>>
pub fn new( program: ProgramImage, lift_region: L, ) -> Result<Self, Box<dyn Error>>
Creates a runtime with default guest-process settings and the local output directory.
Sourcepub fn init_runtime(
program: ProgramImage,
process: RemuConfig,
jit_output_dir: PathBuf,
lift_region: L,
) -> Result<Self, Box<dyn Error>>
pub fn init_runtime( program: ProgramImage, process: RemuConfig, jit_output_dir: PathBuf, lift_region: L, ) -> Result<Self, Box<dyn Error>>
Maps the program and optional interpreter, then builds Linux process startup state.
Sourcepub fn program(&self) -> &ProgramImage
pub fn program(&self) -> &ProgramImage
Borrows parsed program data without giving permission to change runtime mappings.
Sourcepub fn state(&self) -> &GuestState
pub fn state(&self) -> &GuestState
Borrows guest registers and stop data for inspection.
Sourcepub fn state_mut(&mut self) -> &mut GuestState
pub fn state_mut(&mut self) -> &mut GuestState
Gives controlled callers direct access to guest registers and the PC.
Sourcepub fn memory(&self) -> &GuestMemory
pub fn memory(&self) -> &GuestMemory
Borrows guest memory for reads and mapping inspection.
Sourcepub fn memory_mut(&mut self) -> &mut GuestMemory
pub fn memory_mut(&mut self) -> &mut GuestMemory
Borrows guest memory for changes and first refreshes its generated-code view.
Sourcepub fn set_entry_pc(&mut self, pc: u64)
pub fn set_entry_pc(&mut self, pc: u64)
Changes both reset entry and current execution entry to keep them consistent.
Sourcepub fn set_verbose(&mut self, verbose: bool)
pub fn set_verbose(&mut self, verbose: bool)
Enables compiler, dispatch, and syscall diagnostics for manual investigation.
Sourcepub fn process_config(&self) -> &RemuConfig
pub fn process_config(&self) -> &RemuConfig
Exposes the normalized roots and JIT options that this runtime uses.
Sourcepub fn pause_flag(&self) -> Arc<AtomicBool>
pub fn pause_flag(&self) -> Arc<AtomicBool>
Clones the shared pause handle so another thread can stop generated code safely.
Sourcepub fn add_breakpoint(&mut self, address: u64) -> Result<(), &'static str>
pub fn add_breakpoint(&mut self, address: u64) -> Result<(), &'static str>
Adds one guest block-entry address to the generated-code breakpoint table.
Sourcepub fn remove_breakpoint(&mut self, address: u64)
pub fn remove_breakpoint(&mut self, address: u64)
Removes all copies of an address and keeps the active prefix compact.
Sourcepub fn clear_breakpoints(&mut self)
pub fn clear_breakpoints(&mut self)
Hides all saved array values by setting the active count to zero.
Sourcepub fn breakpoints(&self) -> &[u64]
pub fn breakpoints(&self) -> &[u64]
Returns only the active sorted prefix, not unused fixed-array slots.
Sourcepub fn trace(&self) -> Vec<u64>
pub fn trace(&self) -> Vec<u64>
Returns the retained block-entry trace in execution order for debugger output.
Sourcepub fn last_syscall(&self) -> Option<[u64; 8]>
pub fn last_syscall(&self) -> Option<[u64; 8]>
Returns the last syscall register record for debugger and fuzzer diagnostics.
Sourcepub fn lift_at(&self, pc: u64) -> Result<Nnil, Box<dyn Error>>
pub fn lift_at(&self, pc: u64) -> Result<Nnil, Box<dyn Error>>
Runs the architecture callback without compiling or changing the JIT cache.
Sourcepub fn snapshot(&mut self) -> Result<RuntimeSnapshot, Box<dyn Error>>
pub fn snapshot(&mut self) -> Result<RuntimeSnapshot, Box<dyn Error>>
Captures guest-visible mutable state so one runtime can replay from this point.
Sourcepub fn restore(
&mut self,
snapshot: &RuntimeSnapshot,
) -> Result<(), Box<dyn Error>>
pub fn restore( &mut self, snapshot: &RuntimeSnapshot, ) -> Result<(), Box<dyn Error>>
Restores process data but keeps compiled native blocks for fast replay.
Sourcepub fn reset(&mut self) -> Result<(), Box<dyn Error>>
pub fn reset(&mut self) -> Result<(), Box<dyn Error>>
Restores the snapshot that was made after initial process setup.
Sourcepub fn precompile(&mut self) -> Result<usize, Box<dyn Error>>
pub fn precompile(&mut self) -> Result<usize, Box<dyn Error>>
Compiles a linear walk from the entry to reduce lazy JIT stops during startup.
Sourcepub fn run(&mut self) -> Result<ExitReason, Box<dyn Error>>
pub fn run(&mut self) -> Result<ExitReason, Box<dyn Error>>
Runs until the guest exits, faults, makes an unsupported call, or requests a stop.
Sourcepub fn run_for_blocks(
&mut self,
limit: u64,
) -> Result<ExitReason, Box<dyn Error>>
pub fn run_for_blocks( &mut self, limit: u64, ) -> Result<ExitReason, Box<dyn Error>>
Runs at most limit translated blocks so a debugger can step or stay responsive.