From 7a37c1ec4c49f28d472872f88d1a4e2ad1c08bc2 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Fri, 4 Jan 2013 23:52:35 +0000 Subject: [PATCH] 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 --- lldb/source/Core/Disassembler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index 6da90c275a8b..08d6d9a5ac07 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());