1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Bug 309032: Need APIs to support memory pages (oversight; was dropping rendering name in label when memory space is involved).

This commit is contained in:
John Cortell 2010-05-19 14:55:36 +00:00
parent b53055056d
commit 2211e870c6

View file

@ -465,13 +465,11 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
// interface.
String label = rendering.getLabel();
// We create all memory blocks using address 0 regardless of where the
// user wants to see memory. We then go-to the requested location. So,
// if we rely on the default rendering label, all tabs will show
// address zero, which will be confusing. To avoid this, the rendering
// object should implement this interface that allows us to get to the
// first address being shown. We'll use that for the label
if (rendering instanceof IMemoryRenderingViewportProvider) {
// If the rendering provides access to its viewport address (the first
// address shown in the rendering, subject to scrolling), display that
// in the tab rather than the expression that was used when the tab was
// first created.
if (rendering instanceof IMemoryRenderingViewportProvider) {
BigInteger viewportAddress = ((IMemoryRenderingViewportProvider)rendering).getViewportAddress();
// The base label generation puts the rendering type name in "<>" and
@ -489,7 +487,7 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
if (memorySpaceID != null) {
IMemoryBlockRetrieval retrieval = (IMemoryBlockRetrieval) tab.getParent().getData(KEY_RETRIEVAL);
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
label = ((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).encodeAddress("0x" + viewportAddress.toString(16), memorySpaceID);
label = ((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).encodeAddress("0x" + viewportAddress.toString(16), memorySpaceID) + ' ' + renderingType;
}
}
if (label == null) {