[wasm] [debugger] First version of multithreaded debugging (#74820)
authorThays Grazia <thaystg@gmail.com>
Wed, 1 Feb 2023 23:20:33 +0000 (20:20 -0300)
committerGitHub <noreply@github.com>
Wed, 1 Feb 2023 23:20:33 +0000 (20:20 -0300)
commitac18cc941a4c611727d6d4d62d0413ff4fc8dcd1
tree9585b40c74266b94cd7ef21de83c8b26ee1366b0
parentd28e6ce879a8a9bb67fa2b43967b2adc88999828
[wasm] [debugger] First version of multithreaded debugging (#74820)

* First version of multithreaded debugging.

* Revert package-lock.json

* New line at package-lock.json

* Fix not used variable.

* Fix debugger on firefox.

* Rewrite code to avoid duplicated code.

* Fix where mono_init_debugger_agent_common is called.

* Remove whitespace.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* [wasm] Debugger tests: support running with multithreaded runtime

* Add runtime-wasm-dbgtests pipeline with debugger tests running on a multi-threaded runtime

* Add multi-threaded debugger tests to runtime-wasm

* fix yml

* Always run the new tests when the pipeline is invoked manually

* Pass through extra build args for wasm debugger tests

* Addressing @radical comments.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* addressing radical comments

* Fixing tests failures and adding a schema to run a test that will only run in a multithreaded environment.

* Adding support for run debugger-tests in a multithreaded runtime.

* Fix running debugger tests for multithreaded runtime, passing sessionId where it's necessary.

* Fix CI.

* Addressing @radical comments
Adding a test case.

* Update src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Dictionary with the scriptId also uses sessionId.

* Addressing @radical review.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Avoiding getting this error: Cannot transition thread 0x2a15360 from STATE_BLOCKING with DO_BLOCKING.
In the transport_send we don't save the thread context, we save it before the send function.

* Addressing @radical comments.

* Using more threads in unit test.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments, and trying to fix ci.

* Removing unnecessary changes.

* Export function used on mini-wasm-debugger.

* Fixing line number.

* Fix run tests on release.

* fix compilation for multithread runtime

* trying to fix multithread debugger tests on ci

* trying to fix debugger tests on ci

* disabling tests on multithreaded runtime

* Update eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml

Co-authored-by: Ankit Jain <radical@gmail.com>
* Throwing an exception if the "what" is not the one that is being get from the nextNotificationQueue.

---------

Co-authored-by: Ankit Jain <radical@gmail.com>
31 files changed:
eng/pipelines/common/templates/wasm-debugger-tests.yml
eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml
eng/pipelines/runtime-wasm-dbgtests.yml [new file with mode: 0644]
src/mono/mono/component/debugger-agent.c
src/mono/mono/component/mini-wasm-debugger.c
src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs
src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxMonoProxy.cs
src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
src/mono/wasm/debugger/DebuggerTestSuite/AsyncTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestBase.cs
src/mono/wasm/debugger/DebuggerTestSuite/EnvironmentVariables.cs
src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests2.cs
src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs
src/mono/wasm/debugger/DebuggerTestSuite/Inspector.cs
src/mono/wasm/debugger/DebuggerTestSuite/InspectorClient.cs
src/mono/wasm/debugger/DebuggerTestSuite/MiscTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/SteppingTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessOptions.cs
src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessProxy.cs
src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs
src/mono/wasm/debugger/Wasm.Debugger.Tests/Wasm.Debugger.Tests.csproj
src/mono/wasm/debugger/tests/debugger-test/debugger-test.cs
src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj
src/mono/wasm/host/WebServerStartup.cs
src/mono/wasm/runtime/debug.ts
src/mono/wasm/runtime/dotnet-legacy.d.ts
src/mono/wasm/runtime/es6/dotnet.es6.lib.js
src/mono/wasm/runtime/exports-linker.ts
src/mono/wasm/runtime/rollup.config.js