Browse Source

Eval exceptions are handled

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@775 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
55314d69e5
  1. 22
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  2. 13
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs

22
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs

@ -184,14 +184,7 @@ namespace Debugger @@ -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 @@ -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));
}

13
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs

@ -28,6 +28,7 @@ namespace Debugger @@ -28,6 +28,7 @@ namespace Debugger
bool evaluating = false;
bool completed = false;
bool successful = false;
Value result;
public event EventHandler<EvalEventArgs> EvalStarted;
@ -60,6 +61,18 @@ namespace Debugger @@ -60,6 +61,18 @@ namespace Debugger
}
}
/// <summary>
/// True if the evaluation was successful, false if it thown an exception (which is presented as the result)
/// </summary>
public bool Successful {
get {
return successful;
}
internal set {
successful = value;
}
}
/// <summary>
/// The result of the evaluation if the evaluation is complete and has returned a value. Null otherwise.
/// </summary>

Loading…
Cancel
Save