mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42: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:
parent
5c919ac834
commit
0f6719cc71
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.dsf.mi.service;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
@ -1915,7 +1916,7 @@ public class MIVariableManager implements ICommandControl {
|
|||
// convert from binary to decimal
|
||||
if (value.startsWith("0b")) value = value.substring(2, value.length()); //$NON-NLS-1$
|
||||
try {
|
||||
value = Integer.toString(Integer.parseInt(value, 2));
|
||||
value = new BigInteger(value, 2).toString();
|
||||
} catch (NumberFormatException e) {
|
||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE,
|
||||
"Invalid binary number: " + value, e)); //$NON-NLS-1$
|
||||
|
|
Loading…
Add table
Reference in a new issue