Skip to main content

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 15:40
elin is currently offline elinFriend
Messages: 7
Registered: July 2009
Junior Member

I have a question about how to use the Memory View in Eclipse
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)
IViewPart view =

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

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

IMemoryRenderingContainer container = memoryView.getContainer(
DebugUIPlugin.getUniqueIdentifier() +
container.addMemoryRendering(rendering); // <-------------
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: Tue Jun 19 03:33:50 GMT 2018

Powered by FUDForum. Page generated in 0.01624 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top