Browse Source

Removed expiry propagation for Values.

It seems there were only two cases:
 - Values expiring when stack frame exits
 - Values expiring immediately when debuggee is resumed

These precisely correspond to these two cases: (respectively)
 - Values that have closed expression
 - Values that do not have closed expression


The new behaviour is that every value expires when debuggee is resumed.

Work in progress...

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2773 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
c0db8bfbb9
  1. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs
  2. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs
  4. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs
  5. 12
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs
  6. 1
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs
  7. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs
  8. 39
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Exception.cs

@ -39,7 +39,6 @@ namespace Debugger @@ -39,7 +39,6 @@ namespace Debugger
Value runtimeValue = new Value(process,
string.Empty,
Expression.Empty,
new IExpirable[] {process.PauseSession},
delegate { return corValue; } );
message = runtimeValue.GetMember("_message").AsString;

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

@ -441,7 +441,6 @@ namespace Debugger @@ -441,7 +441,6 @@ namespace Debugger
process,
"this",
new Ast.ThisReferenceExpression(),
new IExpirable[] {this},
delegate { return ThisCorValue; }
);
}
@ -510,7 +509,6 @@ namespace Debugger @@ -510,7 +509,6 @@ namespace Debugger
process,
name,
new Ast.ParameterIdentifierExpression(index, name),
new IExpirable[] {this},
delegate { return GetArgumentCorValue(index); }
);
}
@ -601,7 +599,6 @@ namespace Debugger @@ -601,7 +599,6 @@ namespace Debugger
process,
symVar.Name,
new Ast.LocalVariableIdentifierExpression(symVar),
new IExpirable[] {this},
delegate { return GetCorValueOfLocalVariable(symVar); }
);
}

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

@ -168,7 +168,6 @@ namespace Debugger @@ -168,7 +168,6 @@ namespace Debugger
process,
string.Empty,
Expression.Empty,
new IExpirable[] {process.PauseSession},
delegate { return CorThread.Object;}
);
}

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

@ -235,7 +235,6 @@ namespace Debugger @@ -235,7 +235,6 @@ namespace Debugger
result = new Value(process,
string.Empty,
Expression.Empty,
new IExpirable[] {},
delegate { return corEval.Result; });
}
}

12
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Expressions/Expression.cs

@ -20,15 +20,19 @@ namespace Debugger @@ -20,15 +20,19 @@ namespace Debugger
/// </summary>
public class Expression: DebuggerObject
{
public static Expression Empty = null;
public static Expression Empty = new Expression(null);
Ast.Expression expressionAst;
public string Code {
get {
CSharpOutputVisitor csOutVisitor = new CSharpOutputVisitor();
expressionAst.AcceptVisitor(csOutVisitor, null);
return csOutVisitor.Text;
if (expressionAst != null) {
CSharpOutputVisitor csOutVisitor = new CSharpOutputVisitor();
expressionAst.AcceptVisitor(csOutVisitor, null);
return csOutVisitor.Text;
} else {
return string.Empty;
}
}
}

1
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Array.cs

@ -80,7 +80,6 @@ namespace Debugger @@ -80,7 +80,6 @@ namespace Debugger
Process,
GetNameFromIndices(indices),
GetExpressionFromIndices(indices),
new IExpirable[] {this},
delegate { return GetCorValueOfArrayElement(indices); }
);
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.Object.cs

@ -56,7 +56,6 @@ namespace Debugger @@ -56,7 +56,6 @@ namespace Debugger
objectInstance.Expression,
fieldInfo
),
new IExpirable[] {objectInstance},
delegate { return GetFieldCorValue(objectInstance, fieldInfo); }
);
}
@ -123,7 +122,6 @@ namespace Debugger @@ -123,7 +122,6 @@ namespace Debugger
objectInstance.Expression,
propertyInfo
),
dependencies.ToArray(),
delegate { return Value.InvokeMethod(objectInstance, propertyInfo.GetMethod, arguments).RawCorValue; }
);
}

39
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Values/Value.cs

@ -42,7 +42,7 @@ namespace Debugger @@ -42,7 +42,7 @@ namespace Debugger
CorValueGetter corValueGetter;
/// <summary> Occurs when the Value can not be used anymore </summary>
/// <summary> Occurs when the Value can not be used </summary>
public event EventHandler Expired;
bool isExpired = false;
@ -177,10 +177,12 @@ namespace Debugger @@ -177,10 +177,12 @@ namespace Debugger
internal Value(Process process,
string name,
Expression expression,
IExpirable[] expireDependencies,
CorValueGetter corValueGetter)
{
this.process = process;
this.name = name;
this.expression = expression;
this.corValueGetter = corValueGetter;
// TODO: clean up
if (name.StartsWith("<") && name.Contains(">") && name != "<Base class>") {
@ -190,36 +192,13 @@ namespace Debugger @@ -190,36 +192,13 @@ namespace Debugger
}
}
this.process = process;
this.expression = expression;
AddExpireDependency(process);
foreach(IExpirable exp in expireDependencies) {
AddExpireDependency(exp);
}
this.corValueGetter = corValueGetter;
}
void AddExpireDependency(IExpirable dependency)
{
if (dependency.HasExpired) {
MakeExpired();
} else {
dependency.Expired += delegate { MakeExpired(); };
}
}
void MakeExpired()
{
if (!isExpired) {
isExpired = true;
OnExpired(new ValueEventArgs(this));
}
process.DebuggingResumed += delegate {
this.isExpired = true;
OnExpired(EventArgs.Empty);
};
}
/// <summary> Is called when the value expires and can not be
/// used anymore </summary>
/// <summary> Is called when the value expires and can not be used </summary>
protected virtual void OnExpired(EventArgs e)
{
if (Expired != null) {

Loading…
Cancel
Save