mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
All local var_objects are destroyed when a thread other than current is selected. CVariable has to be invalidated if a "destroyed" event has been received.
This commit is contained in:
parent
45e573a88b
commit
aa3f10c491
2 changed files with 33 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2003-06-24 Mikhail Khodjaiants
|
||||
All local var_objects are destroyed when a thread other than current is selected.
|
||||
CVariable has to be invalidated if a "destroyed" event has been received.
|
||||
* CVariable.java
|
||||
|
||||
2003-06-23 Mikhail Khodjaiants
|
||||
Fix for ClassCastException in CStackFrame.
|
||||
* CStackFrame.java
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.eclipse.cdt.debug.core.ICDebugConstants;
|
|||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIDestroyedEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
|
||||
|
@ -104,6 +105,11 @@ public abstract class CVariable extends CDebugElement
|
|||
invalidate();
|
||||
setCDIVariableObject( null );
|
||||
}
|
||||
|
||||
protected boolean isSameVariable( ICDIVariable cdiVar )
|
||||
{
|
||||
return ( fCDIVariable != null ) ? fCDIVariable.equals( cdiVar ) : false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -371,16 +377,16 @@ public abstract class CVariable extends CDebugElement
|
|||
{
|
||||
if ( event instanceof ICDIChangedEvent )
|
||||
{
|
||||
try
|
||||
if ( source instanceof ICDIVariable && isSameVariable( (ICDIVariable)source ) )
|
||||
{
|
||||
if ( source instanceof ICDIVariable && source.equals( getCDIVariable() ) )
|
||||
{
|
||||
handleChangedEvent( (ICDIChangedEvent)event );
|
||||
}
|
||||
handleChangedEvent( (ICDIChangedEvent)event );
|
||||
}
|
||||
catch( CDIException e )
|
||||
}
|
||||
else if ( event instanceof ICDIDestroyedEvent )
|
||||
{
|
||||
if ( source instanceof ICDIVariable && isSameVariable( (ICDIVariable)source ) )
|
||||
{
|
||||
// do nothing
|
||||
handleDestroyedEvent( (ICDIDestroyedEvent)event );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -399,6 +405,15 @@ public abstract class CVariable extends CDebugElement
|
|||
}
|
||||
}
|
||||
|
||||
private void handleDestroyedEvent( ICDIDestroyedEvent event )
|
||||
{
|
||||
if ( fOriginal != null )
|
||||
fOriginal.invalidate();
|
||||
if ( getShadow() != null )
|
||||
getShadow().invalidate();
|
||||
invalidateValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the stack frame this variable is contained in.
|
||||
*
|
||||
|
@ -830,4 +845,10 @@ public abstract class CVariable extends CDebugElement
|
|||
{
|
||||
return ( getParent() instanceof CStackFrame );
|
||||
}
|
||||
|
||||
protected boolean isSameVariable( ICDIVariable cdiVar )
|
||||
{
|
||||
return ( ( getShadow() != null && getShadow().isSameVariable( cdiVar ) ) ||
|
||||
( fOriginal != null && fOriginal.isSameVariable( cdiVar ) ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue