Skip to content
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] allow the debug proxy to startup on a fixed port #65209

Closed
lewing opened this issue Feb 11, 2022 · 1 comment · Fixed by #65752
Closed

[wasm] allow the debug proxy to startup on a fixed port #65209

lewing opened this issue Feb 11, 2022 · 1 comment · Fixed by #65752
Assignees
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Milestone

Comments

@lewing
Copy link
Member

lewing commented Feb 11, 2022

For some development cases it would be preferable for the debug proxy to be able to start on fixed port, we should enable a mechanism to override the current dynamic port logic

@lewing lewing added arch-wasm WebAssembly architecture area-Debugger-mono labels Feb 11, 2022
@lewing lewing added this to the 7.0.0 milestone Feb 11, 2022
@ghost
Copy link

ghost commented Feb 11, 2022

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

For some development cases it would be preferable for the debug proxy to be able to start on fixed port, we should enable a mechanism to override the current dynamic port logic

Author: lewing
Assignees: thaystg
Labels:

arch-wasm, area-Debugger-mono

Milestone: 7.0.0

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Feb 11, 2022
@lewing lewing removed the untriaged New issue has not been triaged by the area owner label Feb 11, 2022
radical added a commit to radical/runtime that referenced this issue Feb 22, 2022
radical added a commit to radical/runtime that referenced this issue Feb 23, 2022
radical added a commit that referenced this issue Feb 24, 2022
* [wasm][debugger] Fail test if an assertion is detected

* [wasm][debugger] Make DevToolsProxy's `pending_ops` thread-safe

Currently, `pending_ops` can get written by different threads at the
same time, and also read in parallel. This causes tests to randomly fail
with:

```
DevToolsProxy::Run: Exception System.ArgumentException: The tasks argument included a null value. (Parameter 'tasks')
    at System.Threading.Tasks.Task.WhenAny(Task[] tasks)
    at Microsoft.WebAssembly.Diagnostics.DevToolsProxy.Run(Uri browserUri, WebSocket ideSocket) in /_/src/mono/wasm/debugger/BrowserDebugProxy/DevToolsProxy.cs:line 269
```

Instead, we use `Channel<T>` to add the ops, and then read those in
the main loop, and add to the *local* `pending_ops` list.

* [wasm] Install chrome for debugger tests

- controlled by `$(InstallChromeForDebuggerTests)` which defaults to
`true` for non-CI docker containers
- Useful for using the correct chrome version when testing locally, or
on codespaces

- Also, add support for detecting, and defaulting to such an
installation

* [wasm][debugger] Disable tests failing with runtime assertions

`DebuggerTests.EvaluateOnCallFrameTests.EvaluateSimpleMethodCallsError`: #65744
`DebuggerTests.ArrayTests.InvalidArrayId`: #65742

* [wasm][debugger] Fix NRE with `"null"` condition for a breakpoint

`ConditionalBreakpoint` test fails.
The test with condition=`"null"` failed with a NRE, instead of correctly
handling it as a condition that returns null.

```
Unable evaluate conditional breakpoint: System.Exception: Internal Error: Unable to run (null ),
    error: Object reference not set to an instance of an object..
    ---> System.NullReferenceException: Object reference not set to an instance of an object.
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 399
            --- End of inner exception stack trace ---
            at Microsoft.WebAssembly.Diagnostics.EvaluateExpression.CompileAndRunTheExpression(String expression, MemberReferenceResolver resolver, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs:line 407
            at Microsoft.WebAssembly.Diagnostics.MonoProxy.EvaluateCondition(SessionId sessionId, ExecutionContext context, Frame mono_frame, Breakpoint bp, CancellationToken token) in /workspaces/runtime/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs:line 801 condition:null
```

* [wasm] Improve default message for ReturnAsErrorException,

.. since we seem to be not catching them as intended in many places.

* [wasm] Better log, and surface errors in evaluation conditional

.. breakpoints.
Catch the proper exception `ReturnAsErrorException`, so we can get the
actual error message. And log that as an error for the user too.

* [wasm][debugger] Allow setting proxy port for BrowserDebugHost

.. with `--proxy-port=<port>`.

Fixes #65209 .

* [wasm][debugger] Handle errors in getting value for locals

Essentially, catch, and skip.

* message cleanup

* remove trailing space
@ghost ghost locked as resolved and limited conversation to collaborators Mar 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-Debugger-mono
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants