pub struct BreakpointStore { /* private fields */ }Expand description
Thread-safe breakpoint storage
Stores breakpoints indexed by source file path. Provides methods for setting, clearing, and retrieving breakpoints with REPLACE semantics.
Implementations§
Source§impl BreakpointStore
impl BreakpointStore
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty breakpoint store
§Examples
use perl_dap::breakpoints::BreakpointStore;
let store = BreakpointStore::new();Sourcepub fn set_breakpoints(&self, args: &SetBreakpointsArguments) -> Vec<Breakpoint>
pub fn set_breakpoints(&self, args: &SetBreakpointsArguments) -> Vec<Breakpoint>
Set breakpoints for a source file (REPLACE semantics)
This method clears all existing breakpoints for the source file and sets the new breakpoints from the request. Each breakpoint is assigned a unique ID and verified status.
§Arguments
args- SetBreakpoints request arguments containing source and breakpoint list
§Returns
Array of verified breakpoints in SAME ORDER as the request.
§Examples
use perl_dap::breakpoints::BreakpointStore;
use perl_dap::protocol::{SetBreakpointsArguments, Source, SourceBreakpoint};
let store = BreakpointStore::new();
let args = SetBreakpointsArguments {
source: Source {
path: Some("/workspace/script.pl".to_string()),
name: Some("script.pl".to_string()),
},
breakpoints: Some(vec![
SourceBreakpoint { line: 10, column: None, condition: None, hit_condition: None, log_message: None },
SourceBreakpoint { line: 25, column: None, condition: None, hit_condition: None, log_message: None },
]),
source_modified: None,
};
let breakpoints = store.set_breakpoints(&args);
assert_eq!(breakpoints.len(), 2);Sourcepub fn get_breakpoints(&self, source_path: &str) -> Vec<BreakpointRecord>
pub fn get_breakpoints(&self, source_path: &str) -> Vec<BreakpointRecord>
Sourcepub fn clear_breakpoints(&self, source_path: &str)
pub fn clear_breakpoints(&self, source_path: &str)
Sourcepub fn get_breakpoint_by_id(&self, id: i64) -> Option<BreakpointRecord>
pub fn get_breakpoint_by_id(&self, id: i64) -> Option<BreakpointRecord>
Sourcepub fn register_breakpoint_hit(
&self,
source_path: &str,
line: i64,
) -> BreakpointHitOutcome
pub fn register_breakpoint_hit( &self, source_path: &str, line: i64, ) -> BreakpointHitOutcome
Register a runtime breakpoint hit and return stop/logpoint behavior.
This method updates per-breakpoint hit counters and evaluates DAP hit conditions. For logpoints, execution continues after emitting output.
Sourcepub fn register_breakpoint_hit_with_variables(
&self,
source_path: &str,
line: i64,
variables: Option<&HashMap<String, String>>,
) -> BreakpointHitOutcome
pub fn register_breakpoint_hit_with_variables( &self, source_path: &str, line: i64, variables: Option<&HashMap<String, String>>, ) -> BreakpointHitOutcome
Register a breakpoint hit with optional variable interpolation.
Similar to register_breakpoint_hit, but accepts optional variable values
for logpoint message interpolation. If variables are provided, logpoint
messages with {$variable} expressions will be interpolated.
§Arguments
source_path- Path to the source fileline- Line number where the breakpoint was hit (1-based)variables- Optional map of variable names to their string values
§Returns
BreakpointHitOutcome with interpolated log messages if variables provided
Sourcepub fn adjust_breakpoints_for_edit(
&self,
source_path: &str,
start_line: i64,
lines_delta: i64,
)
pub fn adjust_breakpoints_for_edit( &self, source_path: &str, start_line: i64, lines_delta: i64, )
AC7.4: Adjust breakpoints for a file edit
This method shifts breakpoint lines based on content changes. It provides <1ms performance by avoiding full AST re-parsing.
§Arguments
source_path- Path to the modified filestart_line- Line where the edit started (1-based)lines_delta- Number of lines added (positive) or removed (negative)
Trait Implementations§
Source§impl Clone for BreakpointStore
impl Clone for BreakpointStore
Source§fn clone(&self) -> BreakpointStore
fn clone(&self) -> BreakpointStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more