Browse Source

Properties shown in local variables pad and debugger tooltip

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@769 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
cfb9283bee
  1. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  2. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger-StateControl.cs
  3. 9
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  4. 8
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs
  5. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/NDebugger-Evals.cs
  6. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PropertyVariable.cs
  7. 10
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

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

@ -39,7 +39,7 @@ namespace Debugger @@ -39,7 +39,7 @@ namespace Debugger
this.debugger = debugger;
}
bool HandlingCallback {
public bool HandlingCallback {
get {
return handlingCallback;
}
@ -220,7 +220,7 @@ namespace Debugger @@ -220,7 +220,7 @@ namespace Debugger
}
if (debugger.PendingEvals.Count > 0) {
debugger.SetupNextEvaluation();
debugger.SetupNextEvaluation(debugger.GetThread(pThread));
ExitCallback_Continue();
} else {
ExitCallback_Paused(PausedReason.AllEvalsComplete);

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger-StateControl.cs

@ -148,8 +148,16 @@ namespace Debugger @@ -148,8 +148,16 @@ namespace Debugger
OnDebuggingPaused(reason);
if (IsPaused) { // OnDebuggingPaused can resume the debugger
// Debugger state is unknown after calling OnDebuggingPaused (it may be resumed)
// This is a good point to autmaticaly evaluate evals from update of variables (if there are any)
if (IsPaused) {
localVariables.Update();
this.StartEvaluation();
// Evaluation loop stoped by Function.GetPropertyVariables not adding evals
// And PropertyVariable not setting new value
}
if (IsPaused) {
waitForPauseHandle.Set();
}
}

9
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -366,8 +366,8 @@ namespace Debugger @@ -366,8 +366,8 @@ namespace Debugger
return VariableCollection.Merge(
GetContaingClassVariables(),
GetArgumentVariables(),
GetLocalVariables()
//GetPropertyVariables()
GetLocalVariables(),
GetPropertyVariables()
);
}
@ -456,7 +456,10 @@ namespace Debugger @@ -456,7 +456,10 @@ namespace Debugger
evalArgs = new ICorDebugValue[] {ThisValue.CorValue};
}
Eval eval = new Eval(debugger, evalCorFunction, evalArgs);
debugger.AddEval(eval);
// Do not add evals if we just evaluated them, otherwise we get infinite loop
if (debugger.PausedReason != PausedReason.AllEvalsComplete) {
debugger.AddEval(eval);
}
properties.Add(new PropertyVariable(eval, method.Name.Remove(0, 4)));
}
}

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

@ -28,7 +28,7 @@ namespace Debugger @@ -28,7 +28,7 @@ namespace Debugger
bool evaluating = false;
bool completed = false;
Value result;
Value result;
public event EventHandler<EvalEventArgs> EvalStarted;
public event EventHandler<EvalEventArgs> EvalComplete;
@ -87,12 +87,12 @@ namespace Debugger @@ -87,12 +87,12 @@ namespace Debugger
}
/// <returns>True is setup was successful</returns>
internal bool SetupEvaluation()
internal bool SetupEvaluation(Thread targetThread)
{
debugger.AssertPaused();
if (!debugger.ManagedCallback.HandlingCallback) debugger.AssertPaused();
// TODO: What if this thread is not suitable?
debugger.CurrentThread.CorThread.CreateEval(out corEval);
targetThread.CorThread.CreateEval(out corEval);
corEval.CallFunction(corFunction, (uint)args.Length, args);

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/NDebugger-Evals.cs

@ -80,10 +80,10 @@ namespace Debugger @@ -80,10 +80,10 @@ namespace Debugger
}
// return true if there was eval to setup and it was setup
internal bool SetupNextEvaluation()
internal bool SetupNextEvaluation(Thread targetThread)
{
if (pendingEvalsCollection.Count > 0) {
return pendingEvalsCollection[0].SetupEvaluation();
return pendingEvalsCollection[0].SetupEvaluation(targetThread);
} else {
return false;
}
@ -97,7 +97,7 @@ namespace Debugger @@ -97,7 +97,7 @@ namespace Debugger
this.AssertPaused();
// TODO: Investigate other threads, are they alowed to run?
if (SetupNextEvaluation()) {
if (SetupNextEvaluation(CurrentThread)) {
this.Continue();
return true;
} else {

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/PropertyVariable.cs

@ -19,9 +19,7 @@ namespace Debugger @@ -19,9 +19,7 @@ namespace Debugger
internal PropertyVariable(Eval eval, string name):base(eval.Debugger, null, name)
{
this.eval = eval;
eval.EvalStarted += EvalStarted;
eval.EvalComplete += EvalComplete;
this.Eval = eval;
}
public bool IsEvaluated {
@ -48,6 +46,20 @@ namespace Debugger @@ -48,6 +46,20 @@ namespace Debugger
}
}
public Eval Eval {
get {
return eval;
}
set {
if (debugger.PausedReason != PausedReason.AllEvalsComplete) {
eval = value;
eval.EvalStarted += EvalStarted;
eval.EvalComplete += EvalComplete;
OnValueChanged();
}
}
}
void EvalStarted(object sender, EvalEventArgs args)
{
OnValueChanged();

10
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

@ -157,10 +157,16 @@ namespace Debugger @@ -157,10 +157,16 @@ namespace Debugger
foreach(Variable newVariable in newVariables) {
if (this.Contains(newVariable.Name)) {
Variable oldVariable = this[newVariable.Name];
// Update existing variable
this[newVariable.Name].Value = newVariable.Value;
if (oldVariable is PropertyVariable) {
Eval newEval = ((PropertyVariable)newVariable).Eval;
((PropertyVariable)oldVariable).Eval = newEval;
} else {
oldVariable.Value = newVariable.Value;
}
// Keep the variable in the list
toBeRemoved.Remove(this[newVariable.Name]);
toBeRemoved.Remove(oldVariable);
} else {
// Add new variable
this.Add(newVariable);

Loading…
Cancel
Save