Browse Source

Misuse of delegate

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@847 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
24ffed1f5b
  1. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs

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

@ -484,8 +484,9 @@ namespace Debugger @@ -484,8 +484,9 @@ namespace Debugger
public IEnumerable<Variable> PropertyVariables {
get {
foreach(MethodProps method in module.MetaData.EnumMethods(methodProps.ClassToken)) {
if (method.Name.StartsWith("get_") && method.HasSpecialName) {
foreach(MethodProps m in module.MetaData.EnumMethods(methodProps.ClassToken)) {
MethodProps method = m; // One per scope/delegate
if (method.Name.StartsWith("get_") && method.HasSpecialName) {
yield return new PropertyVariable(debugger,
method.Name.Remove(0, 4),
delegate {

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs

@ -126,16 +126,16 @@ namespace Debugger @@ -126,16 +126,16 @@ namespace Debugger
yield return BaseClassVariable;
}
foreach(FieldProps field in metaData.EnumFields(classProps.Token)) {
foreach(FieldProps f in metaData.EnumFields(classProps.Token)) {
FieldProps field = f; // One per scope/delegate
if (field.IsStatic && field.IsLiteral) continue; // Skip field
if (!field.IsStatic && corValue == null) continue; // Skip field
FieldProps fieldCpy = field; // TODO: Why do we need this!!!!????
yield return new Variable(debugger,
field.Name,
delegate {
Value updatedVal = getter();
if (this.IsEquivalentValue(updatedVal)) {
return GetValue(updatedVal, fieldCpy);
return GetValue(updatedVal, field);
} else {
return new UnavailableValue(debugger, "Object type changed");
}

Loading…
Cancel
Save