From 41b04c93d17f155d56a4109fb4591452c76b1f32 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Fri, 28 Apr 2006 03:21:58 +0000 Subject: [PATCH] When the target supports runtime type identification clear out the cached type when a new value is created. Also fix a problem with global variables not always being updated. --- .../cdt/debug/internal/core/model/CGlobalVariable.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java index e92525d4467..54fd797df12 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CGlobalVariable.java @@ -17,6 +17,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor; import org.eclipse.cdt.debug.core.cdi.model.ICDIGlobalVariableDescriptor; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration2; import org.eclipse.cdt.debug.core.cdi.model.ICDIValue; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor; @@ -231,6 +232,9 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable { fValue = CValueFactory.createValue( getVariable(), cdiValue ); } } + if (getCDITarget().getConfiguration() instanceof ICDITargetConfiguration2 && + ((ICDITargetConfiguration2)getCDITarget().getConfiguration()).supportsRuntimeTypeIdentification()) + fType = null; // When the debugger supports RTTI getting a new value may also mean a new type. } catch( CDIException e ) { requestFailed( e.getMessage(), e ); @@ -347,6 +351,7 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable { ICDITarget cdiTarget = source.getTarget(); if ( getCDITarget().equals( cdiTarget ) ) { setChanged( false ); + resetValue(); // Reset the value cache so the display value will be updated. } } }