From 5643b88dd19d05cc908c7010b00f9a15633b4c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Sat, 16 Sep 2006 19:41:24 +0000 Subject: [PATCH] Fixed SD2-1086: Debugger thrown exception trying to show tooltip of decimal variable. - Eval does not work on thread unsafe point after break git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1810 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Debugger/Debugger.Core/Project/Src/Threads/Thread.cs | 6 ++++++ .../Debugger.Core/Project/Src/Variables/Evals/Eval.cs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs index 0bfb4640c8..2ac7d7218f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs @@ -63,6 +63,12 @@ namespace Debugger } } + public bool IsAtSafePoint { + get { + return corThread.UserState != CorDebugUserState.USER_UNSAFE_POINT; + } + } + public ICorDebugThread CorThread { get { return corThread; 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 0a874c79c9..4bdf19136e 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 @@ -153,6 +153,9 @@ namespace Debugger if (targetThread.IsLastFunctionNative) { throw new EvalSetupException("Can not evaluate because native frame is on top of stack"); } + if (!targetThread.IsAtSafePoint) { + throw new EvalSetupException("Can not evaluate because thread is not at a safe point"); + } // TODO: What if this thread is not suitable? corEval = targetThread.CorThread.CreateEval();