Check if the selected frame is current before calling
'setCurrentStackFrame'.
Index:
CThread.java =================================================================== RCS
file:
/home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java,v retrieving
revision 1.13 diff -u -r1.13 CThread.java --- CThread.java 10 Oct
2002 16:51:28 -0000 1.13 +++ CThread.java 10 Oct 2002 22:14:55
-0000 @@ -93,7 +93,9 @@ /** * Whether this
thread is current. */ - private boolean fIsCurrent =
false; + private boolean fIsCurrent =
false; + + private CStackFrame fLastStackFrame =
null; /** * Constructor for
CThread. @@ -826,6 +828,7 @@ private void handleResumedEvent(
ICDIResumedEvent event ) { setRunning( true
); + setLastStackFrame( null ); int state =
IState.RUNNING; int detail =
DebugEvent.UNSPECIFIED; if ( isCurrent() ) @@ -974,14
+977,18 @@ */ 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 ) { @@ -992,5 +999,15
@@ private int
getRealSourceMode() { return
((CDebugTarget)getDebugTarget()).getRealSourceMode(); + } + + private
void setLastStackFrame( CStackFrame frame
) + { + fLastStackFrame =
frame; + } + + private CStackFrame
getLastStackFrame() + { + return
fLastStackFrame; } }
|