From 011cd84a9250f8094f6717e3f5a6cf3d318ce67b Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Thu, 17 Mar 2005 22:00:31 +0000 Subject: [PATCH] If casting of variable to a type or array causes an error, the status of the variable is set to "error" and it can't be reset by subsequent castings. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 5 +++++ .../cdt/debug/internal/core/model/CVariable.java | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index f5ab083e005..60a42785dd4 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,8 @@ +2005-03-17 Mikhail Khodjaiants + If casting of variable to a type or array causes an error, the status + of the variable is set to "error" and it can't be reset by subsequent castings. + * CVariable.java + 2005-02-24 Mikhail Khodjaiants Applied patch from Tracy Miranda (bug 86540: NPE in CProjectSourceLocation). Check for the project and synchronization are added to "initializeFolders". diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java index 349494176df..1cf0147141d 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java @@ -522,7 +522,9 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener { if ( getShadow() != null ) getShadow().dispose( true ); setShadow( newVar ); - fireChangeEvent( DebugEvent.STATE ); + // If casting of variable to a type or array causes an error, the status + // of the variable is set to "error" and it can't be reset by subsequent castings. + resetValue(); } } @@ -611,7 +613,9 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener { if ( getShadow() != null ) getShadow().dispose( true ); setShadow( newVar ); - fireChangeEvent( DebugEvent.STATE ); + // If casting of variable to a type or array causes an error, the status + // of the variable is set to "error" and it can't be reset by subsequent castings. + resetValue(); } } @@ -628,7 +632,9 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener { InternalVariable iv = getOriginal(); if ( iv != null ) iv.invalidateValue(); - fireChangeEvent( DebugEvent.STATE ); + // If casting of variable to a type or array causes an error, the status + // of the variable is set to "error" and it can't be reset by subsequent castings. + resetValue(); } /*