[Lldb-commits] [lldb] r180984 - <rdar://problem/13751683>

Greg Clayton gclayton at apple.com
Thu May 2 18:05:05 PDT 2013


Author: gclayton
Date: Thu May  2 20:05:04 2013
New Revision: 180984

URL: http://llvm.org/viewvc/llvm-project?rev=180984&view=rev
Log:
<rdar://problem/13751683> 

Make sure to handle all thumb variants correctly.


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

Modified: lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=180984&r1=180983&r2=180984&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Thu May  2 20:05:04 2013
@@ -615,9 +615,19 @@ DisassemblerLLVMC::DisassemblerLLVMC (co
     if (arch.GetTriple().getArch() == llvm::Triple::arm)
     {
         ArchSpec thumb_arch(arch);
-        thumb_arch.GetTriple().setArchName(llvm::StringRef("thumbv7"));
+        std::string thumb_arch_name (thumb_arch.GetTriple().getArchName().str());
+        // Replace "arm" with "thumb" so we get all thumb variants correct
+        if (thumb_arch_name.size() > 3)
+        {
+            thumb_arch_name.erase(0,3);
+            thumb_arch_name.insert(0, "thumb");
+        }
+        else
+        {
+            thumb_arch_name = "thumbv7";
+        }
+        thumb_arch.GetTriple().setArchName(llvm::StringRef(thumb_arch_name.c_str()));
         std::string thumb_triple(thumb_arch.GetTriple().getTriple());
-
         m_alternate_disasm_ap.reset(new LLVMCDisassembler(thumb_triple.c_str(), flavor, *this));
         if (!m_alternate_disasm_ap->IsValid())
         {





More information about the lldb-commits mailing list