Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-01-30 17:29:46 +0000
committerMikhail Khodjaiants2004-01-30 17:29:46 +0000
commit9c46de496a0276ae9cb09cd434ae440edb2b85fe (patch)
treed362e87ce4a3175a1f40e9fb48bcb998b0bac020
parent757ce6fd2620b7cd04211b711d7f0003368f9d04 (diff)
downloadorg.eclipse.cdt-9c46de496a0276ae9cb09cd434ae440edb2b85fe.tar.gz
org.eclipse.cdt-9c46de496a0276ae9cb09cd434ae440edb2b85fe.tar.xz
org.eclipse.cdt-9c46de496a0276ae9cb09cd434ae440edb2b85fe.zip
Fix for bug 50981: In the 'getValue' method of CVariable 'getType' should be only called once.
-rw-r--r--debug/org.eclipse.cdt.debug.core/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CVariable.java13
2 files changed, 15 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index 456fe9d2181..6d20a479636 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-30 Mikhail Khodjaiants
+ Fix for bug 50981: In the 'getValue' method of CVariable 'getType' should be only called once.
+ * CVariable.java
+
2004-01-29 Mikhail Khodjaiants
Fire sets of debug events instead of firing it one by one.
* CDebugTarget.java
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 4093166ece7..f927702a986 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
@@ -435,7 +435,16 @@ public abstract class CVariable extends CDebugElement
return fDisabledValue;
if ( fValue == null )
{
- if ( getType() != null && getType().isArray() )
+ ICType type = null;
+ try
+ {
+ type = getType();
+ }
+ catch( DebugException e )
+ {
+ // ignore and use default type
+ }
+ if ( type != null && type.isArray() )
{
ICDIVariable var = null;
try
@@ -446,7 +455,7 @@ public abstract class CVariable extends CDebugElement
{
requestFailed( "", e );
}
- int[] dims = getType().getArrayDimensions();
+ int[] dims = type.getArrayDimensions();
if ( dims.length > 0 && dims[0] > 0 )
fValue = CValueFactory.createArrayValue( this, var, 0, dims[0] - 1 );
}

Back to the top