summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-01-04 23:52:35 +0000
committerJason Molenda <jmolenda@apple.com>2013-01-04 23:52:35 +0000
commit7a37c1ec4c49f28d472872f88d1a4e2ad1c08bc2 (patch)
tree3b0e4607a2d0041fd425d69f0346153a910a3d7a
parenta49cf10737535b668f961e0cd82a86a684d9aea8 (diff)
downloadbcm5719-llvm-7a37c1ec4c49f28d472872f88d1a4e2ad1c08bc2.tar.gz
bcm5719-llvm-7a37c1ec4c49f28d472872f88d1a4e2ad1c08bc2.zip
<rdar://problem/12389806>
Have the disassembler's Instruction::Dump always insert at least one space character between an opcode and its arguments, don't let a long opcode name abut the arguments. llvm-svn: 171561
-rw-r--r--lldb/source/Core/Disassembler.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 6da90c275a8..08d6d9a5ac0 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -541,7 +541,7 @@ Instruction::Dump (lldb_private::Stream *s,
bool show_bytes,
const ExecutionContext* exe_ctx)
{
- const size_t opcode_column_width = 7;
+ size_t opcode_column_width = 7;
const size_t operand_column_width = 25;
CalculateMnemonicOperandsAndCommentIfNeeded (exe_ctx);
@@ -584,6 +584,14 @@ Instruction::Dump (lldb_private::Stream *s,
const size_t opcode_pos = ss.GetSize();
+ // The default opcode size of 7 characters is plenty for most architectures
+ // but some like arm can pull out the occasional vqrshrun.s16. We won't get
+ // consistent column spacing in these cases, unfortunately.
+ if (m_opcode_name.length() >= opcode_column_width)
+ {
+ opcode_column_width = m_opcode_name.length() + 1;
+ }
+
ss.PutCString (m_opcode_name.c_str());
ss.FillLastLineToColumn (opcode_pos + opcode_column_width, ' ');
ss.PutCString (m_mnemocics.c_str());
OpenPOWER on IntegriCloud