Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fixing setting a breakpoint in an invalid IL offset
  • Loading branch information
thaystg committed Sep 13, 2022
commit 994ad0d24379f8503ff68c9e18a93d8f3452230d
3 changes: 3 additions & 0 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,9 @@ private async Task<bool> OnSetNextIP(MessageId sessionId, SourceLocation targetL
return false;

var breakpointId = await context.SdbAgent.SetBreakpoint(scope.Method.DebugId, ilOffset.Offset, token);
if (breakpointId == -1)
return false;

context.TempBreakpointForSetNextIP = breakpointId;
await SendResume(sessionId, token);
return true;
Expand Down
4 changes: 3 additions & 1 deletion src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,9 @@ public async Task<int> SetBreakpoint(int methodId, long il_offset, CancellationT
commandParamsWriter.Write((byte)ModifierKind.LocationOnly);
commandParamsWriter.Write(methodId);
commandParamsWriter.Write(il_offset);
using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token);
using var retDebuggerCmdReader = await SendDebuggerAgentCommand(CmdEventRequest.Set, commandParamsWriter, token, false);
if (retDebuggerCmdReader.HasError)
return -1;
return retDebuggerCmdReader.ReadInt32();
}

Expand Down