mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug 333509 - More generic reference to IMemoryBlockRetrieval.
This commit is contained in:
parent
94e6baa3f7
commit
6b367bbecf
1 changed files with 5 additions and 7 deletions
|
@ -21,7 +21,6 @@ import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
|
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
|
||||||
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
import org.eclipse.cdt.dsf.datamodel.DMContexts;
|
||||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.model.DsfMemoryBlockRetrieval;
|
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions;
|
import org.eclipse.cdt.dsf.debug.service.IExpressions;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMData;
|
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMData;
|
||||||
|
@ -44,6 +43,7 @@ import org.eclipse.debug.core.model.IDebugElement;
|
||||||
import org.eclipse.debug.core.model.IMemoryBlock;
|
import org.eclipse.debug.core.model.IMemoryBlock;
|
||||||
import org.eclipse.debug.core.model.IMemoryBlockExtension;
|
import org.eclipse.debug.core.model.IMemoryBlockExtension;
|
||||||
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
|
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
|
||||||
|
import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
|
||||||
import org.eclipse.debug.ui.DebugUITools;
|
import org.eclipse.debug.ui.DebugUITools;
|
||||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||||
import org.eclipse.debug.ui.memory.IMemoryRendering;
|
import org.eclipse.debug.ui.memory.IMemoryRendering;
|
||||||
|
@ -87,10 +87,8 @@ public class DsfViewMemoryHandler extends AbstractHandler {
|
||||||
|
|
||||||
// This method was mostly lifted from the platform's AddMemoryBlockAction
|
// This method was mostly lifted from the platform's AddMemoryBlockAction
|
||||||
|
|
||||||
IMemoryRenderingType primaryType = DebugUITools.getMemoryRenderingManager().getPrimaryRenderingType(
|
IMemoryRenderingType primaryType = DebugUITools.getMemoryRenderingManager().getPrimaryRenderingType(memoryBlock);
|
||||||
memoryBlock);
|
IMemoryRenderingType renderingTypes[] = DebugUITools.getMemoryRenderingManager().getDefaultRenderingTypes(memoryBlock);
|
||||||
IMemoryRenderingType renderingTypes[] = DebugUITools.getMemoryRenderingManager().getDefaultRenderingTypes(
|
|
||||||
memoryBlock);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (primaryType != null) {
|
if (primaryType != null) {
|
||||||
|
@ -156,9 +154,9 @@ public class DsfViewMemoryHandler extends AbstractHandler {
|
||||||
IMemoryBlockRetrieval retrieval = (IMemoryBlockRetrieval) context.getAdapter(IMemoryBlockRetrieval.class);
|
IMemoryBlockRetrieval retrieval = (IMemoryBlockRetrieval) context.getAdapter(IMemoryBlockRetrieval.class);
|
||||||
if (retrieval == null && context instanceof IDebugElement)
|
if (retrieval == null && context instanceof IDebugElement)
|
||||||
retrieval = ((IDebugElement)context).getDebugTarget();
|
retrieval = ((IDebugElement)context).getDebugTarget();
|
||||||
if (retrieval == null || !(retrieval instanceof DsfMemoryBlockRetrieval))
|
if (retrieval == null || !(retrieval instanceof IMemoryBlockRetrievalExtension))
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
DsfMemoryBlockRetrieval dsfRetrieval = (DsfMemoryBlockRetrieval) retrieval;
|
IMemoryBlockRetrievalExtension dsfRetrieval = (IMemoryBlockRetrievalExtension) retrieval;
|
||||||
IMemoryBlockExtension memBlock = dsfRetrieval.getExtendedMemoryBlock(exprString, dmc);
|
IMemoryBlockExtension memBlock = dsfRetrieval.getExtendedMemoryBlock(exprString, dmc);
|
||||||
renderMemoryBlock(memBlock, memRendSite);
|
renderMemoryBlock(memBlock, memRendSite);
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
|
|
Loading…
Add table
Reference in a new issue