1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Bug 102077: The DebugLabelViewDecorato asking info out of context. Added a new flag to CVariable indicate the disposed state and prevent target requests.

This commit is contained in:
Mikhail Khodjaiants 2005-07-11 18:34:15 +00:00
parent d3ee3bfc24
commit 249408c1cb
4 changed files with 31 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2005-07-11 Mikhail Khodjaiants
Bug 102077: The DebugLabelViewDecorato asking info out of context.
Added a new flag to CVariable indicate the disposed state and prevent target requests.
* CExpression.java
* CGlobalVariable.java
* CVariable.java
2005-07-11 Mikhail Khodjaiants 2005-07-11 Mikhail Khodjaiants
Bug 102563: Break points not working. Bug 102563: Break points not working.
Temporary switching back to use file names instead of full paths. Temporary switching back to use file names instead of full paths.

View file

@ -183,12 +183,15 @@ public class CExpression extends CVariable implements IExpression {
fValue = CValueFactory.NULL_VALUE; fValue = CValueFactory.NULL_VALUE;
} }
internalDispose( true ); internalDispose( true );
setDisposed( true );
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICVariable#getType() * @see org.eclipse.cdt.debug.core.model.ICVariable#getType()
*/ */
public ICType getType() throws DebugException { public ICType getType() throws DebugException {
if ( isDisposed() )
return null;
if ( fType == null ) { if ( fType == null ) {
synchronized( this ) { synchronized( this ) {
if ( fType == null ) { if ( fType == null ) {

View file

@ -79,5 +79,6 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
*/ */
public void dispose() { public void dispose() {
internalDispose( true ); internalDispose( true );
setDisposed( true );
} }
} }

View file

@ -349,6 +349,11 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
*/ */
private CVariableFormat fFormat = CVariableFormat.getFormat( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) ); private CVariableFormat fFormat = CVariableFormat.getFormat( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT ) );
/**
* Whether this variable has been disposed.
*/
private boolean fIsDisposed = false;
/** /**
* Constructor for CVariable. * Constructor for CVariable.
*/ */
@ -382,6 +387,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.cdt.debug.core.model.ICVariable#getType() * @see org.eclipse.cdt.debug.core.model.ICVariable#getType()
*/ */
public ICType getType() throws DebugException { public ICType getType() throws DebugException {
if ( isDisposed() )
return null;
InternalVariable iv = getCurrentInternalVariable(); InternalVariable iv = getCurrentInternalVariable();
return ( iv != null ) ? iv.getType() : null; return ( iv != null ) ? iv.getType() : null;
} }
@ -436,7 +443,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.debug.core.model.IVariable#getValue() * @see org.eclipse.debug.core.model.IVariable#getValue()
*/ */
public IValue getValue() throws DebugException { public IValue getValue() throws DebugException {
if ( isEnabled() ) { if ( !isDisposed() && isEnabled() ) {
InternalVariable iv = getCurrentInternalVariable(); InternalVariable iv = getCurrentInternalVariable();
if ( iv != null ) { if ( iv != null ) {
try { try {
@ -475,6 +482,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged() * @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/ */
public boolean hasValueChanged() throws DebugException { public boolean hasValueChanged() throws DebugException {
if ( isDisposed() )
return false;
InternalVariable iv = getCurrentInternalVariable(); InternalVariable iv = getCurrentInternalVariable();
return ( iv != null ) ? iv.isChanged() : false; return ( iv != null ) ? iv.isChanged() : false;
} }
@ -782,6 +791,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
public void dispose() { public void dispose() {
// Hack: do not destroy local variables // Hack: do not destroy local variables
internalDispose( false ); internalDispose( false );
setDisposed( true );
} }
protected int sizeof() { protected int sizeof() {
@ -837,4 +847,12 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
if ( iv != null ) if ( iv != null )
iv.dispose( destroy ); iv.dispose( destroy );
} }
protected boolean isDisposed() {
return fIsDisposed;
}
protected void setDisposed( boolean isDisposed ) {
fIsDisposed = isDisposed;
}
} }