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

Implementation of Registers view.

This commit is contained in:
Mikhail Khodjaiants 2002-09-17 16:03:53 +00:00
parent dc70001746
commit 655d90ba80
5 changed files with 49 additions and 3 deletions

View file

@ -1647,4 +1647,13 @@ public class CDebugTarget extends CDebugElement
((CRegisterGroup)it.next()).dispose(); ((CRegisterGroup)it.next()).dispose();
} }
} }
protected void preserveRegisters()
{
Iterator it = fRegisterGroups.iterator();
while( it.hasNext() )
{
((CRegisterGroup)it.next()).preserve();
}
}
} }

View file

@ -10,6 +10,7 @@ import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIRegisterObject; import org.eclipse.cdt.debug.core.cdi.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister; import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
@ -69,7 +70,7 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup
*/ */
public boolean hasRegisters() throws DebugException public boolean hasRegisters() throws DebugException
{ {
return getRegisters0().size() > 0; return fRegisterObjects.length > 0;
} }
private List getRegisters0() throws DebugException private List getRegisters0() throws DebugException
@ -149,4 +150,22 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup
index++; index++;
} }
} }
protected void preserve()
{
if ( fRegisters == null )
return;
try
{
Iterator it = fRegisters.iterator();
while( it.hasNext() )
{
((CVariable)it.next()).setChanged( false );
}
}
catch( DebugException e )
{
CDebugCorePlugin.log( e );
}
}
} }

View file

@ -682,7 +682,13 @@ public class CStackFrame extends CDebugElement
return (IVariable[])list.toArray( new IVariable[list.size()] ); return (IVariable[])list.toArray( new IVariable[list.size()] );
} }
protected synchronized void preserveVariables() protected synchronized void preserve()
{
preserveVariables();
preserveRegisters();
}
private void preserveVariables()
{ {
if ( fVariables == null ) if ( fVariables == null )
return; return;
@ -700,6 +706,11 @@ public class CStackFrame extends CDebugElement
} }
} }
private void preserveRegisters()
{
((CDebugTarget)getDebugTarget()).preserveRegisters();
}
// temporary solution // temporary solution
protected ICDIVariable findVariable( List list, ICDIVariable var ) protected ICDIVariable findVariable( List list, ICDIVariable var )
{ {

View file

@ -657,7 +657,7 @@ public class CThread extends CDebugElement
Iterator it = fStackFrames.iterator(); Iterator it = fStackFrames.iterator();
while( it.hasNext() ) while( it.hasNext() )
{ {
((CStackFrame)it.next()).preserveVariables(); ((CStackFrame)it.next()).preserve();
} }
setRefreshChildren( true ); setRefreshChildren( true );
} }

View file

@ -227,6 +227,13 @@ public class RegistersView extends AbstractDebugEventHandlerView
return; return;
} }
if ( current != null && frame != null &&
current instanceof IStackFrame &&
((IStackFrame)current).getDebugTarget().equals( frame.getDebugTarget() ) )
{
return;
}
showViewer(); showViewer();
getViewer().setInput( frame ); getViewer().setInput( frame );
} }