pub struct Debugger {
pub file: String,
/* private fields */
}Expand description
Debugger state, shared between VM and interpreter.
Fields§
§file: StringCurrent source file name.
Implementations§
Source§impl Debugger
impl Debugger
pub fn new() -> Self
Sourcepub fn add_breakpoint_line(&mut self, line: usize)
pub fn add_breakpoint_line(&mut self, line: usize)
Add a line breakpoint programmatically (used by the DAP server before
the VM starts). TTY users add via the b N command.
Sourcepub fn add_breakpoint_sub(&mut self, name: &str)
pub fn add_breakpoint_sub(&mut self, name: &str)
Add a function breakpoint programmatically.
Sourcepub fn clear_line_breakpoints(&mut self)
pub fn clear_line_breakpoints(&mut self)
Clear every line breakpoint (the DAP server re-sends the full set on
every setBreakpoints request).
Sourcepub fn set_line_breakpoints(&mut self, lines: &[usize])
pub fn set_line_breakpoints(&mut self, lines: &[usize])
Replace the entire line-breakpoint set in one shot.
Sourcepub fn set_step_mode(&mut self, on: bool)
pub fn set_step_mode(&mut self, on: bool)
Toggle step-mode (controls whether should_stop returns true on every
new line). The DAP server flips this in response to next / stepIn.
Sourcepub fn request_step_over(&mut self)
pub fn request_step_over(&mut self)
Request a step-over from the next stop.
Sourcepub fn request_step_out(&mut self)
pub fn request_step_out(&mut self)
Request a step-out from the next stop.
Sourcepub fn set_dap_backend(
&mut self,
shared: Arc<DapShared>,
bp_state: Arc<Mutex<BreakpointState>>,
)
pub fn set_dap_backend( &mut self, shared: Arc<DapShared>, bp_state: Arc<Mutex<BreakpointState>>, )
Install a DAP backend. After this call, prompt() will route through
the DAP server instead of TTY.
Sourcepub fn breakpoint_lines(&self) -> Vec<usize>
pub fn breakpoint_lines(&self) -> Vec<usize>
Snapshot helper: current breakpoint lines, sorted.
Sourcepub fn load_source(&mut self, source: &str)
pub fn load_source(&mut self, source: &str)
Load source for display in debugger.
Sourcepub fn should_stop(&mut self, line: usize) -> bool
pub fn should_stop(&mut self, line: usize) -> bool
Check if debugger should stop at this line.
Sourcepub fn should_stop_at_sub(&self, name: &str) -> bool
pub fn should_stop_at_sub(&self, name: &str) -> bool
Check if we should stop at subroutine entry.
Sourcepub fn prompt(
&mut self,
line: usize,
scope: &Scope,
call_stack: &[(String, usize)],
) -> DebugAction
pub fn prompt( &mut self, line: usize, scope: &Scope, call_stack: &[(String, usize)], ) -> DebugAction
Interactive debugger prompt. Returns true to continue, false to quit.
Two paths:
- DAP — emit a
stoppedevent with a snapshot, condvar-wait for the next resume command, apply step-mode flags from the shared breakpoint state, and return. - TTY — original
perl -d-style REPL on stdin/stderr.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Debugger
impl RefUnwindSafe for Debugger
impl Send for Debugger
impl Sync for Debugger
impl Unpin for Debugger
impl UnsafeUnpin for Debugger
impl UnwindSafe for Debugger
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.