1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Implementation of array partitions.

This commit is contained in:
Mikhail Khodjaiants 2002-09-11 18:46:36 +00:00
parent d9185d633c
commit a3edd4621d
5 changed files with 20 additions and 17 deletions

View file

@ -56,13 +56,6 @@ public class CArrayEntryVariable extends CLocalVariable
return stripBrackets( super.getReferenceTypeName() ); return stripBrackets( super.getReferenceTypeName() );
} }
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener#handleDebugEvent(ICDIEvent)
*/
public void handleDebugEvent(ICDIEvent event)
{
}
protected int getIndex() protected int getIndex()
{ {
return fIndex; return fIndex;

View file

@ -121,7 +121,7 @@ public class CArrayPartition extends CVariable
} }
else else
{ {
var = new CArrayPartition( target, cdiVars.subList( start, start + perSlot - 1 ), start, start + perSlot - 1 ); var = new CArrayPartition( target, cdiVars.subList( start, start + perSlot ), start, start + perSlot - 1 );
} }
children.add( var ); children.add( var );
start += perSlot; start += perSlot;

View file

@ -98,7 +98,8 @@ public class CArrayPartitionValue extends CDebugElement implements ICValue
if ( fVariables.isEmpty() ) if ( fVariables.isEmpty() )
{ {
fVariables = new ArrayList( getEnd() - getStart() + 1 ); fVariables = new ArrayList( getEnd() - getStart() + 1 );
for ( int i = getStart(); i < getEnd(); ++i ) { for ( int i = getStart(); i <= getEnd(); ++i )
{
fVariables.add( new CArrayEntryVariable( (CDebugTarget)getDebugTarget(), (ICDIVariable)fCDIVariables.get( i - getStart() ), i ) ); fVariables.add( new CArrayEntryVariable( (CDebugTarget)getDebugTarget(), (ICDIVariable)fCDIVariables.get( i - getStart() ), i ) );
} }
} }

View file

@ -239,15 +239,19 @@ public class CValue extends CDebugElement implements ICValue
{ {
fValueString = null; fValueString = null;
} }
/* Iterator it = fVariables.iterator();
if ( hasVariables() ) while( it.hasNext() )
{ {
IVariable[] vars = getVariables(); ((CVariable)it.next()).setChanged( changed );
for ( int i = 0; i < vars.length; ++i ) }
{ }
((CVariable)vars[i]).setChanged( changed );
} protected void dispose()
{
Iterator it = fVariables.iterator();
while( it.hasNext() )
{
((CVariable)it.next()).dispose();
} }
*/
} }
} }

View file

@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.core.model;
import java.text.MessageFormat; import java.text.MessageFormat;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICValue; import org.eclipse.cdt.debug.core.ICValue;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
@ -195,6 +196,10 @@ public abstract class CVariable extends CDebugElement
protected void dispose() protected void dispose()
{ {
if ( fValue != null )
{
((CValue)fValue).dispose();
}
getCDISession().getEventManager().removeEventListener( this ); getCDISession().getEventManager().removeEventListener( this );
} }