[Lldb-commits] [lldb] r258289 - Some 32-bit arm corefiles on darwin may have their general purpose

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 19 21:17:13 PST 2016


Author: jmolenda
Date: Tue Jan 19 23:17:13 2016
New Revision: 258289

URL: http://llvm.org/viewvc/llvm-project?rev=258289&view=rev
Log:
Some 32-bit arm corefiles on darwin may have their general purpose
register set indicated by ARM_THREAD_STATE32 (value 9) instead of
the old ARM_THREAD_STATE (value 1); this patch changes lldb to
accept either register set flavor code.

<rdar://problem/24246257>

Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=258289&r1=258288&r2=258289&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Jan 19 23:17:13 2016
@@ -541,6 +541,7 @@ public:
             lldb::offset_t next_thread_state = offset + (count * 4);
             switch (flavor)
             {
+                case GPRAltRegSet:
                 case GPRRegSet:
                     for (uint32_t i=0; i<count; ++i)
                     {
@@ -5059,7 +5060,7 @@ ObjectFileMachO::GetEntryPointAddress ()
                         switch (m_header.cputype)
                         {
                         case llvm::MachO::CPU_TYPE_ARM:
-                           if (flavor == 1) // ARM_THREAD_STATE from mach/arm/thread_status.h
+                           if (flavor == 1 || flavor == 9) // ARM_THREAD_STATE/ARM_THREAD_STATE32 from mach/arm/thread_status.h
                            {
                                offset += 60;  // This is the offset of pc in the GPR thread state data structure.
                                start_address = m_data.GetU32(&offset);

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp?rev=258289&r1=258288&r2=258289&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Tue Jan 19 23:17:13 2016
@@ -596,6 +596,7 @@ RegisterContextDarwin_arm::ReadRegisterS
     switch (set)
     {
     case GPRRegSet:    return ReadGPR(force);
+    case GPRAltRegSet: return ReadGPR(force);
     case FPURegSet:    return ReadFPU(force);
     case EXCRegSet:    return ReadEXC(force);
     case DBGRegSet:    return ReadDBG(force);
@@ -613,6 +614,7 @@ RegisterContextDarwin_arm::WriteRegister
         switch (set)
         {
         case GPRRegSet:    return WriteGPR();
+        case GPRAltRegSet: return WriteGPR();
         case FPURegSet:    return WriteFPU();
         case EXCRegSet:    return WriteEXC();
         case DBGRegSet:    return WriteDBG();

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h?rev=258289&r1=258288&r2=258289&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h Tue Jan 19 23:17:13 2016
@@ -162,10 +162,11 @@ public:
 protected:
     enum
     {
-        GPRRegSet = 1, // ARM_THREAD_STATE
-        FPURegSet = 2, // ARM_VFP_STATE
-        EXCRegSet = 3, // ARM_EXCEPTION_STATE
-        DBGRegSet = 4  // ARM_DEBUG_STATE
+        GPRRegSet = 1,    // ARM_THREAD_STATE
+        GPRAltRegSet = 9, // ARM_THREAD_STATE32
+        FPURegSet = 2,    // ARM_VFP_STATE
+        EXCRegSet = 3,    // ARM_EXCEPTION_STATE
+        DBGRegSet = 4     // ARM_DEBUG_STATE
     };
 
     enum




More information about the lldb-commits mailing list