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

Check if the selected frame is current before calling 'setCurrentStackFrame'.

This commit is contained in:
Mikhail Khodjaiants 2002-10-10 22:16:14 +00:00
parent 3cba8eaf06
commit 099c9906e8
2 changed files with 23 additions and 3 deletions

View file

@ -1,3 +1,6 @@
2002-10-10 Mikhail Khodjaiants
* CThread.java: Check if the selected frame is current before calling 'setCurrentStackFrame'.
2002-10-10 Mikhail Khodjaiants
* CStackFrame.java: Added Getter and Setter for 'fRefreshVariables'.

View file

@ -93,7 +93,9 @@ public class CThread extends CDebugElement
/**
* Whether this thread is current.
*/
private boolean fIsCurrent = false;
private boolean fIsCurrent = false;
private CStackFrame fLastStackFrame = null;
/**
* Constructor for CThread.
@ -826,6 +828,7 @@ public class CThread extends CDebugElement
private void handleResumedEvent( ICDIResumedEvent event )
{
setRunning( true );
setLastStackFrame( null );
int state = IState.RUNNING;
int detail = DebugEvent.UNSPECIFIED;
if ( isCurrent() )
@ -974,14 +977,18 @@ public class CThread extends CDebugElement
*/
public void switchToFrame( IStackFrame frame ) throws DebugException
{
if ( frame == null && !(frame instanceof CStackFrame) )
if ( frame == null || !(frame instanceof CStackFrame) || frame.equals( getLastStackFrame() ) )
{
return;
}
// ((CDebugTarget)getDebugTarget()).resetRegisters();
try
{
getCDIThread().setCurrentStackFrame( ((CStackFrame)frame).getCDIStackFrame() );
if ( getLastStackFrame() != null )
{
getCDIThread().setCurrentStackFrame( ((CStackFrame)frame).getCDIStackFrame() );
}
setLastStackFrame( (CStackFrame)frame );
}
catch( CDIException e )
{
@ -993,4 +1000,14 @@ public class CThread extends CDebugElement
{
return ((CDebugTarget)getDebugTarget()).getRealSourceMode();
}
private void setLastStackFrame( CStackFrame frame )
{
fLastStackFrame = frame;
}
private CStackFrame getLastStackFrame()
{
return fLastStackFrame;
}
}