diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 4c6a5dc925e..372934b1938 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2005-09-16 Mikhail Khodjaiants + Bug 109785: "mi_cmd_var_create: unable to create variable object" when stepping out of stack frame. + * CStackFrame.java + 2005-09-09 Mikhail Khodjaiants Bug 109206: Last register group is not added if it has only one register. * CRegisterManager.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java index 593df825ed1..ee25f428bcf 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java @@ -111,6 +111,9 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart * @see org.eclipse.debug.core.model.IStackFrame#getVariables() */ public IVariable[] getVariables() throws DebugException { + if ( isDisposed() ) { + return new IVariable[0]; + } ICGlobalVariable[] globals = getGlobals(); List vars = getVariables0(); List all = new ArrayList( globals.length + vars.size() ); @@ -120,6 +123,9 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart } protected synchronized List getVariables0() throws DebugException { + if ( isDisposed() ) { + return Collections.EMPTY_LIST; + } CThread thread = (CThread)getThread(); if ( thread.isSuspended() ) { if ( fVariables == null ) { @@ -175,7 +181,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart * @see org.eclipse.debug.core.model.IStackFrame#hasVariables() */ public boolean hasVariables() throws DebugException { - return getVariables0().size() > 0; + return ( isDisposed() ) ? false : getVariables0().size() > 0; } /* (non-Javadoc) @@ -232,14 +238,14 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups() */ public IRegisterGroup[] getRegisterGroups() throws DebugException { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ); + return ( isDisposed() ) ? new IRegisterGroup[0] : ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ); } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups() */ public boolean hasRegisterGroups() throws DebugException { - return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ).length > 0; + return ( isDisposed() ) ? false : ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ).length > 0; } /* (non-Javadoc)