From d139534b915bf752c2da5dc44a285cf4ad26b6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Fri, 3 Feb 2006 16:09:26 +0000 Subject: [PATCH] Fixed Forums-3382,3489,3575: Attempt to display property of property crashed the debugger git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1063 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Debugger.Core/Project/Src/Variables/Evals/Eval.cs | 9 +++++++++ .../Project/Src/Variables/ObjectValue.cs | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs index c1278ff70f..9124c78824 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs @@ -121,6 +121,15 @@ namespace Debugger ICorDebugValue[] args = getArgs(); + if (args == null) { + error = "Can not evaluate property of property"; + evalState = EvalState.Error; + if (EvalComplete != null) { + EvalComplete(this, new EvalEventArgs(this)); + } + return false; + } + // TODO: What if this thread is not suitable? corEval = targetThread.CorThread.CreateEval(); diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs index c40cc9e3e1..a37b3c381b 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ObjectValue.cs @@ -185,10 +185,15 @@ namespace Debugger ICorDebugFunction evalCorFunction = Module.CorModule.GetFunctionFromToken(method.Token); return new Eval(debugger, evalCorFunction, delegate { - if (method.IsStatic) { - return new ICorDebugValue[] {}; + Value updatedVal = getter(); + if (this.IsEquivalentValue(updatedVal) && ((ObjectValue)updatedVal).SoftReference != null) { + if (method.IsStatic) { + return new ICorDebugValue[] {}; + } else { + return new ICorDebugValue[] {((ObjectValue)updatedVal).SoftReference.CastTo()}; + } } else { - return new ICorDebugValue[] {((ObjectValue)getter()).SoftReference.CastTo()}; + return null; } }); }