mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-09 19:43:27 +02:00
Check if the selected frame is current before calling 'setCurrentStackFrame'.
This commit is contained in:
parent
3cba8eaf06
commit
099c9906e8
2 changed files with 23 additions and 3 deletions
|
@ -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
|
2002-10-10 Mikhail Khodjaiants
|
||||||
* CStackFrame.java: Added Getter and Setter for 'fRefreshVariables'.
|
* CStackFrame.java: Added Getter and Setter for 'fRefreshVariables'.
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,8 @@ public class CThread extends CDebugElement
|
||||||
*/
|
*/
|
||||||
private boolean fIsCurrent = false;
|
private boolean fIsCurrent = false;
|
||||||
|
|
||||||
|
private CStackFrame fLastStackFrame = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CThread.
|
* Constructor for CThread.
|
||||||
* @param target
|
* @param target
|
||||||
|
@ -826,6 +828,7 @@ public class CThread extends CDebugElement
|
||||||
private void handleResumedEvent( ICDIResumedEvent event )
|
private void handleResumedEvent( ICDIResumedEvent event )
|
||||||
{
|
{
|
||||||
setRunning( true );
|
setRunning( true );
|
||||||
|
setLastStackFrame( null );
|
||||||
int state = IState.RUNNING;
|
int state = IState.RUNNING;
|
||||||
int detail = DebugEvent.UNSPECIFIED;
|
int detail = DebugEvent.UNSPECIFIED;
|
||||||
if ( isCurrent() )
|
if ( isCurrent() )
|
||||||
|
@ -974,14 +977,18 @@ public class CThread extends CDebugElement
|
||||||
*/
|
*/
|
||||||
public void switchToFrame( IStackFrame frame ) throws DebugException
|
public void switchToFrame( IStackFrame frame ) throws DebugException
|
||||||
{
|
{
|
||||||
if ( frame == null && !(frame instanceof CStackFrame) )
|
if ( frame == null || !(frame instanceof CStackFrame) || frame.equals( getLastStackFrame() ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// ((CDebugTarget)getDebugTarget()).resetRegisters();
|
// ((CDebugTarget)getDebugTarget()).resetRegisters();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
getCDIThread().setCurrentStackFrame( ((CStackFrame)frame).getCDIStackFrame() );
|
if ( getLastStackFrame() != null )
|
||||||
|
{
|
||||||
|
getCDIThread().setCurrentStackFrame( ((CStackFrame)frame).getCDIStackFrame() );
|
||||||
|
}
|
||||||
|
setLastStackFrame( (CStackFrame)frame );
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
|
@ -993,4 +1000,14 @@ public class CThread extends CDebugElement
|
||||||
{
|
{
|
||||||
return ((CDebugTarget)getDebugTarget()).getRealSourceMode();
|
return ((CDebugTarget)getDebugTarget()).getRealSourceMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setLastStackFrame( CStackFrame frame )
|
||||||
|
{
|
||||||
|
fLastStackFrame = frame;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CStackFrame getLastStackFrame()
|
||||||
|
{
|
||||||
|
return fLastStackFrame;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue