Browse Source

fix Debugger: Move mouse over instance field (+property?) -> does not show value; expression is missing 'this'

pull/45/merge
Siegfried Pammer 12 years ago
parent
commit
a1c035e005
  1. 5
      src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs

5
src/AddIns/Debugger/Debugger.AddIn/NRefactory/ExpressionEvaluationVisitor.cs

@ -115,8 +115,11 @@ namespace Debugger.AddIn @@ -115,8 +115,11 @@ namespace Debugger.AddIn
throw new GetValueException("Member not found!");
Value target = null;
if (!importedMember.IsStatic) {
if (result.TargetResult == null)
if (importedMember.DeclaringType.Equals(context.MethodInfo.DeclaringType) && result.TargetResult == null)
target = context.GetThisValue(true);
else if (result.TargetResult == null)
throw new GetValueException("An object reference is required for the non-static field, method, or property '" + importedMember.FullName + "'");
else
target = Convert(result.TargetResult);
}
if (!allowMethodInvoke && (importedMember is IMethod))

Loading…
Cancel
Save