-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm] Misc Debugger improvements (including tests) (#65752)
* [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
- Loading branch information
Showing
13 changed files
with
207 additions
and
64 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project> | ||
<!-- Version number to revision number mapping from http://omahaproxy.appspot.com/ and find the closest one in | ||
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Linux_x64/ | ||
and https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Win_x64/ | ||
Eg. latest stable version is 96.0.4664.45 with revision 929512. | ||
but the closest one available in the snapshosts is 929513. | ||
Please make sure to check both platforms as sometime | ||
the same snapshot might not be available in one of them. | ||
--> | ||
<PropertyGroup Condition="'$(BrowserHost)' != 'windows'"> | ||
<ChromiumRevision>929513</ChromiumRevision> | ||
<ChromiumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chrome-linux.zip</ChromiumUrl> | ||
<ChromeDriverUrl>https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/$(ChromiumRevision)/chromedriver_linux64.zip</ChromeDriverUrl> | ||
<ChromiumDirName>chrome-linux</ChromiumDirName> | ||
<ChromeDriverDirName>chromedriver_linux64</ChromeDriverDirName> | ||
<ChromiumBinaryName>chrome</ChromiumBinaryName> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(BrowserHost)' == 'windows'"> | ||
<ChromiumRevision>929513</ChromiumRevision> | ||
<ChromiumUrl>https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chrome-win.zip</ChromiumUrl> | ||
<ChromeDriverUrl>https://storage.googleapis.com/chromium-browser-snapshots/Win_x64/$(ChromiumRevision)/chromedriver_win32.zip</ChromeDriverUrl> | ||
<ChromiumDirName>chrome-win</ChromiumDirName> | ||
<ChromeDriverDirName>chromedriver_win32</ChromeDriverDirName> | ||
<ChromiumBinaryName>chrome.exe</ChromiumBinaryName> | ||
</PropertyGroup> | ||
</Project> |
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
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
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
Oops, something went wrong.