pub struct Session { /* private fields */ }Expand description
A running local one-worker Core check and its stop-scoped inspection capability.
use dive_api::{CheckRequest, debug::{Session, Event}};
let mut session = Session::launch(CheckRequest { file:"Spec.tla".into(), ..Default::default() }, false)?;
session.wait_event(std::time::Duration::from_secs(10))?;
session.configuration_done()?;
while let Some(event) = session.wait_event(std::time::Duration::from_secs(10))? {
if matches!(event, Event::Completed(_)) { break; }
}
let report = session.finish()?;Implementations§
Source§impl Session
impl Session
Sourcepub fn launch(
request: CheckRequest,
stop_on_entry: bool,
) -> Result<Self, DebugError>
pub fn launch( request: CheckRequest, stop_on_entry: bool, ) -> Result<Self, DebugError>
Starts loading/compiling with existing checking APIs. Search waits for configuration. The report retains the requested worker width; observed search uses one actual worker.
§Errors
An unsupported managed-session combination or failed thread creation.
Sourcepub fn wait_event(&self, timeout: Duration) -> Result<Option<Event>, DebugError>
pub fn wait_event(&self, timeout: Duration) -> Result<Option<Event>, DebugError>
Waits at most the given duration for a real producer event.
§Errors
A wait above one minute is rejected.
Sourcepub fn set_breakpoints(
&self,
path: &str,
lines: &[u32],
) -> Result<Vec<Breakpoint>, DebugError>
pub fn set_breakpoints( &self, path: &str, lines: &[u32], ) -> Result<Vec<Breakpoint>, DebugError>
Installs exact-line source breakpoints using only already-loaded sources.
§Errors
Unknown source, invalid/capacity line request or unavailable compilation.
Sourcepub fn break_on_entry(&self, enabled: bool) -> Result<(), DebugError>
pub fn break_on_entry(&self, enabled: bool) -> Result<(), DebugError>
Configures an entry stop before the pending producer search starts.
§Errors
Search has started or the session is unavailable.
Sourcepub fn configuration_done(&self) -> Result<(), DebugError>
pub fn configuration_done(&self) -> Result<(), DebugError>
Starts actual search after breakpoint/configuration requests.
§Errors
Compilation is unavailable or the session has terminated.
Sourcepub fn exception_breakpoints(&self, enabled: bool) -> Result<(), DebugError>
pub fn exception_breakpoints(&self, enabled: bool) -> Result<(), DebugError>
Selects actual evaluation-error/property-failure stops.
§Errors
The compiled session is unavailable or complete.
Sourcepub fn pause(&self) -> Result<(), DebugError>
pub fn pause(&self) -> Result<(), DebugError>
Sourcepub fn continue_check(&self) -> Result<(), DebugError>
pub fn continue_check(&self) -> Result<(), DebugError>
Sourcepub fn step_in(&self) -> Result<(), DebugError>
pub fn step_in(&self) -> Result<(), DebugError>
Stops at the next mapped instruction, including nested evaluation.
§Errors
The producer is not stopped.
Sourcepub fn next(&self) -> Result<(), DebugError>
pub fn next(&self) -> Result<(), DebugError>
Sourcepub fn step_out(&self) -> Result<(), DebugError>
pub fn step_out(&self) -> Result<(), DebugError>
Sourcepub fn scopes(&self, frame: u64) -> Result<Vec<Value>, DebugError>
pub fn scopes(&self, frame: u64) -> Result<Vec<Value>, DebugError>
Returns state, successor and local scope handles for a current frame.
§Errors
The frame handle is stale/unknown or the producer is running.
Sourcepub fn variables(&self, reference: u64) -> Result<Vec<Value>, DebugError>
pub fn variables(&self, reference: u64) -> Result<Vec<Value>, DebugError>
Reads a current scope’s captured values without evaluating source.
§Errors
The scope handle is stale/unknown or the producer is running.
Sourcepub fn evaluate(
&self,
frame: u64,
expression: &str,
) -> Result<Value, DebugError>
pub fn evaluate( &self, frame: u64, expression: &str, ) -> Result<Value, DebugError>
Evaluates bounded integer/boolean arithmetic in a fresh compiler/machine over captured scalars. No producer recipe or source helper is executed.
§Errors
A stale frame, unavailable operand, unsupported syntax or work bound.
Sourcepub fn source(&self, reference: usize) -> Result<String, DebugError>
pub fn source(&self, reference: usize) -> Result<String, DebugError>
Returns only a source already loaded by this session, without opening a path.
§Errors
The loaded-source reference is invalid or unavailable.
Sourcepub fn finish(&mut self) -> Result<CheckReport, DebugError>
pub fn finish(&mut self) -> Result<CheckReport, DebugError>
Joins the existing checker and returns its ordinary typed report.
§Errors
A host failure or repeated finish request.