Add SharpDbg

This commit is contained in:
Matt Parker
2026-01-07 08:38:26 +10:00
parent f05d465cc4
commit 7f026fc86d
3 changed files with 9 additions and 1 deletions

View File

@@ -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);

View File

@@ -61,6 +61,7 @@
<PackageReference Include="NuGet.Protocol" />
<PackageReference Include="ObservableCollections" />
<PackageReference Include="R3" />
<PackageReference Include="SharpDbg" />
</ItemGroup>
<ItemGroup>