0xPolygonMiden / miden-vm

STARK-based virtual machine
MIT License
621 stars 158 forks source link

Allow setting debug mode via CLI #1322

Closed hackaugusto closed 1 week ago

hackaugusto commented 5 months ago

Task

Add a flag to the run command which enables the assembler debug mode.

bobbinth commented 5 months ago

We already debug mode in CLI (see here). Or did you mean something else?

hackaugusto commented 5 months ago

Yeah, I was thinking of the run command and getting the debug.stack working for it.

bobbinth commented 4 months ago

Ah - I missed that this was specifically for the run command. Yes, I think adding something like --debug is a good idea (would be similar to --tracing flag that we already have).

yasonk commented 1 month ago

Would this --debug argument be passed into the command like this after building?

./target/optimized/miden run -a miden/examples/nprime/nprime.masm --debug

Why not just do this?

./target/optimized/miden debug -a miden/examples/nprime/nprime.masm

This seems to already support debug.stack An example would help potentially.

bobbinth commented 1 month ago

Would this --debug argument be passed into the command like this after building?

./target/optimized/miden run -a miden/examples/nprime/nprime.masm --debug

Yes, that's how I was thinking it would work.

Why not just do this?

./target/optimized/miden debug -a miden/examples/nprime/nprime.masm

This command would start an interactive debugger and then the user would be able to step through the execution. The two approaches are similar but the interactive debugger is quite a bit heavier and may not be needed in all cases.

bobbinth commented 1 week ago

Closed by #1502.