[wasm] debug with modularized runtime(s) (#61848)
authorPavel Savara <pavelsavara@microsoft.com>
Thu, 25 Nov 2021 14:19:28 +0000 (15:19 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Nov 2021 14:19:28 +0000 (15:19 +0100)
commitc9ea14c76af4a396926b9f4d19f23641797edccd
tree753eef397315e17705d2be167e223788b33d92e8
parent337cb2f6861e0145eea5643b930b2810107f7095
[wasm] debug with modularized runtime(s) (#61848)

* New globalThis.getDotnetRuntime method, which takes runtimeId, essentially index of the runtime on the page. It returns the DotNetPublicAPI object of the instance {MONO, BINDING, Module, RuntimeId, RuntimeBuildInfo }.
* Change the debugger to use the getDotnetRuntime() function when talking to the runtime on the page via CDP.
* Use getDotnetRuntime() in unit tests, with runtimeId is zero as there is only one runtime in tests.
* We add optional &runtimeId=0 to the initial URL which opens DebuggerProxy, so that MonoProxy could be created for specific runtime on the page.
* Moved mono_wasm_add_dbg_command_received, mono_wasm_debugger_log and mono_wasm_trace_logger out of C macro into typescript
* Introduced RuntimeBuildInfo: { ProductVersion, Configuration } into DotNetPublicAPI
22 files changed:
src/mono/mono/component/mini-wasm-debugger.c
src/mono/wasm/debugger/BrowserDebugHost/Startup.cs
src/mono/wasm/debugger/BrowserDebugProxy/DebuggerProxy.cs
src/mono/wasm/debugger/BrowserDebugProxy/DevToolsHelper.cs
src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs
src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html
src/mono/wasm/runtime/debug.ts
src/mono/wasm/runtime/driver.c
src/mono/wasm/runtime/export-types.ts
src/mono/wasm/runtime/exports.ts
src/mono/wasm/runtime/gc-handles.ts
src/mono/wasm/runtime/library-dotnet.js
src/mono/wasm/runtime/package-lock.json
src/mono/wasm/runtime/package.json
src/mono/wasm/runtime/rollup.config.js
src/mono/wasm/runtime/startup.ts
src/mono/wasm/runtime/types/consts.d.ts [new file with mode: 0644]
src/mono/wasm/runtime/weak-ref.ts [new file with mode: 0644]
src/mono/wasm/wasm.proj