Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Karlaš <david.karlas@microsoft.com>2018-03-23 12:24:38 +0300
committerDavid Karlaš <david.karlas@microsoft.com>2018-03-23 12:25:27 +0300
commit8c97184e5609c3ff407f725490bb474037551005 (patch)
tree017070868b27b5dddcb812fa89792c7853089c1c /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol
parent8e82e9fe1b470a2826cc86328530fa807ee9aedd (diff)
Fix 581070: [Feedback] setting breakpoint on non existing c# functions breaks debugging - "Debugger operation failed". Synchronous operation cancelled!
Problem was that IDE sent empty/null path for breakpoint to .NET Core debug adapter which froze in that case, hence I added `!string.IsNullOrEmpty(b.Filepath)` which fixes the problem, I also added support for FunctionBreakpoints, but later figured .NET Core adapter doesn't support that yet...
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r--main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs13
1 files changed, 12 insertions, 1 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 ecbfd73d9b..145df49004 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
@@ -37,6 +37,8 @@ using Microsoft.VisualStudio.Shared.VSCodeDebugProtocol;
using System.Threading;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
+using MonoFunctionBreakpoint = Mono.Debugging.Client.FunctionBreakpoint;
+using VsCodeFunctionBreakpoint = Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Messages.FunctionBreakpoint;
namespace MonoDevelop.Debugger.VsCodeDebugProtocol
{
@@ -362,7 +364,7 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
if (protocolClient == null)
return;
- var bks = breakpoints.Select (b => b.Key).OfType<Mono.Debugging.Client.Breakpoint> ().Where (b => b.Enabled).GroupBy (b => b.FileName).ToArray ();
+ var bks = breakpoints.Select (b => b.Key).OfType<Mono.Debugging.Client.Breakpoint> ().Where (b => b.Enabled && !string.IsNullOrEmpty (b.FileName)).GroupBy (b => b.FileName).ToArray ();
var filesForRemoval = pathsWithBreakpoints.Where (path => !bks.Any (b => b.Key == path)).ToArray ();
pathsWithBreakpoints = bks.Select (b => b.Key).ToList ();
@@ -388,6 +390,15 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
});
});
}
+
+ //Notice that .NET Core adapter doesn't support Functions breakpoints yet: https://github.com/OmniSharp/omnisharp-vscode/issues/295
+ protocolClient.SendRequest (
+ new SetFunctionBreakpointsRequest (
+ breakpoints.Select (b => b.Key).OfType<MonoFunctionBreakpoint> ()
+ .Where (b => b.Enabled)
+ .Select (b => new VsCodeFunctionBreakpoint (b.FunctionName))
+ .ToList ()),
+ (obj) => { });
}
protected InitializeResponse Capabilities;