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 authored and github-actions committed Sep 13, 2022
commit a92e44e85546b5921dac55d5977c4215ce08ec49
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 @@ -1727,6 +1727,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 @@ -1365,7 +1365,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