diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2019-05-09 20:35:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-09 20:35:56 +0300 |
commit | 6a0a79d519ec2a34bfcd8cf63496078cf7442fa1 (patch) | |
tree | 5260040a0d669c5893d19002bc61229fa2337920 /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol | |
parent | 86c9b9cd23d5fde07605d7985105f230cffeda6a (diff) | |
parent | 192fadf6bbe46c9efef2362cced15c3e5f88b9c4 (diff) |
Merge pull request #7443 from mono/jstedfast-debugger-set-next-statement
[Debugger] Implement Set Next Statement for the VsCode debugger backend
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs index 5474e1deeb..4d92b280ba 100644 --- a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs +++ b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs @@ -100,6 +100,24 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol return threads; } + public override bool CanSetNextStatement { + get { return true; } + } + + protected override void OnSetNextStatement (long threadId, string fileName, int line, int column) + { + var source = new Source { Name = Path.GetFileName (fileName), Path = fileName }; + var request = new GotoTargetsRequest (source, line) { Column = column }; + var response = protocolClient.SendRequestSync (request); + var target = response.Targets.FirstOrDefault (x => x.Line <= line && x.EndLine >= line && x.Column <= column && x.EndColumn >= column); + + if (target == null) + throw new NotSupportedException (); + + protocolClient.SendRequestSync (new GotoRequest ((int) threadId, target.Id)); + RaiseStopEvent (); + } + Dictionary<BreakEvent, BreakEventInfo> breakpoints = new Dictionary<BreakEvent, BreakEventInfo> (); protected override BreakEventInfo OnInsertBreakEvent (BreakEvent breakEvent) |