| Summary: | [Memory View] new monitors added while Memory view is hidden or closed are not shown in the tree | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Sean Kennedy <seanpk> | ||||
| Component: | Debug | Assignee: | Platform-Debug-Inbox <platform-debug-inbox> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | boxall, chanskw, darin.eclipse, pawel.1.piech | ||||
| Version: | 3.6.1 | ||||||
| Target Milestone: | 3.6.2 | ||||||
| Hardware: | PC | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 326325 | ||||||
| Attachments: |
|
||||||
|
Description
Sean Kennedy
I enhanced the PDA example debugger with an action to add a memory block, and it works for me when the view is hidden, closed, or visible. I'm calling org.eclipse.debug.core.IMemoryBlockManager.addMemoryBlocks(IMemoryBlock[]). What API is your action using to register the memory block? we are also calling: org.eclipse.debug.core.IMemoryBlockManager.addMemoryBlocks(IMemoryBlock[]) then we create a rendering, initialize it and call: org.eclipse.debug.ui.memory.IMemoryRenderingContainer.addMemoryRendering(IMemoryRendering) This also works for me. Perhaps Samantha can shed more light on the API used to create/add a rendering. I was able to create and show a rendering using the following code - but I don't recall how one is supposed to obtain a rendering container (and know which one it is). I noticed that the memory monitor tree implements the IMemoryRenderingContainer, but it does nothing with renderings. My sample code does this:
IMemoryBlock block = target.getMemoryBlock(0, 1024);
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks(new IMemoryBlock[]{block});
IViewPart view = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_MEMORY_VIEW);
if (view != null) {
if (view instanceof IMemoryRenderingSite) {
IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager();
IMemoryRenderingType[] types = manager.getDefaultRenderingTypes(block);
IMemoryRendering rendering;
try {
rendering = types[0].createRendering();
IMemoryRenderingSite site = (IMemoryRenderingSite) view;
IMemoryRenderingContainer[] containers = site.getMemoryRenderingContainers();
rendering.init(containers[2], block);
containers[2].addMemoryRendering(rendering);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
our code works fine too when we do a: org.eclipse.ui.IWorkbenchPage.findView(String) to get the Memory view, add the monitor, then do a: org.eclipse.ui.IWorkbenchPage.showView(String) with 3.4, it worked fine when we just did the org.eclipse.ui.IWorkbenchPage.showView(String) first, then added the monitor and rendering to that we use showView, because findView returns null when the view is closed and then we have to do showView anyway (which demonstrates the same problem) though I do notice that you're doing the findView after addMemoryBlocks we were doing that before then ... yes - if I add the block before getting the view it works is that how it should always be done? were we just getting lucky with 3.4? The signature of org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider.updateNodes(IModelDelta[], int) changed in 3.6 - the "int" (mask) parameter was added to the method, and the subclass MemoryViewTreeModelContentProvider was not updated. Thus, it's implementation of updateNodes(IModelDelta[] nodes) was not being called. Created attachment 179663 [details]
patch
Released to 3.6.2. Fixed. Tested with CDt and it seems kosher now. |