Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorJohn Cortell2007-01-18 13:45:30 +0000
committerJohn Cortell2007-01-18 13:45:30 +0000
commitf02257b4dce2d4790855580948af7a35375711dc (patch)
tree5916f75af0588a20d17a81751e6353f974266814 /debug
parent4874e4d32145ef5f82e0a4502aefe53c1e32f7d4 (diff)
downloadorg.eclipse.cdt-f02257b4dce2d4790855580948af7a35375711dc.tar.gz
org.eclipse.cdt-f02257b4dce2d4790855580948af7a35375711dc.tar.xz
org.eclipse.cdt-f02257b4dce2d4790855580948af7a35375711dc.zip
Tweak to last change based on Mikhail's review.
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryBlockRetrievalExtension.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryBlockRetrievalExtension.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryBlockRetrievalExtension.java
index e4b442dcc96..43a2a8db38b 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryBlockRetrievalExtension.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CMemoryBlockRetrievalExtension.java
@@ -15,6 +15,7 @@ import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.IAddress;
+import org.eclipse.cdt.core.IAddressFactory;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.cdi.CDIException;
@@ -152,13 +153,11 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
}
// See if the expression is a simple numeric value; if it is, we can avoid some costly
- // processing (calling the backend to resolve the expression)
+ // processing (avoid calling the backend to resolve the expression)
try {
- if (expression.startsWith("0x") && expression.length() > 2) {
- return new CMemoryBlockExtension((CDebugTarget)target, expression, new BigInteger(expression.substring(2), 16));
- } else if (Character.isDigit(expression.charAt(0))) {
- return new CMemoryBlockExtension((CDebugTarget)target, expression, new BigInteger(expression));
- }
+ IAddressFactory addrFactory = ((CDebugTarget)target).getAddressFactory();
+ String hexstr = addrFactory.createAddress(expression).toString(16);
+ return new CMemoryBlockExtension((CDebugTarget)target, expression, new BigInteger(hexstr, 16));
} catch (NumberFormatException nfexc) {
// OK, expression is not a simple, absolute numeric value; keep trucking and try to resolve as expression
}

Back to the top