mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-10 01:35:39 +02:00
Fix for bug 81698: NumberFormatException in CValue.
This commit is contained in:
parent
86e2679474
commit
4389ea8a9b
2 changed files with 42 additions and 30 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2004-12-20 Mikhail Khodjaiants
|
||||||
|
Fix for bug 81698: NumberFormatException in CValue.
|
||||||
|
* CValue.java
|
||||||
|
|
||||||
2004-12-16 Mikhail Khodjaiants
|
2004-12-16 Mikhail Khodjaiants
|
||||||
Fix for bug 81381: Deadlock when single stepping.
|
Fix for bug 81381: Deadlock when single stepping.
|
||||||
* CThread.java
|
* CThread.java
|
||||||
|
|
|
@ -271,45 +271,53 @@ public class CValue extends AbstractCValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLongValueString( ICDILongValue value ) throws CDIException {
|
private String getLongValueString( ICDILongValue value ) throws CDIException {
|
||||||
CVariableFormat format = getParentVariable().getFormat();
|
try {
|
||||||
if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
|
CVariableFormat format = getParentVariable().getFormat();
|
||||||
if ( isUnsigned() ) {
|
if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
|
||||||
BigInteger bigValue = new BigInteger( value.getValueString() );
|
if ( isUnsigned() ) {
|
||||||
return bigValue.toString();
|
BigInteger bigValue = new BigInteger( value.getValueString() );
|
||||||
|
return bigValue.toString();
|
||||||
|
}
|
||||||
|
return Long.toString( value.longValue() );
|
||||||
|
}
|
||||||
|
else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
|
||||||
|
StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
|
||||||
|
if ( isUnsigned() ) {
|
||||||
|
BigInteger bigValue = new BigInteger( value.getValueString() );
|
||||||
|
sb.append( bigValue.toString( 16 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.append( Long.toHexString( value.longValue() ) );
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
return Long.toString( value.longValue() );
|
|
||||||
}
|
}
|
||||||
else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
|
catch( NumberFormatException e ) {
|
||||||
StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
|
|
||||||
if ( isUnsigned() ) {
|
|
||||||
BigInteger bigValue = new BigInteger( value.getValueString() );
|
|
||||||
sb.append( bigValue.toString( 16 ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sb.append( Long.toHexString( value.longValue() ) );
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getLongLongValueString( ICDILongLongValue value ) throws CDIException {
|
private String getLongLongValueString( ICDILongLongValue value ) throws CDIException {
|
||||||
CVariableFormat format = getParentVariable().getFormat();
|
try {
|
||||||
if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
|
CVariableFormat format = getParentVariable().getFormat();
|
||||||
if ( isUnsigned() ) {
|
if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) {
|
||||||
BigInteger bigValue = new BigInteger( value.getValueString() );
|
if ( isUnsigned() ) {
|
||||||
return bigValue.toString();
|
BigInteger bigValue = new BigInteger( value.getValueString() );
|
||||||
|
return bigValue.toString();
|
||||||
|
}
|
||||||
|
return Long.toString( value.longValue() );
|
||||||
|
}
|
||||||
|
else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
|
||||||
|
StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
|
||||||
|
if ( isUnsigned() ) {
|
||||||
|
BigInteger bigValue = new BigInteger( value.getValueString() );
|
||||||
|
sb.append( bigValue.toString( 16 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.append( Long.toHexString( value.longValue() ) );
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
return Long.toString( value.longValue() );
|
|
||||||
}
|
}
|
||||||
else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) {
|
catch( NumberFormatException e ) {
|
||||||
StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$
|
|
||||||
if ( isUnsigned() ) {
|
|
||||||
BigInteger bigValue = new BigInteger( value.getValueString() );
|
|
||||||
sb.append( bigValue.toString( 16 ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
sb.append( Long.toHexString( value.longValue() ) );
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue