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][debugger] Proxy but don't process events from worker sessions #57974

Merged
merged 1 commit into from
Aug 24, 2021
Merged
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
16 changes: 12 additions & 4 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth

case "Runtime.exceptionThrown":
{
if (!GetContext(sessionId).IsRuntimeReady)
// Don't process events from sessions we aren't tracking
if (!contexts.TryGetValue(sessionId, out ExecutionContext context))
return false;

if (!context.IsRuntimeReady)
{
string exceptionError = args?["exceptionDetails"]?["exception"]?["value"]?.Value<string>();
if (exceptionError == sPauseOnUncaught || exceptionError == sPauseOnCaught)
Expand All @@ -139,7 +143,11 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth

case "Debugger.paused":
{
if (!GetContext(sessionId).IsRuntimeReady)
// Don't process events from sessions we aren't tracking
if (!contexts.TryGetValue(sessionId, out ExecutionContext context))
return false;

if (!context.IsRuntimeReady)
{
string reason = args?["reason"]?.Value<string>();
if (reason == "exception")
Expand All @@ -148,13 +156,13 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth
if (exceptionError == sPauseOnUncaught)
{
await SendCommand(sessionId, "Debugger.resume", new JObject(), token);
GetContext(sessionId).PauseOnUncaught = true;
context.PauseOnUncaught = true;
return true;
}
if (exceptionError == sPauseOnCaught)
{
await SendCommand(sessionId, "Debugger.resume", new JObject(), token);
GetContext(sessionId).PauseOnCaught = true;
context.PauseOnCaught = true;
return true;
}
}
Expand Down