mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 11:15:38 +02:00
[207549] - fixed NumberFormat exception too
This commit is contained in:
parent
62474d01f8
commit
5b65560b4a
1 changed files with 8 additions and 2 deletions
|
@ -44,7 +44,7 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue, ICDIPoin
|
||||||
public ArrayValue(Variable v, String hexAddress) {
|
public ArrayValue(Variable v, String hexAddress) {
|
||||||
super(v);
|
super(v);
|
||||||
if (hexAddress == null || hexAddress.trim().length()==0) {
|
if (hexAddress == null || hexAddress.trim().length()==0) {
|
||||||
this.hexAddress = "0";
|
return;
|
||||||
} else if (hexAddress.startsWith("0x") || hexAddress.startsWith("0X")) {
|
} else if (hexAddress.startsWith("0x") || hexAddress.startsWith("0X")) {
|
||||||
this.hexAddress = hexAddress.substring(2);
|
this.hexAddress = hexAddress.substring(2);
|
||||||
} else {
|
} else {
|
||||||
|
@ -102,6 +102,12 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue, ICDIPoin
|
||||||
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue()
|
* @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue()
|
||||||
*/
|
*/
|
||||||
public BigInteger pointerValue() throws CDIException {
|
public BigInteger pointerValue() throws CDIException {
|
||||||
return new BigInteger(hexAddress, 16);
|
if (hexAddress == null)
|
||||||
|
return null;
|
||||||
|
try {
|
||||||
|
return new BigInteger(hexAddress, 16);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue