Skip to content

fix(codegen): emit trace events to fix stack traces in debugger #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

bitwalker
Copy link
Contributor

This reinstates call frame tracking for debugging purposes, using a pair of trace events that we listen for in the debug executor in order to construct stack traces.

@bitwalker bitwalker requested a review from greenhat May 15, 2025 21:29
@bitwalker bitwalker added the codegen Issues or features related to lowering IR into MASM label May 15, 2025
@bitwalker bitwalker force-pushed the emit-trace-events branch from 7bd6db8 to 7e26456 Compare May 15, 2025 21:36
Copy link
Contributor

@greenhat greenhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just minor notes.

@@ -1,5 +1,6 @@
use core::ops::{Deref, DerefMut};

pub mod debug;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that I understand why it's public.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the other two modules, which we're wildcard re-exporting the contents of from the root, we only need to export the debug module and require fully-qualified paths instead to access its declarations.

@@ -0,0 +1,14 @@
#[link(wasm_import_module = "miden:core-import/[email protected]")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interface with the break function should be in our core-import WIT file at tests/rust-apps-wasm/rust-sdk/wit-sdk/miden-core-import.wit, otherwise wit-component errors on core module import. I'm in the middle of splitting our WIT files and moving them to SDK crates at #505, and I can take care of it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah noted, I'll leave the fix to you then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codegen Issues or features related to lowering IR into MASM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants