Skip to content

pulley: Add simple debugging support#9796

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:pulley-debug
Dec 11, 2024
Merged

pulley: Add simple debugging support#9796
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:pulley-debug

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This commit adds a debug.rs to Pulley to print out the instruction being executed and the state of all registers between instructions. This is turned off by default and does not have a runtime or environment-based configuration value. Instead changing this requires changing source code for now. This enables the interpreter loop to unconditionally use this "debugger" where it'll compile away to nothing in release/benchmarking situations.

This commit additionally adds this support to the tail_loop module and fixes a few issues there such as it accidentally not being tested in CI as well as a new #[cfg] to use it on stable rust with normal return under the assumption that LLVM is highly likely to do TCO.

This commit adds a `debug.rs` to Pulley to print out the instruction
being executed and the state of all registers between instructions. This
is turned off by default and does not have a runtime or
environment-based configuration value. Instead changing this requires
changing source code for now. This enables the interpreter loop to
unconditionally use this "debugger" where it'll compile away to nothing
in release/benchmarking situations.

This commit additionally adds this support to the `tail_loop` module and
fixes a few issues there such as it accidentally not being tested in CI
as well as a new `#[cfg]` to use it on stable rust with normal `return`
under the assumption that LLVM is highly likely to do TCO.
@alexcrichton alexcrichton requested a review from a team as a code owner December 11, 2024 22:50
@alexcrichton alexcrichton requested review from abrown and removed request for a team December 11, 2024 22:50
@alexcrichton alexcrichton mentioned this pull request Dec 11, 2024
13 tasks
@alexcrichton alexcrichton added this pull request to the merge queue Dec 11, 2024
Merged via the queue into bytecodealliance:main with commit c2fa817 Dec 11, 2024
@alexcrichton alexcrichton deleted the pulley-debug branch December 11, 2024 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants