From 7436cb9ae4ae04300dca893bf5dfbc4f92abbe27 Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Thu, 12 May 2016 14:04:37 -0400 Subject: [PATCH] Bug 489512 - Show local variables in the traditional memory render * Added an adjustment to the calculation of the addressable char width so it does not go beyond the containing cell size when using radixes where the number of characters does not grow linearly with the number of octets being represented. This adjustment is only necessary when the cell can contain the same number of octets as the addressable size Change-Id: Ic9643c98094bc28621e6807eeed0c283dbe6672a --- .../eclipse/cdt/debug/ui/memory/traditional/DataPane.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/DataPane.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/DataPane.java index 3e13968dbb8..6c59d75c93d 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/DataPane.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/DataPane.java @@ -507,6 +507,13 @@ public class DataPane extends AbstractPane } // Prepare to enclose addresses with additional info in a rectangle int addressableWidth = getAddressableWidth(); + if (fRendering.getAddressableSize() == fRendering.getBytesPerColumn()) { + // When the cell size is dimensioned to enclose an addressable size, the width can not be larger + // than the containing cell, this adjustment is necessary when using radixes where the number of characters + // does not increase in proportion to the number of bytes e.g. octal, decimal, etc. + addressableWidth = getAddressableWidth() > getCellWidth() ? getCellWidth() : getAddressableWidth(); + } + assert addressableWidth > 0; // Initialize the dimensions for the rectangle