From 7f026fc86dbc3eab6f487aeb7e069c301f96f2cb Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Wed, 7 Jan 2026 08:38:26 +1000 Subject: [PATCH] Add SharpDbg --- Directory.Packages.props | 3 ++- .../Features/Debugging/DebuggerProcessStreamHelper.cs | 6 ++++++ src/SharpIDE.Application/SharpIDE.Application.csproj | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 05581ac..e794444 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -55,6 +55,7 @@ + @@ -68,4 +69,4 @@ - \ No newline at end of file + diff --git a/src/SharpIDE.Application/Features/Debugging/DebuggerProcessStreamHelper.cs b/src/SharpIDE.Application/Features/Debugging/DebuggerProcessStreamHelper.cs index 6e3b1e6..2d9607a 100644 --- a/src/SharpIDE.Application/Features/Debugging/DebuggerProcessStreamHelper.cs +++ b/src/SharpIDE.Application/Features/Debugging/DebuggerProcessStreamHelper.cs @@ -1,5 +1,6 @@ using System.Diagnostics; using Ardalis.GuardClauses; +using SharpDbg.InMemory; using SharpIDE.Application.Features.Run; namespace SharpIDE.Application.Features.Debugging; @@ -9,6 +10,11 @@ public static class DebuggerProcessStreamHelper public static (Stream Input, Stream Output, bool IsNetCoreDbg) NewDebuggerProcessStreamsForInfo(DebuggerExecutableInfo? debuggerExecutableInfoNullable) { if (debuggerExecutableInfoNullable is not {} debuggerExecutableInfo) throw new ArgumentNullException(nameof(debuggerExecutableInfoNullable), "Debugger executable info cannot be null."); + if (debuggerExecutableInfo.UseInMemorySharpDbg) + { + var (input, output) = SharpDbgInMemory.NewDebugAdapterStreams(); + return (input, output, false); + } var debuggerExecutablePath = debuggerExecutableInfo.DebuggerExecutablePath; Guard.Against.NullOrWhiteSpace(debuggerExecutablePath, nameof(debuggerExecutablePath), "Debugger executable path cannot be null or empty."); var isNetCoreDbg = Path.GetFileNameWithoutExtension(debuggerExecutablePath).Equals("netcoredbg", StringComparison.OrdinalIgnoreCase); diff --git a/src/SharpIDE.Application/SharpIDE.Application.csproj b/src/SharpIDE.Application/SharpIDE.Application.csproj index 034e65a..ac69d1f 100644 --- a/src/SharpIDE.Application/SharpIDE.Application.csproj +++ b/src/SharpIDE.Application/SharpIDE.Application.csproj @@ -61,6 +61,7 @@ +