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

Do not request to dispose local variables when the target is resumed.

This commit is contained in:
Mikhail Khodjaiants 2004-11-24 20:46:06 +00:00
parent 0bf6b02659
commit d5a0e947ff
4 changed files with 35 additions and 17 deletions

View file

@ -1,3 +1,9 @@
2004-11-24 Mikhail Khodjaiants
Do not request to dispose local variables when the target is resumed.
* CExpression.java
* CGlobalVariable.java
* CVariable.java
2004-11-23 Mikhail Khodjaiants
The enablement of the step actions is calculated in the UI thread. This causes
the UI locks for slow or unresponsive targets. Use the cached stack frames to

View file

@ -179,7 +179,7 @@ public class CExpression extends CVariable implements IExpression {
((AbstractCValue)fValue).dispose();
fValue = null;
}
super.dispose();
internalDispose( true );
}
/* (non-Javadoc)

View file

@ -73,4 +73,11 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
public IGlobalVariableDescriptor getDescriptor() {
return fDescriptor;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.internal.core.model.AbstractCVariable#dispose()
*/
public void dispose() {
internalDispose( true );
}
}

View file

@ -167,9 +167,9 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
return fType;
}
synchronized void invalidate() {
synchronized void invalidate( boolean destroy ) {
try {
if ( fCDIVariable != null )
if ( destroy && fCDIVariable != null )
fCDIVariable.dispose();
}
catch( CDIException e ) {
@ -182,8 +182,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
fType = null;
}
void dispose() {
invalidate();
void dispose( boolean destroy ) {
invalidate( destroy );
}
boolean isSameVariable( ICDIVariable cdiVar ) {
@ -389,10 +389,10 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
public void setEnabled( boolean enabled ) throws DebugException {
InternalVariable iv = getOriginal();
if ( iv != null )
iv.invalidate();
iv.dispose( true );
iv = getShadow();
if ( iv != null )
iv.invalidate();
iv.dispose( true );
fIsEnabled = enabled;
fireChangeEvent( DebugEvent.STATE );
}
@ -520,7 +520,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
if ( current != null ) {
InternalVariable newVar = current.createShadow( startIndex, length );
if ( getShadow() != null )
getShadow().dispose();
getShadow().dispose( true );
setShadow( newVar );
fireChangeEvent( DebugEvent.STATE );
}
@ -609,7 +609,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
if ( current != null ) {
InternalVariable newVar = current.createShadow( type );
if ( getShadow() != null )
getShadow().dispose();
getShadow().dispose( true );
setShadow( newVar );
fireChangeEvent( DebugEvent.STATE );
}
@ -624,7 +624,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
InternalVariable oldVar = getShadow();
setShadow( null );
if ( oldVar != null )
oldVar.dispose();
oldVar.dispose( true );
InternalVariable iv = getOriginal();
if ( iv != null )
iv.invalidateValue();
@ -755,13 +755,8 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
* @see org.eclipse.cdt.debug.internal.core.model.AbstractCVariable#dispose()
*/
public void dispose() {
getCDISession().getEventManager().removeEventListener( this );
InternalVariable iv = getOriginal();
if ( iv != null )
iv.dispose();
iv = getShadow();
if ( iv != null )
iv.dispose();
// Hack: do not destroy local variables
internalDispose( false );
}
protected int sizeof() {
@ -807,4 +802,14 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
if ( iv != null )
iv.preserve();
}
protected void internalDispose( boolean destroy ) {
getCDISession().getEventManager().removeEventListener( this );
InternalVariable iv = getOriginal();
if ( iv != null )
iv.dispose( destroy );
iv = getShadow();
if ( iv != null )
iv.dispose( destroy );
}
}