mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 01:05:38 +02:00
2005-06-27 Alain Magloire
Change in ICDIReferenceValue. * cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java * src/org/eclipse/cdt/debug/internal/core/model/CValue.java
This commit is contained in:
parent
dd61bd77b0
commit
888d8a3b2c
3 changed files with 13 additions and 22 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-06-27 Alain Magloire
|
||||||
|
Change in ICDIReferenceValue.
|
||||||
|
* cdi/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java
|
||||||
|
* src/org/eclipse/cdt/debug/internal/core/model/CValue.java
|
||||||
|
|
||||||
2005-05-27 Alain Magloire
|
2005-05-27 Alain Magloire
|
||||||
Use the fCDIVariable instead of fCDIVariableObject when possible.
|
Use the fCDIVariable instead of fCDIVariableObject when possible.
|
||||||
* src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
|
* src/org/eclipse/cdt/debug/internal/core/model/CVariable.java
|
||||||
|
|
|
@ -10,13 +10,17 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.core.cdi.model.type;
|
package org.eclipse.cdt.debug.core.cdi.model.type;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public interface ICDIReferenceValue extends ICDIDerivedValue {
|
public interface ICDIReferenceValue extends ICDIDerivedValue {
|
||||||
|
|
||||||
BigInteger referenceValue() throws CDIException;
|
/**
|
||||||
|
* Return the reference value.
|
||||||
|
* @return ICDIValue
|
||||||
|
* @throws CDIException
|
||||||
|
*/
|
||||||
|
ICDIValue referenceValue() throws CDIException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ public class CValue extends AbstractCValue {
|
||||||
else if ( cdiValue instanceof ICDIPointerValue )
|
else if ( cdiValue instanceof ICDIPointerValue )
|
||||||
return getPointerValueString( (ICDIPointerValue)cdiValue );
|
return getPointerValueString( (ICDIPointerValue)cdiValue );
|
||||||
else if ( cdiValue instanceof ICDIReferenceValue )
|
else if ( cdiValue instanceof ICDIReferenceValue )
|
||||||
return getReferenceValueString( (ICDIReferenceValue)cdiValue );
|
return processUnderlyingValue(((ICDIReferenceValue)cdiValue).referenceValue());
|
||||||
else if ( cdiValue instanceof ICDIWCharValue )
|
else if ( cdiValue instanceof ICDIWCharValue )
|
||||||
return getWCharValueString( (ICDIWCharValue)cdiValue );
|
return getWCharValueString( (ICDIWCharValue)cdiValue );
|
||||||
else
|
else
|
||||||
|
@ -383,24 +383,6 @@ public class CValue extends AbstractCValue {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException {
|
|
||||||
//NOTE: Reference should be displayed identically to address
|
|
||||||
//TODO:IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references
|
|
||||||
IAddressFactory factory = ((CDebugTarget)getDebugTarget()).getAddressFactory();
|
|
||||||
BigInteger refValue = value.referenceValue();
|
|
||||||
if ( refValue == null )
|
|
||||||
return ""; //$NON-NLS-1$
|
|
||||||
IAddress address = factory.createAddress( refValue );
|
|
||||||
if ( address == null )
|
|
||||||
return ""; //$NON-NLS-1$
|
|
||||||
CVariableFormat format = getParentVariable().getFormat();
|
|
||||||
if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) )
|
|
||||||
return address.toHexAddressString();
|
|
||||||
if ( CVariableFormat.DECIMAL.equals( format ) )
|
|
||||||
return address.toString();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getWCharValueString( ICDIWCharValue value ) throws CDIException {
|
private String getWCharValueString( ICDIWCharValue value ) throws CDIException {
|
||||||
if ( getParentVariable() instanceof CVariable ) {
|
if ( getParentVariable() instanceof CVariable ) {
|
||||||
int size = ((CVariable)getParentVariable()).sizeof();
|
int size = ((CVariable)getParentVariable()).sizeof();
|
||||||
|
|
Loading…
Add table
Reference in a new issue