Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

[Debugger] Update VSCodeDebuggerSession Step methods to send requests… #9552

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ protected override void OnExit ()

protected override void OnFinish ()
{
try {
protocolClient.SendRequestSync (new StepOutRequest (currentThreadId));
} catch (Exception ex) {
protocolClient.SendRequest (new StepOutRequest (currentThreadId), null, (args, ex) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this mean the method exits before the step is done?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It just means we won't block until the response is received

DebuggerLoggingService.LogError ("[VSCodeDebugger] StepOut request failed", ex);
}
});
}

List<ProcessInfo> processInfo = new List<ProcessInfo>();
Expand Down Expand Up @@ -229,20 +227,16 @@ void UpdateExceptions ()

protected override void OnNextInstruction ()
{
try {
protocolClient.SendRequestSync (new NextRequest (currentThreadId));
} catch (Exception ex) {
protocolClient.SendRequest (new NextRequest (currentThreadId), null, (args, ex) => {
DebuggerLoggingService.LogError ("[VSCodeDebugger] NextInstruction request failed", ex);
}
});
}

protected override void OnNextLine ()
{
try {
protocolClient.SendRequestSync (new NextRequest (currentThreadId));
} catch (Exception ex) {
protocolClient.SendRequest (new NextRequest (currentThreadId), null, (args, ex) => {
DebuggerLoggingService.LogError ("[VSCodeDebugger] StepOver request failed", ex);
}
});
}

protected override void OnRemoveBreakEvent (BreakEventInfo eventInfo)
Expand Down Expand Up @@ -606,8 +600,7 @@ void UpdateBreakpoints ()
breakpoints.Select (b => b.Key).OfType<MonoFunctionBreakpoint> ()
.Where (b => b.Enabled)
.Select (b => new VsCodeFunctionBreakpoint (b.FunctionName))
.ToList ()),
(obj) => { });
.ToList ()), null);
}

protected InitializeResponse Capabilities;
Expand All @@ -619,20 +612,16 @@ protected override void OnSetActiveThread (long processId, long threadId)

protected override void OnStepInstruction ()
{
try {
protocolClient.SendRequestSync (new StepInRequest (currentThreadId));
} catch (Exception ex) {
protocolClient.SendRequest (new StepInRequest (currentThreadId), null, (args, ex) => {
DebuggerLoggingService.LogError ("[VSCodeDebugger] StepInstruction request failed", ex);
}
});
}

protected override void OnStepLine ()
{
try {
protocolClient.SendRequestSync (new StepInRequest (currentThreadId));
} catch (Exception ex) {
protocolClient.SendRequest (new StepInRequest (currentThreadId), null, (args, ex) => {
DebuggerLoggingService.LogError ("[VSCodeDebugger] StepIn request failed", ex);
}
});
}

protected override void OnStop ()
Expand All @@ -656,7 +645,8 @@ public override void Dispose ()
try {
protocolClient.SendRequestSync (new DisconnectRequest ());
protocolClient.Stop ();
} catch {
} catch (Exception ex) {
DebuggerLoggingService.LogError ("[VSCodeDebugger] Disconnect request failed", ex);
}
protocolClient = null;
}
Expand Down