[wasm][debugger] Add support for deref'ing pointers (#19760)
commit1da3a20c8b10f67d521a37ac1c2a32dc604ec484
authorAnkit Jain <radical@gmail.com>
Tue, 7 Jul 2020 17:39:12 +0000 (7 13:39 -0400)
committerGitHub <noreply@github.com>
Tue, 7 Jul 2020 17:39:12 +0000 (7 13:39 -0400)
treee6f80c83b93ad1a7c29483c2b58e9a3edb287a8b
parent618cdf6ff78f6b8f8b519a1b6988f57682f87a76
[wasm][debugger] Add support for deref'ing pointers (#19760)

* [wasm][debugger] Send var names also, to `mono_wasm_get_variables`

- this will be useful in upcoming commits, which will need to use the
names for local pointer vars

* [wasm][debugger] Add support for deref'ing pointers

* [wasm][debugger] Dereference the pointer in js, instead of debugger.c

Based on suggestion from @vargaz

* [wasm][debugger][tests] Fix setting async methods when setting

.. breakpoint by method name. Async methods themselves don't have the
debug information. Instead, that can be found on the generated async
implementation type/method. Here, we just look for a type name
starting with `{original_type_name}/<{async_method_name}>`, and use the
method `MoveNext` from that.

* [wasm][debugger][tests] Update to set bp by method name+lineoffset

* Address review comments from Katelyn Gadd (@kg)

* Add test to check deref'ing invalid pointers

- We should really be handling invalid object ids, and report errors for
those, where appropriate. This will be done in a future PR
- For this PR, I'm adding tests that just check that invalid objects, or
trying to deref regular objects, doesn't blow up

* Remove old unused test code

* [wasm][debugger] Use JsonConvert instead of manually building the json string

- addresses review comment from @lewing
mono/mini/mini-wasm-debugger.c
sdks/wasm/DebuggerTestSuite/PointerTests.cs [new file with mode: 0644]
sdks/wasm/DebuggerTestSuite/Support.cs
sdks/wasm/DebuggerTestSuite/Tests.cs
sdks/wasm/Mono.WebAssembly.DebuggerProxy/DebugStore.cs
sdks/wasm/Mono.WebAssembly.DebuggerProxy/DevToolsHelper.cs
sdks/wasm/Mono.WebAssembly.DebuggerProxy/MonoProxy.cs
sdks/wasm/src/library_mono.js
sdks/wasm/tests/debugger/debugger-pointers-test.cs [new file with mode: 0644]
sdks/wasm/tests/debugger/debugger-test.cs