From e7faaa6688bcc04f31f17284a6449de8ed98adbc Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Sat, 21 May 2011 00:44:42 +0000 Subject: [PATCH] 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. llvm-svn: 131773 --- .../Plugins/Disassembler/llvm/DisassemblerLLVM.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp index 9889484821e7..c2e0ef288f4a 100644 --- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp +++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp @@ -369,7 +369,16 @@ InstructionLLVM::Dump 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()); + } } }