-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[WASM] Node Debugger #56473
Closed
Closed
[WASM] Node Debugger #56473
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to previous polyfill
… and use it for the node tests
The test failures in this PR are caused by the changes brought over from the Node PR. Once they are resolved there, I will merge into here and this PR should (hopefully) be green. |
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
ghost
closed this
Oct 9, 2021
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
ghost
locked as resolved and limited conversation to collaborators
Nov 8, 2021
This pull request was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pending PR #54640 to be merged first after which this one will need to be rebased to extract out the debugger specific changes
This PR adds NodeJS debugging support to the WASM debugger as well as loosely laying a template for the upcoming V8 debugging support.
How does it work
This works the exact same was as the pre-exiting browser debugging with a few minor modifications to implementation details such as how the C# files are loaded into the DevTools Sources tab.
How to use
build mono+libs -os Browser -configuration Debug /p:ForNode=true
AppBundle
folder viadotnet publish /p:TargetArchitecture=wasm /p:TargetOS=Browser src/mono/sample/wasm/console/Wasm.Console.Sample.csproj -c Debug /p:ForNode=true
.node --inspect runtime.js --run Wasm.Console.Sample.dll
.--inspect-brk
ineatd of--inspect
to automatically break on the first line of js.chrome --remote-debugging-port=9222 http://localhost:8000/
.cd src\mono\wasm\debugger\BrowserDebugHost
anddotnet run
.http://localhost:9222/devtools/inspector.html?ws=127.0.0.1:[PORT THAT BROWSERDEBUGHOST PRINTED]/devtools/node/[EVERYTHING AFTER THE LAST SLASH THAT NODE PRINTED]
in the newly opened chrome instance.Open questions
Runtime.evaluate
to call JS from C# and dotnet.js is modularized on node, the evaluated commands are using theglobalThis
namespace whereMONO
is not defined. So I needed to add it toglobalThis
. Is there some way to expose MONO without adding toglobalThis
?Also, special thanks to @thaystg for helping me with this PR.