diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 330cacfc847..99959779aa0 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,8 @@ +2004-06-29 Mikhail Khodjaiants + Temporary fix for bug 68915: Invalid values in the Variables view. + * CStackFrame.java + * CThread.java + 2004-06-28 Mikhail Khodjaiants Partial fix for bug 45535: Performance problems when debugging. Cache the double and float presentations of the floating point types. diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java index 508f67118b2..f484ff3c94d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java @@ -107,7 +107,8 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart } protected synchronized List getVariables0() throws DebugException { - if ( fVariables == null ) { + ((CThread)getThread()).switchToFrame( this ); + if ( fVariables == null ) { List vars = getAllCDIVariableObjects(); fVariables = new ArrayList( vars.size() ); Iterator it = vars.iterator(); @@ -569,10 +570,6 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart return list; } - /* - * protected List getAllCDIVariables() throws DebugException { List list = new ArrayList(); list.addAll( getCDIArguments() ); list.addAll( - * getCDILocalVariables() ); return list; } - */ protected List getAllCDIVariableObjects() throws DebugException { List list = new ArrayList(); list.addAll( getCDIArgumentObjects() ); diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java index 28b22448fdd..e48caad931f 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java @@ -272,6 +272,7 @@ public class CThread extends CDebugElement { try { + ((CDebugTarget)getDebugTarget()).setCurrentThread( this ); return getCDIThread().getStackFrames( lowFrame, highFrame ); } catch( CDIException e ) @@ -1016,6 +1017,7 @@ public class CThread extends CDebugElement } try { + ((CDebugTarget)getDebugTarget()).setCurrentThread( this ); if ( getLastStackFrame() != null ) { ((CDebugTarget)getDebugTarget()).resetRegisters(); diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog index c7f59579951..4b90222d06c 100644 --- a/debug/org.eclipse.cdt.debug.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog @@ -1,3 +1,7 @@ +2004-06-29 Mikhail Khodjaiants + Temporary fix for bug 68915: Invalid values in the Variables view. + * CDebugUIPlugin.java + 2004-06-22 Mikhail Khodjaiants Replaced global resource bundles by messages. diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java index 25c68630083..86f5d4f337a 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java @@ -311,10 +311,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen */ public void start( BundleContext context ) throws Exception { super.start( context ); - IWorkbenchWindow ww = getActiveWorkbenchWindow(); - if ( ww != null ) { - ww.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } + listenSelection( true, this ); CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() ); } @@ -325,13 +322,26 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen */ public void stop( BundleContext context ) throws Exception { CDebugCorePlugin.getDefault().removeCBreakpointListener( CBreakpointUpdater.getInstance() ); - IWorkbenchWindow ww = getActiveWorkbenchWindow(); - if ( ww != null ) { - ww.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); - } + listenSelection( false, this ); if ( fImageDescriptorRegistry != null ) { fImageDescriptorRegistry.dispose(); } super.stop( context ); } + + void listenSelection( final boolean enable, final ISelectionListener listener ) { + Runnable r = new Runnable() { + + public void run() { + IWorkbenchWindow ww = getActiveWorkbenchWindow(); + if ( ww != null ) { + if ( enable ) + ww.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, listener ); + else + ww.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, listener ); + } + } + }; + getWorkbench().getDisplay().asyncExec( r ); + } } \ No newline at end of file