Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-debug-dev] Memory View: Memory renderings that work in Eclipse 3.1 -> do not work in 3.2

Hi,

I use this class (below) for displaying memory with the Memory Viewer in

Eclipse 3.1.
However when using the same class in Eclipse 3.2, this does not work.
Nothing happens. The Memory View opens, but it is empty and there are no

exceptions, error messages or anything.

What am I missing? What has been changed between 3.1 and 3.2 to cause
this?

I am grateful to get some help.


- Elin Karasalo



__________________________________________________________________

public abstract class AbstractShowMemoryAction extends Action
{
   protected static final String ID_MEMORY_VIEW =
      "org.eclipse.debug.ui.MemoryView";

   protected static final String ID_RENDERING_RAW_MEMORY =
      "org.eclipse.debug.ui.rendering.raw_memory";

   protected static final String ID_RENDERING_VIEW_PANE =
      "org.eclipse.debug.ui.MemoryView.RenderingViewPane.1";

   public AbstractShowMemoryAction(String text)
   {
      super(text);
   }

   protected void showMemory(Target target, int pid, long address)
      throws CoreException
   {
      IWorkbenchPage page =
 
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
      if (page != null)
      {
         IViewPart view = page.showView(ID_MEMORY_VIEW);
         if (view instanceof IMemoryRenderingSite)
         {
            OseDebugTarget debugTarget =
               OseDebugTarget.createDebugTarget(target);
            if (debugTarget != null)
            {
               IMemoryBlock memoryBlock;
               IMemoryRenderingType renderingType;

               memoryBlock = debugTarget.getMemoryBlockRetrieval().
                  getExtendedMemoryBlock(pid, address);
               DebugPlugin.getDefault().getMemoryBlockManager().
                  addMemoryBlocks(new IMemoryBlock[] {memoryBlock});
               renderingType = DebugUITools.getMemoryRenderingManager().
                  getRenderingType(ID_RENDERING_RAW_MEMORY);
               if (renderingType != null)
               {
                  IMemoryRenderingContainer renderingContainer =
                     ((IMemoryRenderingSite) view).getContainer(
 
ID_RENDERING_VIEW_PANE);
                  if (renderingContainer != null)
                  {
                     IMemoryRendering rendering = renderingType.
 
createRendering();
                     rendering.init(renderingContainer, memoryBlock);
                     renderingContainer.addMemoryRendering(rendering);
                  }
               }
            }
         }
      }
   }
}



Back to the top