[Lldb-commits] [lldb] r131773 - /lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp

Johnny Chen johnny.chen at apple.com
Fri May 20 17:44:42 PDT 2011


Author: johnny
Date: Fri May 20 19:44:42 2011
New Revision: 131773

URL: http://llvm.org/viewvc/llvm-project?rev=131773&view=rev
Log:
When in non-raw mode and edis fails to parse the tokens of the instruction, output
the raw disassembly so that the opcode aligns with the edis'ed disassembly.

Modified:
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=131773&r1=131772&r2=131773&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp Fri May 20 19:44:42 2011
@@ -369,7 +369,16 @@
 
         if (EDGetInstString(&str, m_inst)) // 0 on success
             return;
-        s->Write(str, strlen(str) - 1);
+        if (raw)
+          s->Write(str, strlen(str) - 1);
+        else
+        {
+            // EDis fails to parse the tokens of this inst.  Need to align this
+            // raw disassembly with the rest of output.
+            llvm::StringRef raw_disasm(str);
+            StripSpaces(raw_disasm);
+            s->PutCString(raw_disasm.str().c_str());
+        }
     }
 }
 





More information about the lldb-commits mailing list