diff options
author | David KarlasĖ <david.karlas@microsoft.com> | 2018-08-24 17:41:13 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2018-08-27 12:14:50 +0300 |
commit | 3a67c178940ae813caad9a1557cdc0f65891650b (patch) | |
tree | e35255a51c189745585eef531dbc4f527150b1e3 /main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol | |
parent | 791c5066dc064f72362ce4309c32128dd2c58c68 (diff) |
Fix #5659: VSCodeDebugProtocol: Synchronous operation cancelled! When stopping debugging session. This logic around HasExited and use that to log/show or not log/show exceptions is taken from SoftDebugger.
Diffstat (limited to 'main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 29 |
1 files changed, 24 insertions, 5 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 5d04e4b5bf..0a61ae5d41 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 @@ -64,7 +64,11 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol protected override void OnExit () { - protocolClient?.SendRequestSync (new DisconnectRequest ()); + try { + HasExited = true; + protocolClient.SendRequestSync (new DisconnectRequest ()); + } catch { + } } protected override void OnFinish () @@ -150,8 +154,12 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol void DebugAgentProcess_Exited (object sender, EventArgs e) { if (protocolClient != null) { - protocolClient.RequestReceived -= OnDebugAdaptorRequestReceived; - protocolClient.Stop (); + try { + HasExited = true; + protocolClient.RequestReceived -= OnDebugAdaptorRequestReceived; + protocolClient.Stop (); + } catch { + } protocolClient = null; } OnTargetEvent (new TargetEventArgs (TargetEventType.TargetExited)); @@ -432,13 +440,24 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol public override void Dispose () { + HasExited = true; base.Dispose (); if (protocolClient != null) { protocolClient.RequestReceived -= OnDebugAdaptorRequestReceived; - protocolClient.SendRequestSync (new DisconnectRequest ()); - protocolClient.Stop (); + try { + protocolClient.SendRequestSync (new DisconnectRequest ()); + protocolClient.Stop (); + } catch { + } protocolClient = null; } } + + protected override bool HandleException (Exception ex) + { + if (HasExited) + return true; + return base.HandleException (ex); + } } } |