Skip to main content
summaryrefslogtreecommitdiffstats
path: root/memory
diff options
context:
space:
mode:
authorAnton Leherbauer2010-11-16 07:57:28 -0500
committerAnton Leherbauer2010-11-16 07:57:28 -0500
commitd09d23c02a92fb26a16a87290453c214dbbbf3d8 (patch)
tree2cd1d86c83311e22545a72713cc9a42c38125938 /memory
parent009a2d052308f4e0e2458a1da4e8767c0a899f84 (diff)
downloadorg.eclipse.cdt-d09d23c02a92fb26a16a87290453c214dbbbf3d8.tar.gz
org.eclipse.cdt-d09d23c02a92fb26a16a87290453c214dbbbf3d8.tar.xz
org.eclipse.cdt-d09d23c02a92fb26a16a87290453c214dbbbf3d8.zip
Bug 330342 - Memory Browser does not work when memory block retrieval does not implement IAdaptable
Diffstat (limited to 'memory')
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
index 58dd43424f..fae795178b 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
@@ -1152,17 +1152,20 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
*/
private IMemoryBlockExtension createMemoryBlock(IMemoryBlockRetrieval retrieval, String expression, Object context, String memorySpaceID) throws DebugException {
IMemoryBlockExtension block = null;
- if(retrieval instanceof IAdaptable) {
- IMemoryBlockRetrievalExtension retrievalExtension = (IMemoryBlockRetrievalExtension)((IAdaptable) retrieval).getAdapter(IMemoryBlockRetrievalExtension.class);
- if (retrievalExtension != null) {
- if (retrievalExtension instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
- block = ((IMemorySpaceAwareMemoryBlockRetrieval)retrievalExtension).getMemoryBlock(expression, context, memorySpaceID);
- }
- else {
- block = retrievalExtension.getExtendedMemoryBlock(expression, context);
- }
- }
+ IMemoryBlockRetrievalExtension retrievalExtension = null;
+ if (retrieval instanceof IMemoryBlockRetrievalExtension) {
+ retrievalExtension = (IMemoryBlockRetrievalExtension) retrieval;
+ } else if(retrieval instanceof IAdaptable) {
+ retrievalExtension = (IMemoryBlockRetrievalExtension)((IAdaptable) retrieval).getAdapter(IMemoryBlockRetrievalExtension.class);
}
+ if (retrievalExtension != null) {
+ if (retrievalExtension instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
+ block = ((IMemorySpaceAwareMemoryBlockRetrieval)retrievalExtension).getMemoryBlock(expression, context, memorySpaceID);
+ }
+ else {
+ block = retrievalExtension.getExtendedMemoryBlock(expression, context);
+ }
+ }
if ( block == null ) {
throw new DebugException(new Status(Status.ERROR, MemoryBrowserPlugin.PLUGIN_ID, "Extended Memory Block could not be obtained")); //$NON-NLS-1$
}

Back to the top