Implement source breakpoints

This commit is contained in:
Joshua "Yoshi" Askharoun
2025-12-03 20:42:58 -06:00
parent 4a1381ac56
commit 47a8c25353
3 changed files with 42 additions and 30 deletions
@@ -79,8 +79,8 @@ public class IrisDebugAdapterClient : IDebuggerClient, IRemoteDebuggerState, IDi
;
}).ConfigureAwait(false);
var tcs = new TaskCompletionSource<object>();
await tcs.Task;
// TODO: How to keep the thread alive while the debug adapter is running?
await Task.Delay(-1).ConfigureAwait(false);
}
public void Dispose()
@@ -1,5 +1,6 @@
using Microsoft.Iris.Debug.Symbols;
using OmniSharp.Extensions.DebugAdapter.Protocol.Requests;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -18,7 +19,19 @@ internal class BreakpointHandler(DebugSymbolResolver symbolResolver)
foreach (var requestedBreakpoint in request.Breakpoints)
{
var parts = requestedBreakpoint.InstructionReference.Split(['@'], 2);
var loadUri = parts[0];
var offset = Convert.ToUInt32(parts[1], 16);
IrisBreakpoint irisBreakpoint = new(loadUri, offset);
Application.DebugSettings.Breakpoints.Add(irisBreakpoint);
DapBreakpoint dapBreakpoint = new()
{
Id = irisBreakpoint.GetHashCode(),
InstructionReference = requestedBreakpoint.InstructionReference,
};
dapBreakpoints.Add(dapBreakpoint);
}
SetInstructionBreakpointsResponse response = new()