From 55314d69e5cbaf9855c726f407aba1d91c5eb3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Sat, 19 Nov 2005 19:32:33 +0000 Subject: [PATCH] Eval exceptions are handled git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@775 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Src/Debugger/Internal/ManagedCallback.cs | 22 ++++++++++++------- .../Project/Src/Variables/Evals/Eval.cs | 13 +++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs index b37a074252..fcdd34c43f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs @@ -184,14 +184,7 @@ namespace Debugger ExitCallback_Continue(); } - - public void EvalException(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval pEval) - { - EnterCallback("EvalException", pThread); - - ExitCallback_Continue(); - } - + public void LogMessage(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, int lLevel, string pLogSwitchName, string pMessage) { EnterCallback("LogMessage", pThread); @@ -208,14 +201,27 @@ namespace Debugger ExitCallback_Continue(); } + public void EvalException(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval) + { + EnterCallback("EvalException", pThread); + + HandleEvalComplete(pAppDomain, pThread, corEval, true); + } + public void EvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval) { EnterCallback("EvalComplete", pThread); + HandleEvalComplete(pAppDomain, pThread, corEval, false); + } + + void HandleEvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval, bool exception) + { // Let the eval know it that the CorEval has finished // this will also remove the eval form PendingEvals collection Eval eval = debugger.GetEval(corEval); if (eval != null) { + eval.Successful = !exception; eval.OnEvalComplete(new EvalEventArgs(eval)); } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs index 55933dc536..afdfed6fdb 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs @@ -28,6 +28,7 @@ namespace Debugger bool evaluating = false; bool completed = false; + bool successful = false; Value result; public event EventHandler EvalStarted; @@ -60,6 +61,18 @@ namespace Debugger } } + /// + /// True if the evaluation was successful, false if it thown an exception (which is presented as the result) + /// + public bool Successful { + get { + return successful; + } + internal set { + successful = value; + } + } + /// /// The result of the evaluation if the evaluation is complete and has returned a value. Null otherwise. ///