Skip to content

Commit

Permalink
[wasm][debugger] Fix justMyCode behavior (#78066)
Browse files Browse the repository at this point in the history
* DotnetDebugger.setDebuggerProperty does not depend of having a session.

* addressing @radical comments
  • Loading branch information
thaystg committed Nov 29, 2022
1 parent 26e1ca5 commit d4d12c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Expand Up @@ -20,6 +20,7 @@ internal class MonoProxy : DevToolsProxy
{
private IList<string> urlSymbolServerList;
private HashSet<SessionId> sessions = new HashSet<SessionId>();
private static readonly string[] s_executionContextIndependentCDPCommandNames = { "DotnetDebugger.setDebuggerProperty" };
protected Dictionary<SessionId, ExecutionContext> contexts = new Dictionary<SessionId, ExecutionContext>();

public static HttpClient HttpClient => new HttpClient();
Expand Down Expand Up @@ -258,7 +259,7 @@ protected override async Task<bool> AcceptCommand(MessageId id, JObject parms, C
if (id == SessionId.Null)
await AttachToTarget(id, token);

if (!contexts.TryGetValue(id, out ExecutionContext context))
if (!contexts.TryGetValue(id, out ExecutionContext context) && !s_executionContextIndependentCDPCommandNames.Contains(method))
{
if (method == "Debugger.setPauseOnExceptions")
{
Expand All @@ -267,7 +268,6 @@ protected override async Task<bool> AcceptCommand(MessageId id, JObject parms, C
if (pauseOnException != PauseOnExceptionsKind.Unset)
_defaultPauseOnExceptions = pauseOnException;
}
// for Dotnetdebugger.* messages, treat them as handled, thus not passing them on to the browser
return method.StartsWith("DotnetDebugger.", StringComparison.OrdinalIgnoreCase);
}

Expand Down

0 comments on commit d4d12c5

Please sign in to comment.