Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 127 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ name = "miden-debug"
path = "src/main.rs"
test = false
bench = false
required-features = ["tui"]
required-features = ["std"]

[[example]]
name = "compile-masm"
Expand All @@ -50,6 +50,7 @@ required-features = ["std"]
[features]
default = ["tui", "dap"]
tui = ["std", "dep:crossterm", "dep:env_logger", "dep:ratatui", "dep:tui-input", "dep:signal-hook", "dep:syntect", "miden-debug-engine/tui"]
repl = ["std", "dep:env_logger", "dep:rustyline", "miden-debug-engine/tui"]
dap = ["dep:dap", "dep:socket2", "miden-debug-engine/dap"]
std = ["dep:glob", "clap/std", "clap/env", "compact_str/std", "miden-assembly-syntax/std", "miden-debug-engine/std"]
proptest = ["dep:proptest", "miden-debug-engine/proptest"]
Expand Down Expand Up @@ -97,6 +98,7 @@ syntect = { version = "5.2.0", optional = true, default-features = false, featur
thiserror = { package = "miden-thiserror", version = "1.0" }
toml = { version = "0.8", features = ["preserve_order"] }
tui-input = { version = "0.11", optional = true }
rustyline = { version = "15.0", optional = true }

socket2 = { version = "0.5", optional = true }
tokio = { version = "1.39.2", features = ["rt", "time", "macros", "rt-multi-thread"] }
Expand Down
11 changes: 10 additions & 1 deletion crates/engine/src/debug/breakpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pub enum BreakpointType {
StepTo(usize),
/// Break at the first cycle of the next instruction
Next,
/// Break at the next source line, or the next instruction if no source location is available.
NextLine,
/// Break when we exit the current call frame
Finish,
/// Break when any cycle corresponds to a source location whose file matches PATTERN
Expand Down Expand Up @@ -100,14 +102,21 @@ impl BreakpointType {

/// Returns true if this breakpoint is internal to the debugger (i.e. not creatable via :b)
pub fn is_internal(&self) -> bool {
matches!(self, BreakpointType::Next | BreakpointType::Step | BreakpointType::Finish)
matches!(
self,
BreakpointType::Next
| BreakpointType::NextLine
| BreakpointType::Step
| BreakpointType::Finish
)
}

/// Returns true if this breakpoint is removed upon being hit
pub fn is_one_shot(&self) -> bool {
matches!(
self,
BreakpointType::Next
| BreakpointType::NextLine
| BreakpointType::Finish
| BreakpointType::Step
| BreakpointType::StepN(_)
Expand Down
2 changes: 2 additions & 0 deletions crates/engine/src/debug/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod breakpoint;
mod memory;
mod native_ptr;
mod stacktrace;
mod variables;

pub use self::{
breakpoint::{Breakpoint, BreakpointType},
Expand All @@ -11,4 +12,5 @@ pub use self::{
CallFrame, CallStack, ControlFlowOp, CurrentFrame, OpDetail, ResolvedLocation, StackTrace,
StepInfo,
},
variables::{DebugVarSnapshot, DebugVarTracker, resolve_variable_value},
};
Loading