Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1539,8 +1539,9 @@ protected async Task<DebugStore> RuntimeReady(SessionId sessionId, CancellationT
ExecutionContext context = GetContext(sessionId);
if (Interlocked.CompareExchange(ref context.ready, new TaskCompletionSource<DebugStore>(), null) != null)
return await context.ready.Task;

await context.SdbAgent.SendDebuggerAgentCommand(CmdEventRequest.ClearAllBreakpoints, null, token);
var res = await context.SdbAgent.SendDebuggerAgentCommand(CmdEventRequest.ClearAllBreakpoints, null, token, false);
if (res.HasError) //it's not a wasm page then the command returns an error
return null;

if (context.PauseOnExceptions != PauseOnExceptionsKind.None && context.PauseOnExceptions != PauseOnExceptionsKind.Unset)
await context.SdbAgent.EnableExceptions(context.PauseOnExceptions, token);
Expand Down
8 changes: 5 additions & 3 deletions src/mono/wasm/debugger/DebuggerTestSuite/BreakpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,10 @@ await SendCommandAndCheck(null, "Debugger.resume",
});
}

[ConditionalFact(nameof(RunningOnChrome))]
public async Task CreateGoodBreakpointAndHitGoToNonWasmPageComeBackAndHitAgain()
[ConditionalTheory(nameof(RunningOnChrome))]
[InlineData("load_non_wasm_page")]
[InlineData("load_non_wasm_page_forcing_runtime_ready")] //to simulate the same behavior that has when debugging from VS and OnDefaultContextCreated is called
public async Task CreateGoodBreakpointAndHitGoToNonWasmPageComeBackAndHitAgain(string func_name)
{
var bp = await SetBreakpoint("dotnet://debugger-test.dll/debugger-test.cs", 10, 8);
var pause_location = await EvaluateAndCheck(
Expand Down Expand Up @@ -500,7 +502,7 @@ public async Task CreateGoodBreakpointAndHitGoToNonWasmPageComeBackAndHitAgain()

var run_method = JObject.FromObject(new
{
expression = "window.setTimeout(function() { load_non_wasm_page(); }, 1);"
expression = "window.setTimeout(function() { " + func_name + "(); }, 1);"
});
await cli.SendCommand("Runtime.evaluate", run_method, token);
await Task.Delay(1000, token);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
console.log("load_wasm_page_without_assets")
window.location.replace("http://localhost:9400/wasm-page-without-assets.html");
}
function load_non_wasm_page_forcing_runtime_ready () {
console.log("load_non_wasm_page_forcing_runtime_ready")
window.location.replace("http://localhost:9400/non-wasm-page-forcing-runtime-ready.html");
}
</script>

<script type="text/javascript" src="other.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<ItemGroup>
<WasmExtraFilesToDeploy Include="debugger-driver.html" />
<WasmExtraFilesToDeploy Include="non-wasm-page.html" />
<WasmExtraFilesToDeploy Include="non-wasm-page-forcing-runtime-ready.html" />
<WasmExtraFilesToDeploy Include="wasm-page-without-assets.html" />
<WasmExtraFilesToDeploy Include="other.js" />
<WasmExtraFilesToDeploy Include="weather.json" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html lang="en-us">
<head>
</head>
<body>
<script type='text/javascript'>
console.debug ("#debugger-app-ready#");
console.debug("mono_wasm_runtime_ready", "fe00e07a-5519-4dfe-b35a-f867dbaf2e28");
function reload_wasm_page () {
window.location.replace("http://localhost:9400/debugger-driver.html");
}
</script>
</body>
</html>