From 74aa6f4e71af08cc64151cbb1243ba3723dabeca Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Wed, 8 Feb 2017 09:12:53 -0500 Subject: [PATCH] Bug 509577 - [Traditional Rendering] Local variables enclosing markings may be wrong in Little Endian presentation The enclosing markings are meant to reflect contiguous regions of memory, however the current Little Endian representation in the traditional render modifies the memory map to attempt to reflect how the memory would be loaded into registers with a size matching the cell size. The markings are therefore unsuitable for for this special case, this change removes these markings when the Little Endian formatting is selected. Change-Id: I1d7879f8b23329b33e2b17e8c8444d1266b9ef0a --- .../debug/ui/memory/traditional/Rendering.java | 17 +++++++++++++++++ .../traditional/RenderingAddressInfo.java | 6 +++--- .../traditional/TraditionalRendering.java | 3 ++- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java index 71c3ec2395d..7b42094bbc6 100755 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java @@ -41,6 +41,7 @@ import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil; import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressComposite; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.IDialogConstants; +import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.swt.SWT; import org.eclipse.swt.dnd.Clipboard; @@ -1894,6 +1895,9 @@ public class Rendering extends Composite implements IDebugEventSetListener Display.getDefault().asyncExec(new Runnable(){ public void run() { + if (isShowCrossReferenceInfo()) { + resolveAddressInfoForCurrentSelection(); + } layoutPanes(); } }); @@ -2345,6 +2349,19 @@ public class Rendering extends Composite implements IDebugEventSetListener return fMapStartAddrToInfoItems; } + /** + * @since 1.5 + */ + protected boolean isShowCrossReferenceInfo() { + // Check settings in preference store + IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore(); + boolean prefShowInfo = store.getBoolean(TraditionalRenderingPreferenceConstants.MEM_CROSS_REFERENCE_INFO); + + // Cross Reference information can not be properly highlighted for a Little Endian display + // see Bug 509577 - [Traditional Rendering] Local variable enclosing markings may be wrong in Little Endian presentation + return (!isDisplayLittleEndian() && prefShowInfo); + } + /** * Provides a string with the information relevant to a given address, the separator helps to format it * e.g. Separated items by comma, new line, etc. diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java index 8700ba63b67..55126934bbc 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/RenderingAddressInfo.java @@ -217,7 +217,7 @@ public class RenderingAddressInfo extends Rendering } private void handleDebugContextChanged(final Object context) { - if (isDisposed() || context == null || !fParent.isShowCrossRefInfoGlobalPref()) { + if (isDisposed() || context == null || !isShowCrossReferenceInfo()) { // Invalid context or user has chosen not to see additional address information return; } @@ -246,7 +246,7 @@ public class RenderingAddressInfo extends Rendering final IMemoryBlockAddressInfoItem[] addressInfoItems = getAllAddressInfoItems(); - if (fParent.isShowCrossRefInfoGlobalPref()) { + if (isShowCrossReferenceInfo()) { final String[] types = getAddressInfoItemTypes(); if (!display.isDisposed()) { @@ -334,7 +334,7 @@ public class RenderingAddressInfo extends Rendering @Override Map> getVisibleValueToAddressInfoItems() { IMemoryBlockAddressInfoItem[] items = fAddressInfoItems; - if (items == null || !fParent.isShowCrossRefInfoGlobalPref()) { + if (items == null || !isShowCrossReferenceInfo()) { fMapStartAddrToInfoItems.clear(); fMapAddrToInfoItems.clear(); return fMapStartAddrToInfoItems; diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java index c8668add513..e1980d039df 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/TraditionalRendering.java @@ -782,6 +782,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe /** * @since 1.4 + * @deprecated - use: {@link Rendering#isShowCrossReferenceInfo()} */ public boolean isShowCrossRefInfoGlobalPref() { IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore(); @@ -1264,7 +1265,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe // if there is cross reference info types available // add Actions to allow the user to toggle the visibility for each of them - if (isShowCrossRefInfoGlobalPref()) { + if (fRendering.isShowCrossReferenceInfo()) { Action[] dynamicActions = fRendering.getDynamicActions(); if (dynamicActions != null) { sub = new MenuManager(TraditionalRenderingMessages