1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

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
This commit is contained in:
Alvaro Sanchez-Leon 2017-02-08 09:12:53 -05:00
parent 11ccc87055
commit 74aa6f4e71
3 changed files with 22 additions and 4 deletions

View file

@ -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.

View file

@ -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<BigInteger, List<IMemoryBlockAddressInfoItem>> getVisibleValueToAddressInfoItems() {
IMemoryBlockAddressInfoItem[] items = fAddressInfoItems;
if (items == null || !fParent.isShowCrossRefInfoGlobalPref()) {
if (items == null || !isShowCrossReferenceInfo()) {
fMapStartAddrToInfoItems.clear();
fMapAddrToInfoItems.clear();
return fMapStartAddrToInfoItems;

View file

@ -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