1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 435606: Using BigInteger instead of Integer makes it possible to

write unsigned variables (UINT32 and UINT64) in the binary format.

Change-Id: Ic9de8470cef10469eae28b3c99ced1d9d3027685
Signed-off-by: Martin Schreiber <m.schreiber@bachmann.info>
Reviewed-on: https://git.eclipse.org/r/27252
Reviewed-by: Teodor Madan <teodor.madan@freescale.com>
Tested-by: Teodor Madan <teodor.madan@freescale.com>
This commit is contained in:
Martin Schreiber 2014-05-26 08:34:51 +02:00 committed by Teodor Madan
parent 5c919ac834
commit 0f6719cc71

View file

@ -19,6 +19,7 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service; package org.eclipse.cdt.dsf.mi.service;
import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -1915,7 +1916,7 @@ public class MIVariableManager implements ICommandControl {
// convert from binary to decimal // convert from binary to decimal
if (value.startsWith("0b")) value = value.substring(2, value.length()); //$NON-NLS-1$ if (value.startsWith("0b")) value = value.substring(2, value.length()); //$NON-NLS-1$
try { try {
value = Integer.toString(Integer.parseInt(value, 2)); value = new BigInteger(value, 2).toString();
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE, rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE,
"Invalid binary number: " + value, e)); //$NON-NLS-1$ "Invalid binary number: " + value, e)); //$NON-NLS-1$