Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
11b3c44
Add debug variable location tracking to HIR and MASM
djolertrk Jan 9, 2026
49322ba
Align with latest debug_info in miden-vm
djolertrk Jan 16, 2026
e436125
fix: compute correct FMP offset for debug variable locations
djolertrk Jan 17, 2026
2410edc
Introduce Debug Info dialect
djolertrk Feb 3, 2026
908b223
fix: handle debug info ops in transforms and MASM codegen
djolertrk Feb 4, 2026
9e9a412
debuginfo: migrate DI types to DialectAttribute derive for v0.21.1 co…
djolertrk Mar 21, 2026
15c8d5b
feat: debug variable location tracking with dedup crash fix
djolertrk Mar 30, 2026
514874c
fix: rebase recovery — entity alignment
djolertrk Mar 31, 2026
76a80d7
fixup: several bugfixes for var loc
djolertrk Mar 31, 2026
2aed268
fixup: remove debug info docs
djolertrk Apr 1, 2026
9976990
fixup: debug var loc issues in frontend and codegen
djolertrk Apr 1, 2026
da188aa
fix: update lit tests for current HIR output and debugdump formats
djolertrk Apr 1, 2026
2cb06bb
fix: adapt debugdump to upstream Package.version API change
djolertrk Apr 1, 2026
d7c53fa
chore: fix formatting
djolertrk Apr 1, 2026
a78b834
fix: post-rebase cleanup for origin/next
djolertrk Apr 14, 2026
4a085f6
fix: register DebugValue as no-op in HIR evaluator
djolertrk Apr 14, 2026
a65e034
fix: skip debug info ops in liveness analysis
djolertrk Apr 14, 2026
2a2315c
fix: skip location schedule emission for undefined variables
djolertrk Apr 14, 2026
dd72f0e
fix: clippy for debug_info.rs
djolertrk Apr 14, 2026
8ca8c54
fix: preserve DWARF frame-base variables
djolertrk Apr 14, 2026
4b07c16
fix: run debugdump tests via litcheck
djolertrk Apr 28, 2026
6d112d1
fix: use released miden vm debug APIs
djolertrk Apr 29, 2026
f91d839
fixup: update tests
djolertrk Apr 29, 2026
7e6e6c2
fixup: improve debugdump help
djolertrk Apr 29, 2026
535185d
fix(debug): emit component core type metadata
djolertrk Apr 29, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ env/
*.out
node_modules/
*DS_Store
._*
*.iml
book/

# Ignore Cargo.lock in test projects
examples/**/Cargo.lock
tests/**/Cargo.lock
**/src/bindings.rs
*.lit_test_times.txt*
81 changes: 54 additions & 27 deletions Cargo.lock

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

19 changes: 2 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ inventory = "0.3"
litcheck = { package = "litcheck-core", version = "0.4" }
litcheck-filecheck = "0.4"
log = { version = "0.4", features = ["kv"] }
env_logger = "0.11"

# Miden Dependencies
miden-assembly = { version = "0.22", default-features = false }
Expand Down Expand Up @@ -140,6 +141,7 @@ midenc-dialect-arith = { version = "0.8.1", path = "dialects/arith" }
midenc-dialect-hir = { version = "0.8.1", path = "dialects/hir" }
midenc-dialect-scf = { version = "0.8.1", path = "dialects/scf" }
midenc-dialect-cf = { version = "0.8.1", path = "dialects/cf" }
midenc-dialect-debuginfo = { version = "0.8.1", path = "dialects/debuginfo" }
midenc-dialect-ub = { version = "0.8.1", path = "dialects/ub" }
midenc-dialect-wasm = { version = "0.8.1", path = "dialects/wasm" }
midenc-hir = { version = "0.8.1", path = "hir" }
Expand All @@ -159,23 +161,6 @@ miden-integration-tests = { path = "tests/integration" }
midenc-expect-test = { path = "tools/expect-test" }
miden-field = { version = "0.22" }

[patch.crates-io]
#miden-assembly = { git = "https://github.com/0xMiden/miden-vm", rev = "614cd7f9b52f45238b0ab59c71ebb49325051e5d" }
#miden-assembly = { path = "../miden-vm/assembly" }
#miden-assembly-syntax = { path = "../miden-vm/assembly-syntax" }
#miden-core = { git = "https://github.com/0xMiden/miden-vm", rev = "614cd7f9b52f45238b0ab59c71ebb49325051e5d" }
#miden-core = { path = "../miden-vm/core" }
# miden-client = { git = "https://github.com/0xMiden/miden-client", rev = "0a5add565d1388f77cd182f3639c16aa8f7ec674" }
# miden-debug = { git = "https://github.com/0xMiden/miden-debug", branch = "main" }
#miden-debug-types = { path = "../miden-vm/crates/debug/types" }
#miden-processor = { git = "https://github.com/0xMiden/miden-vm", rev = "614cd7f9b52f45238b0ab59c71ebb49325051e5d" }
#miden-processor = { path = "../miden-vm/processor" }
#miden-mast-package = { git = "https://github.com/0xMiden/miden-vm", rev = "614cd7f9b52f45238b0ab59c71ebb49325051e5d" }
#miden-mast-package = { path = "../miden-vm/package" }
# miden-protocol = { git = "https://github.com/0xMiden/protocol", rev = "a53bbe2209f506df87876c8b9c9a1730214f456b" }
# miden-standards = { git = "https://github.com/0xMiden/protocol", rev = "a53bbe2209f506df87876c8b9c9a1730214f456b" }
# miden-tx = { tag = "v0.14.0-beta.4", git = "https://github.com/0xMiden/miden-base" }

[profile.dev]
lto = false
# Needed for 'inventory' to work
Expand Down
18 changes: 16 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,20 @@ args = [
"${MIDENC_BIN_DIR}",
]

[tasks.miden-debugdump]
category = "Build"
description = "Builds miden-debugdump and installs it to the bin folder"
command = "cargo"
args = [
"-Z",
"unstable-options",
"build",
"-p",
"miden-debugdump",
"--artifact-dir",
"${MIDENC_BIN_DIR}",
]

[tasks.miden-objtool]
category = "Build"
description = "Builds miden-objtool and installs it to the bin folder"
Expand Down Expand Up @@ -442,7 +456,7 @@ args = [
"${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/bin",
"${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/tests/lit",
]
dependencies = ["litcheck", "midenc", "cargo-miden", "hir-opt"]
dependencies = ["litcheck", "midenc", "cargo-miden", "hir-opt", "miden-debugdump"]

[tasks.lit]
category = "Test"
Expand All @@ -453,7 +467,7 @@ args = [
"lit",
"${@}",
]
dependencies = ["litcheck", "midenc", "cargo-miden", "hir-opt"]
dependencies = ["litcheck", "midenc", "cargo-miden", "hir-opt", "miden-debugdump"]


[tasks.litcheck]
Expand Down
1 change: 1 addition & 0 deletions codegen/masm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ midenc-hir.workspace = true
midenc-hir-analysis.workspace = true
midenc-dialect-arith.workspace = true
midenc-dialect-cf.workspace = true
midenc-dialect-debuginfo.workspace = true
midenc-dialect-hir.workspace = true
midenc-dialect-scf.workspace = true
midenc-dialect-ub.workspace = true
Expand Down
13 changes: 10 additions & 3 deletions codegen/masm/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,16 @@ impl BlockEmitter<'_> {
// operand stack space on operands that will never be used.
//self.drop_unused_operands_at(op);

let lowering = op.as_trait::<dyn HirLowering>().unwrap_or_else(|| {
panic!("illegal operation: no lowering has been defined for '{}'", op.name())
});
let Some(lowering) = op.as_trait::<dyn HirLowering>() else {
// Skip debug info ops that have no lowering (e.g. debuginfo.kill,
// debuginfo.declare) rather than panicking. These ops carry no
// semantic meaning for code generation.
if op.name().dialect().as_str() == "debuginfo" {
log::trace!(target: "codegen", "skipping debug info op with no lowering: {}", op.name());
return;
}
panic!("illegal operation: no lowering has been defined for '{}'", op.name());
};

// Schedule operands for this instruction
lowering
Expand Down
8 changes: 8 additions & 0 deletions codegen/masm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ pub mod masm {

use midenc_dialect_arith as arith;
use midenc_dialect_cf as cf;
use midenc_dialect_debuginfo as debuginfo;
use midenc_dialect_hir as hir;
use midenc_dialect_scf as scf;
use midenc_dialect_ub as ub;
Expand All @@ -46,6 +47,9 @@ pub use self::{
inventory::submit!(::midenc_hir::DialectRegistrationHookInfo::new::<builtin::BuiltinDialect>(
lower_builtin_ops
));
inventory::submit!(::midenc_hir::DialectRegistrationHookInfo::new::<debuginfo::DebugInfoDialect>(
lower_debuginfo_ops
));
inventory::submit!(::midenc_hir::DialectRegistrationHookInfo::new::<arith::ArithDialect>(
lower_arith_ops
));
Expand All @@ -71,6 +75,10 @@ fn lower_builtin_ops(info: &mut midenc_hir::DialectInfo) {
info.register_operation_trait::<builtin::GlobalSymbol, dyn HirLowering>();
}

fn lower_debuginfo_ops(info: &mut midenc_hir::DialectInfo) {
info.register_operation_trait::<debuginfo::DebugValue, dyn HirLowering>();
}

fn lower_arith_ops(info: &mut midenc_hir::DialectInfo) {
info.register_operation_trait::<arith::Constant, dyn HirLowering>();
info.register_operation_trait::<arith::Add, dyn HirLowering>();
Expand Down
Loading