Browse Source

Created EvalCollection class

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4511 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 16 years ago
parent
commit
0e7636d384
  1. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
  2. 29
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Evals.cs
  3. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs
  4. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs

@ -135,7 +135,7 @@ namespace Debugger @@ -135,7 +135,7 @@ namespace Debugger
}
}
process.NotifyEvaluationStarted(newEval);
process.ActiveEvals.Add(newEval);
process.AsyncContinue(DebuggeeStateAction.Keep);
return newEval;

29
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-Evals.cs

@ -13,32 +13,29 @@ namespace Debugger @@ -13,32 +13,29 @@ namespace Debugger
{
public partial class Process
{
List<Eval> activeEvals = new List<Eval>();
EvalCollection evals;
public bool Evaluating {
get {
return activeEvals.Count > 0;
public EvalCollection ActiveEvals {
get { return evals; }
}
internal bool Evaluating {
get { return evals.Count > 0; }
}
}
internal Eval GetEval(ICorDebugEval corEval)
public class EvalCollection: CollectionWithEvents<Eval>
{
foreach(Eval eval in activeEvals) {
public EvalCollection(NDebugger debugger): base(debugger) {}
internal Eval Get(ICorDebugEval corEval)
{
foreach(Eval eval in this) {
if (eval.IsCorEval(corEval)) {
return eval;
}
}
throw new DebuggerException("Eval not found for given ICorDebugEval");
}
internal void NotifyEvaluationStarted(Eval eval)
{
activeEvals.Add(eval);
}
internal void NotifyEvaluationComplete(Eval eval)
{
activeEvals.Remove(eval);
}
}
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs

@ -71,6 +71,8 @@ namespace Debugger @@ -71,6 +71,8 @@ namespace Debugger
this.corProcess = corProcess;
this.callbackInterface = new ManagedCallback(this);
evals = new EvalCollection(debugger);
}
internal ICorDebugProcess CorProcess {

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

@ -256,9 +256,9 @@ namespace Debugger @@ -256,9 +256,9 @@ namespace Debugger
void HandleEvalComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugEval corEval, bool exception)
{
// Let the eval know that the CorEval has finished
Eval eval = process.GetEval(corEval);
Eval eval = process.ActiveEvals.Get(corEval);
eval.NotifyEvaluationComplete(!exception);
process.NotifyEvaluationComplete(eval);
process.ActiveEvals.Remove(eval);
pauseOnNextExit = true;
ExitCallback();

Loading…
Cancel
Save