1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Fix to memory space support. Monitors created with expressions were not restored for CDI clients with memory spaces.

This commit is contained in:
John Cortell 2007-02-13 13:10:08 +00:00
parent d6bcb20759
commit 88faee0afe

View file

@ -161,9 +161,11 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
BigInteger addrBigInt = null; BigInteger addrBigInt = null;
String memorySpaceID = null; String memorySpaceID = null;
if (hasMemorySpaces()) { 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(); ICDITarget cdiTarget = fDebugTarget.getCDITarget();
StringBuffer sbuf = new StringBuffer();
try { try {
StringBuffer sbuf = new StringBuffer();
addrBigInt = ((ICDIMemorySpaceManagement)cdiTarget).stringToAddress(memBlockExt.getExpression(), sbuf); addrBigInt = ((ICDIMemorySpaceManagement)cdiTarget).stringToAddress(memBlockExt.getExpression(), sbuf);
if (addrBigInt == null) { if (addrBigInt == null) {
// Client wants our default decoding; minimum is "<space>:0x?" // Client wants our default decoding; minimum is "<space>:0x?"
@ -171,10 +173,12 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
} }
memorySpaceID = sbuf.toString(); memorySpaceID = sbuf.toString();
} }
catch( CDIException e ) { catch( CDIException e ) { // thrown by CDI client decoding method
CDebugCorePlugin.log( e );
addrBigInt = null; addrBigInt = null;
} }
catch (CoreException e) {
addrBigInt = null; // thrown by our decoding method
}
} }
Element child = document.createElement( MEMORY_BLOCK_EXPRESSION ); 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 // 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 { try {
IAddressFactory addrFactory = ((CDebugTarget)target).getAddressFactory(); IAddressFactory addrFactory = ((CDebugTarget)target).getAddressFactory();
String hexstr = addrFactory.createAddress(expression).toString(16); String hexstr = addrFactory.createAddress(expression).toString(16);