[Lldb-commits] [lldb] r171561 - /lldb/trunk/source/Core/Disassembler.cpp

Jason Molenda jmolenda at apple.com
Fri Jan 4 15:52:36 PST 2013


Author: jmolenda
Date: Fri Jan  4 17:52:35 2013
New Revision: 171561

URL: http://llvm.org/viewvc/llvm-project?rev=171561&view=rev
Log:
<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.


Modified:
    lldb/trunk/source/Core/Disassembler.cpp

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=171561&r1=171560&r2=171561&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Fri Jan  4 17:52:35 2013
@@ -541,7 +541,7 @@
                    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 @@
     
     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());





More information about the lldb-commits mailing list