Bug 572880: Display an ellipsis if opcode is wider than column

Instead of silently having opcode bytes not display, show an ellipsis
in the last column of the opcodes if the length required for that line
is too long.

Change-Id: If1379846c2dd7111324933c2bd72244f6abade02
This commit is contained in:
Jonah Graham 2021-05-18 13:41:15 -04:00
parent 17cabff257
commit 2443cfbeff

View file

@ -55,7 +55,11 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
if (pos instanceof DisassemblyPosition && pos.length > 0 && pos.offset == offset && pos.fValid) {
DisassemblyPosition disassPos = (DisassemblyPosition) pos;
if (disassPos.fRawOpcode != null) {
return disassPos.fRawOpcode;
if (disassPos.fRawOpcode.length() > nChars) {
return disassPos.fRawOpcode.substring(0, nChars - 1) + ""; //$NON-NLS-1$
} else {
return disassPos.fRawOpcode;
}
}
} else if (pos != null && !pos.fValid) {
return DOTS.substring(0, nChars);