Skip to content

Conversation

itowlson
Copy link
Contributor

Supersedes #219, on which it is based with a few tweaks / features / bug fixes (with @tschneidereit's involvement and consent).

@andreiltd
Copy link
Member

This is fantastic! Thank you @tschneidereit and @itowlson for all your hard work on this feature.

@tschneidereit tschneidereit requested a review from andreiltd July 11, 2025 21:30
@tschneidereit
Copy link
Member

@andreiltd thank you for your kind words!

Since Ivan and I both did meaningful parts of the work here, it'd be fantastic if you could do a proper review of the whole PR. I'll then do the work to address whatever feedback you'll have, and we can get this landed.

Copy link
Member

@andreiltd andreiltd left a comment

Choose a reason for hiding this comment

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

I left some comments. IIUC, the debugging server in its current form does not support multiple sessions. Is that correct? If so, we should probably explicitly raise an error when attempting to create parallel sessions?

@itowlson
Copy link
Contributor Author

IIUC, the debugging server in its current form does not support multiple sessions. Is that correct?

Yes, that's a limitation of the current implementation (I think @tschneidereit had plans for multi-component debugging, which we know we'll need, but wanted to get something out there in the meantime). I'll look at detecting and erroring.

tschneidereit and others added 11 commits July 22, 2025 10:07
This commit introduces a substantial new feature: debugging support via the [Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-protocol/).

While for now the debugger is experimental and not quite ready for production use, it already covers a decent amount of functionality: it supports breakpoints, single-stepping into and over function calls, stack and (local and global) scope inspection, and modifying locals and object properties.

Building on the platform support added in bytecodealliance#218, the extension has two key components:
1. a DAP implementation as a Node.js script that starts StarlingMonkey, starts a server for the debug session, and translates between the messages StarlingMonkey sends/receives and the DAP
2. a VS Code extension providing launch configurations and settings for the debugger, and initiates the debug session
Signed-off-by: itowlson <[email protected]>
@itowlson itowlson force-pushed the understand-debugger branch from 5347a94 to 4da734a Compare July 22, 2025 02:32
Copy link
Member

@andreiltd andreiltd left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@itowlson
Copy link
Contributor Author

itowlson commented Aug 7, 2025

We had an issue where the packaged extension was failing to activate because the source-map module wasn't getting included (due to it being compiled as an external). This is now fixed (at least it Works On My Machine). Thank you @karthik2804 for discovering the packaging issue!


**`ts` workspace:** `npm run compile`

**`spin-ts` workspace:** `spin build`
Copy link
Member

Choose a reason for hiding this comment

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

This (and the folder it refers to) would be good to remove before landing. I think that really boils down to removing this line and the folder, but there might be other things I'm missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tschneidereit Where would you suggest we keep tests for non-Wasmtime hosts? I think there's value in such tests existing. For myself, I'd find it useful for them to be present in this repo, even if not everybody is able to run all of them, but happy to move them off to the other hosts' host orgs if preferred. (Although if we did that it would still be useful to link them from here.)

Copy link
Member

Choose a reason for hiding this comment

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

Such tests should indeed exist, yes! Given that we'll want to do integration with the Spin SDK more generally, I think the tests should logically live there, though. Additionally, hosting downstream embedding-specific tests here would open a can of worms, where it's not clear which ones we'd accept here and which we wouldn't.

Copy link
Member

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

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

One small tweak remaining, then we should go ahead and land this! 🥳

@tschneidereit tschneidereit merged commit c413fa0 into bytecodealliance:main Aug 13, 2025
6 checks passed
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.

3 participants