diff options
author | Mikhail Khodjaiants | 2004-02-10 21:51:22 +0000 |
---|---|---|
committer | Mikhail Khodjaiants | 2004-02-10 21:51:22 +0000 |
commit | 98589999f9e7e477554339e7e12a6d184afa4728 (patch) | |
tree | 8f4d4fe572ed368508ce8da6886e87f4656ceaaf | |
parent | 24d0deee30ebfe6256bd5141494db286b44408b1 (diff) | |
download | org.eclipse.cdt-98589999f9e7e477554339e7e12a6d184afa4728.tar.gz org.eclipse.cdt-98589999f9e7e477554339e7e12a6d184afa4728.tar.xz org.eclipse.cdt-98589999f9e7e477554339e7e12a6d184afa4728.zip |
Cache the endianness flag.
-rw-r--r-- | debug/org.eclipse.cdt.debug.core/ChangeLog | 4 | ||||
-rw-r--r-- | debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 6d20a479636..6f1bd7ff173 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2004-02-10 Mikhail Khodjaiants + Cache the endianness flag. + * CDebugTarget.java + 2004-01-30 Mikhail Khodjaiants Fix for bug 50981: In the 'getValue' method of CVariable 'getType' should be only called once. * CVariable.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index e412bea291e..7950489a2f1 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -271,8 +271,14 @@ public class CDebugTarget extends CDebugElement */ private IFile fExecFile; + /** + * Whether the target is little endian. + */ + private Boolean fIsLittleEndian = null; + private RunningInfo fRunningInfo = null; + /** * Constructor for CDebugTarget. * @param target @@ -1996,15 +2002,19 @@ public class CDebugTarget extends CDebugElement */ public boolean isLittleEndian() { - if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) + if ( fIsLittleEndian == null ) { - ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); - if ( cFile instanceof IBinary ) + fIsLittleEndian = Boolean.TRUE; + if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) { - ((IBinary)cFile).isLittleEndian(); + ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); + if ( cFile instanceof IBinary ) + { + fIsLittleEndian = new Boolean( ((IBinary)cFile).isLittleEndian() ); + } } } - return true; + return fIsLittleEndian.booleanValue(); } public IFile getExecFile() |