Debugger - expand variables with variablesReference

This commit is contained in:
Matt Parker
2025-12-14 18:30:12 +10:00
parent 1efcaede54
commit 0dd6061a5f
4 changed files with 56 additions and 2 deletions

View File

@@ -23,4 +23,5 @@ public class Debugger
public async Task<List<ThreadModel>> GetThreadsAtStopPoint() => await _debuggingService.GetThreadsAtStopPoint();
public async Task<List<StackFrameModel>> GetStackFramesForThread(int threadId) => await _debuggingService.GetStackFramesForThread(threadId);
public async Task<List<Variable>> GetVariablesForStackFrame(int frameId) => await _debuggingService.GetVariablesForStackFrame(frameId);
public async Task<List<Variable>> GetVariablesForVariablesReference(int variablesReferenceId) => await _debuggingService.GetVariablesForVariablesReference(variablesReferenceId);
}

View File

@@ -242,6 +242,13 @@ public class DebuggingService
return allVariables;
}
public async Task<List<Variable>> GetVariablesForVariablesReference(int variablesReference)
{
var variablesRequest = new VariablesRequest { VariablesReference = variablesReference };
var variablesResponse = _debugProtocolHost.SendRequestSync(variablesRequest);
return variablesResponse.Variables;
}
// netcoredbg does not provide the stack frame name in this format, so don't use this if using netcoredbg
private static ManagedStackFrameInfo? ParseStackFrameName(string name)
{

View File

@@ -166,6 +166,10 @@ public partial class RunService(ILogger<RunService> logger, RoslynAnalysis rosly
{
return await _debugger!.GetVariablesForStackFrame(frameId);
}
public async Task<List<Variable>> GetVariablesForVariablesReference(int variablesReferenceId)
{
return await _debugger!.GetVariablesForVariablesReference(variablesReferenceId);
}
private async Task<string> GetRunArguments(SharpIdeProjectModel project)
{