Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schreiber2014-05-26 06:34:51 +0000
committerTeodor Madan2014-05-26 08:30:47 +0000
commit0f6719cc7184360281e3aed236c7b8cb7c4466af (patch)
tree21d0c5b03738737b32600e687ee5ee7259b9dd38
parent5c919ac8349c3c55a1c889bc39f7aabc1a5c3a05 (diff)
downloadorg.eclipse.cdt-0f6719cc7184360281e3aed236c7b8cb7c4466af.tar.gz
org.eclipse.cdt-0f6719cc7184360281e3aed236c7b8cb7c4466af.tar.xz
org.eclipse.cdt-0f6719cc7184360281e3aed236c7b8cb7c4466af.zip
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>
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
index 6796e63dc8c..c1444ae16b8 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java
@@ -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$

Back to the top