[Lldb-commits] [lldb] r161382 - in /lldb/trunk: include/lldb/Core/Opcode.h source/Core/Disassembler.cpp source/Core/Opcode.cpp source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

Sean Callanan scallanan at apple.com
Mon Aug 6 18:44:58 PDT 2012


Author: spyffe
Date: Mon Aug  6 20:44:58 2012
New Revision: 161382

URL: http://llvm.org/viewvc/llvm-project?rev=161382&view=rev
Log:
Changed the Opcode::GetData() API so that it didn't
require an AddressClass, which is useless at this
point since it already knows the distinction between
32-bit Thumb opcodes and 32-bit ARM opcodes.

Modified:
    lldb/trunk/include/lldb/Core/Opcode.h
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Core/Opcode.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp

Modified: lldb/trunk/include/lldb/Core/Opcode.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Opcode.h?rev=161382&r1=161381&r2=161382&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Opcode.h (original)
+++ lldb/trunk/include/lldb/Core/Opcode.h Mon Aug  6 20:44:58 2012
@@ -225,8 +225,7 @@
         
         // Get the opcode exactly as it would be laid out in memory.
         uint32_t
-        GetData (DataExtractor &data,
-                 lldb::AddressClass address_class) const;
+        GetData (DataExtractor &data) const;
 
     protected:
 

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=161382&r1=161381&r2=161382&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Mon Aug  6 20:44:58 2012
@@ -893,7 +893,7 @@
 uint32_t
 Instruction::GetData (DataExtractor &data)
 {
-    return m_opcode.GetData(data, GetAddressClass ());
+    return m_opcode.GetData(data);
 }
 
 InstructionList::InstructionList() :

Modified: lldb/trunk/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Opcode.cpp?rev=161382&r1=161381&r2=161382&view=diff
==============================================================================
--- lldb/trunk/source/Core/Opcode.cpp (original)
+++ lldb/trunk/source/Core/Opcode.cpp Mon Aug  6 20:44:58 2012
@@ -86,7 +86,7 @@
 }
 
 uint32_t
-Opcode::GetData (DataExtractor &data, lldb::AddressClass address_class) const
+Opcode::GetData (DataExtractor &data) const
 {
     uint32_t byte_size = GetByteSize ();
     
@@ -101,12 +101,6 @@
             case Opcode::eType8:    buffer_sp.reset (new DataBufferHeap (&m_data.inst8,  byte_size)); break;
             case Opcode::eType16:   buffer_sp.reset (new DataBufferHeap (&m_data.inst16, byte_size)); break;
             case Opcode::eType16_2:
-            case Opcode::eType32:
-                // The only thing that uses eAddressClassCodeAlternateISA currently
-                // is Thumb. If this ever changes, we will need to pass in more
-                // information like an additional "const ArchSpec &arch". For now
-                // this will do
-                if (m_type ==  Opcode::eType16_2 || address_class == eAddressClassCodeAlternateISA)
                 {
                     // 32 bit thumb instruction, we need to sizzle this a bit
                     uint8_t buf[4];
@@ -116,10 +110,9 @@
                     buf[3] = m_data.inst.bytes[1];
                     buffer_sp.reset (new DataBufferHeap (buf, byte_size));
                 }
-                else
-                {
-                    buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size));
-                }
+                break;
+            case Opcode::eType32:
+                buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size));
                 break;
             case Opcode::eType64:   buffer_sp.reset (new DataBufferHeap (&m_data.inst64, byte_size)); break;
             case Opcode::eTypeBytes:buffer_sp.reset (new DataBufferHeap (GetOpcodeBytes(), byte_size)); break;

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=161382&r1=161381&r2=161382&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Mon Aug  6 20:44:58 2012
@@ -198,7 +198,7 @@
         DataExtractor data;
         const AddressClass address_class = GetAddressClass ();
 
-        if (m_opcode.GetData(data, address_class))
+        if (m_opcode.GetData(data))
         {
             char out_string[512];
             





More information about the lldb-commits mailing list