diff options
author | Michael Belyaev <usrsse2@me.com> | 2019-05-22 13:15:58 +0300 |
---|---|---|
committer | Jeffrey Stedfast <jestedfa@microsoft.com> | 2019-05-28 18:26:39 +0300 |
commit | e553b756bef492ea6a0d90d2ff9ed354b86f3d4c (patch) | |
tree | a91faa70f0a4e1c585a26fbf71144824d674dcc8 /main | |
parent | 6a80d07570b7b731c735b2e2bd1f506ff6b659a8 (diff) |
Fix condition evaluation in case of external code
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VSCodeDebuggerSession.cs | 20 |
1 files changed, 19 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 c7673f0bd6..eb2c6c6b99 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 @@ -384,7 +384,25 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol args = new TargetEventArgs (TargetEventType.TargetStopped); break; case StoppedEvent.ReasonValue.Exception: - stackFrame = (VsCodeStackFrame) this.GetThreadBacktrace (body.ThreadId ?? -1).GetFrame (0); + stackFrame = null; + var backtrace = GetThreadBacktrace (body.ThreadId ?? -1); + if (Options.ProjectAssembliesOnly) { + // We can't evaluate expressions in external code frames, the debugger will hang + for (int i = 0; i < backtrace.FrameCount; i++) { + var frame = stackFrame = (VsCodeStackFrame)backtrace.GetFrame (i); + if (!frame.IsExternalCode) { + stackFrame = frame; + break; + } + } + if (stackFrame == null) { + OnContinue (); + return; + } + } else { + // It's OK to evaluate expressions in external code + stackFrame = (VsCodeStackFrame)backtrace.GetFrame (0); + } if (!breakpoints.Select (b => b.Key).OfType<Catchpoint> ().Any (c => ShouldStopOnExceptionCatchpoint (c, stackFrame.frameId))) { OnContinue (); |