Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » use Memory View programmatically
use Memory View programmatically [message #300594] Mon, 13 March 2006 10:40
elin is currently offline elin
Messages: 7
Registered: July 2009
Junior Member
Hello,

I have a question about how to use the Memory View in Eclipse
programmatically.
I want to read/display memory for a given address using the Memory View.

So far I have been following the advice given in the Bugzilla Bug 87374:
>To programatically open the memory
>view:> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().showView >("org.eclipse.debug.ui.MemoryView");>>To
>add memory blocks to the view, you need to add memory blocks to the memory
> >block
>manager:>> DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBl ocks(new
> >IMemoryBlock[] {memoryBlocks});>>In addition to persisting the memory
>blocks, you may also want to persist the >renderings that are opened. You
>will need to persist the rendering id and id >of the containers in which a
>rendering is hosted.>>IViewPart part =
>PlatformUI.getWorkbench().getActiveWorkbenchWindow>().getActivePage().showView( "org.eclipse.debug.ui.memoryview");>IMemoryRenderingSite
>memoryView = (IMemoryRenderingSite)part;>IMemoryRenderingContainer
>container = memoryView.getContainer("containerId");>IMemoryRendering[]
>renderings = container.getRenderings[];>>When restoring the renderings, you
>will need to create the rendering, and add >the rendering to the
>appropriate container within the memory view.>>To create a
>rendering:>IMemoryRenderingType renderingType =
>DebugUITools.getMemoryRenderingManager>().getRenderingType( "rendeirng
>id");>IMemoryRendering rendering = renderingType.createRendering();>>Then
>to add the rendering to the Memory View:>IViewPart part =
>PlatformUI.getWorkbench().getActiveWorkbenchWindow>().getActivePage().showView( "org.eclipse.debug.ui.memoryview");>IMemoryRenderingSite
>memoryView = (IMemoryRenderingSite)part;>IMemoryRenderingContainer
>container =
>memoryView.getContainer("containerId");>container.addMemoryRendering(rendering); >>Hope
>this helps...>Samantha

If my IMemoryBlock implementation is correctly implemented and I have added
it with
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBl ocks(),
wouldn't that be enough to render it with the default "raw" memory renderer?

I could not get this to work, so I tried adding a memory renderer to a
memory rendering container,
but I can not get hold of a non-null container. What default memory
rendering containers are available?

My code so far looks like this (the container = null):


IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage();
if (page != null)
{
try
{
IViewPart view =
page.showView("org.eclipse.debug.ui.MemoryView");

IMemoryRenderingSite memoryView = (IMemoryRenderingSite) view;
MemoryBlockExtentsion mbe = new MemoryBlockExtentsion(new
DummyDebugTarget(), 0);
DebugPlugin.getDefault().getMemoryBlockManager().
addMemoryBlocks(new IMemoryBlock[] {mbe});

IMemoryRenderingType renderingType =
DebugUITools.getMemoryRenderingManager().
getRenderingType("org.eclipse.debug.ui.rendering.raw_memory ");
IMemoryRendering rendering = renderingType.createRendering();

IMemoryRenderingContainer container = memoryView.getContainer(
DebugUIPlugin.getUniqueIdentifier() +
".MemoryView.RenderingViewPane.1");
container.addMemoryRendering(rendering); // <-------------
null!!!
}
catch ...


In summary, what are the minimal steps required in order to display a block
of memory in the Memory View?


- Elin Karasalo
Previous Topic:how to view javadocs api information in eclipse
Next Topic:use Memory View programmatically
Goto Forum:
  


Current Time: Thu Jul 31 19:50:12 EDT 2014

Powered by FUDForum. Page generated in 0.08914 seconds