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 c84874aea0b..57ef5b53d08 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 @@ -161,9 +161,11 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM BigInteger addrBigInt = null; String memorySpaceID = null; if (hasMemorySpaces()) { + // Can't tell if block was created with a memory-space/address or with an expression. + // Assume the former and let an exception in the decoding tell us otherwise ICDITarget cdiTarget = fDebugTarget.getCDITarget(); - StringBuffer sbuf = new StringBuffer(); try { + StringBuffer sbuf = new StringBuffer(); addrBigInt = ((ICDIMemorySpaceManagement)cdiTarget).stringToAddress(memBlockExt.getExpression(), sbuf); if (addrBigInt == null) { // Client wants our default decoding; minimum is ":0x?" @@ -171,10 +173,12 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM } memorySpaceID = sbuf.toString(); } - catch( CDIException e ) { - CDebugCorePlugin.log( e ); + catch( CDIException e ) { // thrown by CDI client decoding method addrBigInt = null; } + catch (CoreException e) { + addrBigInt = null; // thrown by our decoding method + } } Element child = document.createElement( MEMORY_BLOCK_EXPRESSION ); @@ -218,7 +222,7 @@ 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 (avoid calling the backend to resolve the expression) + // processing (calling the backend to resolve the expression) try { IAddressFactory addrFactory = ((CDebugTarget)target).getAddressFactory(); String hexstr = addrFactory.createAddress(expression).toString(16); @@ -399,4 +403,4 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM memorySpaceID_out.append(str.substring(0, index)); return new BigInteger(str.substring(index+3), 16); } -} \ No newline at end of file +}