Skip to content

Conversation

@djolertrk
Copy link
Collaborator

Track variable locations at HIR and MASM levels.
Add DebugVar decorator and new debug_info section in the final .masp.

Also, add miden-debugdump tool to dump .debug_info section, so we can explore the custom section from the package.

vm part: 0xMiden/miden-vm#2471

@djolertrk djolertrk marked this pull request as draft December 15, 2025 07:35
@djolertrk
Copy link
Collaborator Author

Goes on top of #812.

@djolertrk
Copy link
Collaborator Author

cc @greenhat @bitwalker

@djolertrk djolertrk changed the title Track variable locations clean Track variable locations Dec 15, 2025
@djolertrk djolertrk force-pushed the feature/debug-variable-locations-clean branch 3 times, most recently from 69877ae to a4ccd95 Compare January 9, 2026 17:27
@djolertrk djolertrk marked this pull request as ready for review January 9, 2026 17:28
@djolertrk
Copy link
Collaborator Author

It depends on the types and debug decorator defined in 0xMiden/miden-vm#2471.

@bitwalker bitwalker added the blocker This issue is one of our top priorities label Jan 9, 2026
@bitwalker
Copy link
Collaborator

I've done an initial review of the miden-vm PR, and I expect we can get that merged ASAP once all the review feedback is addressed.

This commit adds debug information support for tracking
variable locations through the compilation pipeline:

- Add debug info representation on HIR level (builtin.dbg_value ops,
  DIExpression, DILocalVariable attributes)
- Handle DebugVars during lowering from HIR to MASM
- Add DebugInfoBuilder for constructing debug metadata
- Add RemoveDeadDebugOps pass to clean up debug ops with dead operands
- Add miden-debugdump tool for inspecting .debug_info sections in MASP
  packages (similar to llvm-dwarfdump)
- Add documentation for the debug info format (docs/DebugInfoFormat.md,
  docs/DebugInfoMetadata.md)
- Add lit tests for debug functionality

Run tests:
$ litcheck lit run --verbose tests/lit/debugdump
$ litcheck lit run --path bin ./tests/lit/debug/
@djolertrk djolertrk force-pushed the feature/debug-variable-locations-clean branch from a4ccd95 to 885283c Compare January 10, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocker This issue is one of our top priorities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants