1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 09:16: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
Bug 102563: Break points not working.
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;
}
internalDispose( true );
setDisposed( true );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.ICVariable#getType()
*/
public ICType getType() throws DebugException {
if ( isDisposed() )
return null;
if ( fType == null ) {
synchronized( this ) {
if ( fType == null ) {

View file

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

View file

@ -129,7 +129,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
}
private ICDIVariableDescriptor getCDIVariableObject() {
if (fCDIVariable != null) {
if ( fCDIVariable != null ) {
return fCDIVariable;
}
return fCDIVariableObject;
@ -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 ) );
/**
* Whether this variable has been disposed.
*/
private boolean fIsDisposed = false;
/**
* Constructor for CVariable.
*/
@ -382,6 +387,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.cdt.debug.core.model.ICVariable#getType()
*/
public ICType getType() throws DebugException {
if ( isDisposed() )
return null;
InternalVariable iv = getCurrentInternalVariable();
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()
*/
public IValue getValue() throws DebugException {
if ( isEnabled() ) {
if ( !isDisposed() && isEnabled() ) {
InternalVariable iv = getCurrentInternalVariable();
if ( iv != null ) {
try {
@ -475,6 +482,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/
public boolean hasValueChanged() throws DebugException {
if ( isDisposed() )
return false;
InternalVariable iv = getCurrentInternalVariable();
return ( iv != null ) ? iv.isChanged() : false;
}
@ -782,6 +791,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
public void dispose() {
// Hack: do not destroy local variables
internalDispose( false );
setDisposed( true );
}
protected int sizeof() {
@ -837,4 +847,12 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
if ( iv != null )
iv.dispose( destroy );
}
protected boolean isDisposed() {
return fIsDisposed;
}
protected void setDisposed( boolean isDisposed ) {
fIsDisposed = isDisposed;
}
}