Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorAnton Leherbauer2014-03-31 09:41:38 +0000
committerAnton Leherbauer2014-03-31 09:44:35 +0000
commit7d147536f33d2e09afc25783798ab40685a97081 (patch)
treec7f56e1e31b99bb98d92e4525a650cfc1d20a60c /dsf
parent4d2a57889c4452186067f95f55ddefc9d54cc5d6 (diff)
downloadorg.eclipse.cdt-7d147536f33d2e09afc25783798ab40685a97081.tar.gz
org.eclipse.cdt-7d147536f33d2e09afc25783798ab40685a97081.tar.xz
org.eclipse.cdt-7d147536f33d2e09afc25783798ab40685a97081.zip
Limit opcode ruler width to max 20 chars
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
index bfcf196172f..923bc1be350 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/OpcodeRulerColumn.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2014 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,6 +26,9 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
public static final String ID = "org.eclipse.cdt.dsf.ui.disassemblyColumn.opcode"; //$NON-NLS-1$
+ /** Maximum width of column (in characters) */
+ private static final int MAXWIDTH= 20;
+
private int fRadix;
private String fRadixPrefix;
@@ -82,6 +85,8 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
for (int i=str.length()+prefixLength; i < nChars; ++i)
buf.append('0');
buf.append(str);
+ if (buf.length() > nChars)
+ buf.delete(nChars, buf.length());
return buf.toString();
}
} else if (pos != null && !pos.fValid) {
@@ -97,7 +102,7 @@ public class OpcodeRulerColumn extends DisassemblyRulerColumn {
@Override
protected int computeNumberOfCharacters() {
DisassemblyDocument doc = (DisassemblyDocument)getParentRuler().getTextViewer().getDocument();
- return doc.getMaxOpcodeLength(fRadix);
+ return Math.min(MAXWIDTH, doc.getMaxOpcodeLength(fRadix));
}
@Override

Back to the top