From 505cbc07e990aa84db91dbace5594f462140bb8f Mon Sep 17 00:00:00 2001 From: "DESKTOP-GEPIA6N\\Thays" Date: Mon, 24 Jan 2022 16:16:48 -0300 Subject: [PATCH 1/3] Show the callstack as it's shown on net5. --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 4 +++- src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 5fc72c491c3b58..8be17096c011f7 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -961,7 +961,9 @@ private async Task SendCallStack(SessionId sessionId, ExecutionContext con string function_name = frame["functionName"]?.Value(); string url = frame["url"]?.Value(); if (!(function_name.StartsWith("wasm-function", StringComparison.Ordinal) || - url.StartsWith("wasm://wasm/", StringComparison.Ordinal) || function_name == "_mono_wasm_fire_debugger_agent_message")) + url.StartsWith("wasm://wasm/", StringComparison.Ordinal) || + url.EndsWith(".wasm", StringComparison.Ordinal) || + function_name == "_mono_wasm_fire_debugger_agent_message")) { callFrames.Add(frame); } diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index 3dc2bc246364c9..b05fff4bef028f 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -155,6 +155,9 @@ await EvaluateAndCheck( Assert.Equal("object", scope["object"]["type"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); + + var not_wasm_frame = pause_location["callFrames"][2]; + Assert.Contains("dotnet.js", not_wasm_frame["url"].Value()); return Task.CompletedTask; } ); From 992cf7fab64084163396010fc052d30c3e732c29 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GEPIA6N\\Thays" Date: Wed, 26 Jan 2022 09:42:34 -0300 Subject: [PATCH 2/3] Addressing @lewing and @radical comments. --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 1 + .../wasm/debugger/DebuggerTestSuite/BreakpointTests.cs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index 8be17096c011f7..e7db2c1d76e63c 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -237,6 +237,7 @@ protected override async Task AcceptEvent(SessionId sessionId, string meth { case var _ when url == "": case var _ when url.StartsWith("wasm://", StringComparison.Ordinal): + case var _ when url.EndsWith(".wasm", StringComparison.Ordinal): { Log("verbose", $"ignoring wasm: Debugger.scriptParsed {url}"); return true; diff --git a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs index b05fff4bef028f..62a2eee77c6fdb 100644 --- a/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs +++ b/src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs @@ -156,8 +156,11 @@ await EvaluateAndCheck( CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 8, 4, scripts, scope["startLocation"]); CheckLocation("dotnet://debugger-test.dll/debugger-test.cs", 14, 4, scripts, scope["endLocation"]); - var not_wasm_frame = pause_location["callFrames"][2]; - Assert.Contains("dotnet.js", not_wasm_frame["url"].Value()); + foreach (var frame in pause_location["callFrames"]) + { + Assert.Equal(false, frame["url"].Value().Contains(".wasm")); + Assert.Equal(false, frame["url"].Value().Contains("wasm://")); + } return Task.CompletedTask; } ); From e3b22ed0e6910baf6fe09706b4f5045a0c69b8d1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GEPIA6N\\Thays" Date: Wed, 2 Feb 2022 12:20:52 -0300 Subject: [PATCH 3/3] addressing @lewing comment. --- src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs index e7db2c1d76e63c..ae4dda53fa2686 100644 --- a/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs +++ b/src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs @@ -962,7 +962,7 @@ private async Task SendCallStack(SessionId sessionId, ExecutionContext con string function_name = frame["functionName"]?.Value(); string url = frame["url"]?.Value(); if (!(function_name.StartsWith("wasm-function", StringComparison.Ordinal) || - url.StartsWith("wasm://wasm/", StringComparison.Ordinal) || + url.StartsWith("wasm://", StringComparison.Ordinal) || url.EndsWith(".wasm", StringComparison.Ordinal) || function_name == "_mono_wasm_fire_debugger_agent_message")) {