1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-13 11:15:38 +02:00

Bug 370462: Improving the debug preferences. Better handling of octal addresses.

This commit is contained in:
Mathias Kunter 2012-02-23 06:25:49 -05:00 committed by Marc Khouzam
parent 49c5be791f
commit cd1de04157
2 changed files with 28 additions and 6 deletions

View file

@ -24,6 +24,8 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.utils.Addr32;
import org.eclipse.cdt.utils.Addr64;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IIndexedValue;
import org.eclipse.debug.core.model.IVariable;
@ -165,9 +167,18 @@ public class CIndexedValue extends AbstractCValue implements IIndexedValue {
return address.toHexAddressString();
else if ( CVariableFormat.DECIMAL.equals( format ) )
return address.toString();
else if ( CVariableFormat.OCTAL.equals( format ) )
else if ( CVariableFormat.OCTAL.equals( format ) ) {
// Using the instanceof operator here to avoid API change
// Add IAddress.toOctalAddressString() in a future CDT release
if (address instanceof Addr32) {
return ((Addr32)address).toOctalAddressString();
} else if (address instanceof Addr64) {
return ((Addr64)address).toOctalAddressString();
} else {
// Fall back to hexadecimal address format
return address.toHexAddressString();
else if ( CVariableFormat.BINARY.equals( format ) )
}
} else if ( CVariableFormat.BINARY.equals( format ) )
return address.toBinaryAddressString();
return null;
} catch (CDIException e) {

View file

@ -46,6 +46,8 @@ import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.utils.Addr32;
import org.eclipse.cdt.utils.Addr64;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
@ -632,9 +634,18 @@ public class CValue extends AbstractCValue {
return address.toHexAddressString();
else if ( CVariableFormat.DECIMAL.equals( format ) )
return address.toString();
else if ( CVariableFormat.OCTAL.equals( format ) )
else if ( CVariableFormat.OCTAL.equals( format ) ) {
// Using the instanceof operator here to avoid API change
// Add IAddress.toOctalAddressString() in a future CDT release
if (address instanceof Addr32) {
return ((Addr32)address).toOctalAddressString();
} else if (address instanceof Addr64) {
return ((Addr64)address).toOctalAddressString();
} else {
// Fall back to hexadecimal address format
return address.toHexAddressString();
else if ( CVariableFormat.BINARY.equals( format ) )
}
} else if ( CVariableFormat.BINARY.equals( format ) )
return address.toBinaryAddressString();
return null;
}