1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-09-10 03:53:21 +02:00

Bug 109785: "mi_cmd_var_create: unable to create variable object" when stepping out of stack frame.

This commit is contained in:
Mikhail Khodjaiants 2005-09-16 19:35:08 +00:00
parent 5f43e1dbcb
commit 9acac67434
2 changed files with 13 additions and 3 deletions

View file

@ -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 2005-09-09 Mikhail Khodjaiants
Bug 109206: Last register group is not added if it has only one register. Bug 109206: Last register group is not added if it has only one register.
* CRegisterManager.java * CRegisterManager.java

View file

@ -111,6 +111,9 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
* @see org.eclipse.debug.core.model.IStackFrame#getVariables() * @see org.eclipse.debug.core.model.IStackFrame#getVariables()
*/ */
public IVariable[] getVariables() throws DebugException { public IVariable[] getVariables() throws DebugException {
if ( isDisposed() ) {
return new IVariable[0];
}
ICGlobalVariable[] globals = getGlobals(); ICGlobalVariable[] globals = getGlobals();
List vars = getVariables0(); List vars = getVariables0();
List all = new ArrayList( globals.length + vars.size() ); 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 { protected synchronized List getVariables0() throws DebugException {
if ( isDisposed() ) {
return Collections.EMPTY_LIST;
}
CThread thread = (CThread)getThread(); CThread thread = (CThread)getThread();
if ( thread.isSuspended() ) { if ( thread.isSuspended() ) {
if ( fVariables == null ) { if ( fVariables == null ) {
@ -175,7 +181,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
* @see org.eclipse.debug.core.model.IStackFrame#hasVariables() * @see org.eclipse.debug.core.model.IStackFrame#hasVariables()
*/ */
public boolean hasVariables() throws DebugException { public boolean hasVariables() throws DebugException {
return getVariables0().size() > 0; return ( isDisposed() ) ? false : getVariables0().size() > 0;
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -232,14 +238,14 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
* @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups() * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups()
*/ */
public IRegisterGroup[] getRegisterGroups() throws DebugException { public IRegisterGroup[] getRegisterGroups() throws DebugException {
return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ); return ( isDisposed() ) ? new IRegisterGroup[0] : ((CDebugTarget)getDebugTarget()).getRegisterGroups( this );
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups() * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups()
*/ */
public boolean hasRegisterGroups() throws DebugException { public boolean hasRegisterGroups() throws DebugException {
return ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ).length > 0; return ( isDisposed() ) ? false : ((CDebugTarget)getDebugTarget()).getRegisterGroups( this ).length > 0;
} }
/* (non-Javadoc) /* (non-Javadoc)