diff options
author | Andrey Sobolev | 2016-05-03 05:46:50 +0000 |
---|---|---|
committer | Andrey Sobolev | 2016-05-03 05:47:14 +0000 |
commit | a6fecdd5f12a9bad2fa60877a4ff786eb5c67679 (patch) | |
tree | 487092a62067d11c2ff49051e4a26d902e578856 | |
parent | 63151b649c25757c5d4708c88e89515f9c040884 (diff) | |
download | org.eclipse.dltk.core-a6fecdd5f12a9bad2fa60877a4ff786eb5c67679.tar.gz org.eclipse.dltk.core-a6fecdd5f12a9bad2fa60877a4ff786eb5c67679.tar.xz org.eclipse.dltk.core-a6fecdd5f12a9bad2fa60877a4ff786eb5c67679.zip |
One more fix to prevent variable context get on non suspend thread.
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
-rw-r--r-- | core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptStackFrame.java | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptStackFrame.java b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptStackFrame.java index cf34bd73e..07473049a 100644 --- a/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptStackFrame.java +++ b/core/plugins/org.eclipse.dltk.debug/src/org/eclipse/dltk/internal/debug/core/model/ScriptStackFrame.java @@ -97,31 +97,50 @@ public class ScriptStackFrame extends ScriptDebugElement implements return duplicates; } + /** + * Return null in case suspend more is no more active during calculation of + * variables. + * + * @return + * @throws DbgpException + */ protected ScriptVariableContainer readAllVariables() throws DbgpException { final IDbgpContextCommands commands = thread.getDbgpSession() .getCoreCommands(); + // TODO: Until more sequence approach will be implemented + if (!thread.isSuspended()) { + return null; + } + final ScriptVariableContainer result = new ScriptVariableContainer(); final Map names = commands.getContextNames(getLevel()); if (thread.retrieveLocalVariables() && names.containsKey(Integer.valueOf( - IDbgpContextCommands.LOCAL_CONTEXT_ID))) { + IDbgpContextCommands.LOCAL_CONTEXT_ID)) + && thread.isSuspended()) { result.locals = readVariables(this, IDbgpContextCommands.LOCAL_CONTEXT_ID, commands); } if (thread.retrieveGlobalVariables() && names.containsKey(Integer.valueOf( - IDbgpContextCommands.GLOBAL_CONTEXT_ID))) { + IDbgpContextCommands.GLOBAL_CONTEXT_ID)) + && thread.isSuspended()) { result.globals = readVariables(this, IDbgpContextCommands.GLOBAL_CONTEXT_ID, commands); } if (thread.retrieveClassVariables() && names.containsKey(Integer.valueOf( - IDbgpContextCommands.CLASS_CONTEXT_ID))) { + IDbgpContextCommands.CLASS_CONTEXT_ID)) + && thread.isSuspended()) { result.classes = readVariables(this, IDbgpContextCommands.CLASS_CONTEXT_ID, commands); } + // TODO: Until more sequence approach will be implemented + if (!thread.isSuspended()) { + return null; + } return result; } @@ -378,8 +397,9 @@ public class ScriptStackFrame extends ScriptDebugElement implements try { if (variables == null) { variables = readAllVariables(); - - variables.sort(getDebugTarget()); + if (variables != null) { + variables.sort(getDebugTarget()); + } } else if (needRefreshVariables) { try { refreshVariables(); @@ -403,6 +423,11 @@ public class ScriptStackFrame extends ScriptDebugElement implements */ private void refreshVariables() throws DebugException, DbgpException { final ScriptVariableContainer newVars = readAllVariables(); + if (newVars == null) { + // No need to refresh, refresh will happen in next + variables = null; + return; + } newVars.sort(getDebugTarget()); variables.locals = refreshVariables(newVars.locals, variables.locals); variables.globals = refreshVariables(newVars.globals, |