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:
parent
d6bcb20759
commit
88faee0afe
1 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||||
|
@ -399,4 +403,4 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
|
||||||
memorySpaceID_out.append(str.substring(0, index));
|
memorySpaceID_out.append(str.substring(0, index));
|
||||||
return new BigInteger(str.substring(index+3), 16);
|
return new BigInteger(str.substring(index+3), 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue