[Lldb-commits] [lldb] r181755 - Fixes to read the floating point and exception registers sets out

Jason Molenda jmolenda at apple.com
Mon May 13 20:25:58 PDT 2013


Author: jmolenda
Date: Mon May 13 22:25:58 2013
New Revision: 181755

URL: http://llvm.org/viewvc/llvm-project?rev=181755&view=rev
Log:
Fixes to read the floating point and exception registers sets out
of arm Mach-O core files.
<rdar://problem/13665075>

Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.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=181755&r1=181754&r2=181755&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon May 13 22:25:58 2013
@@ -289,25 +289,43 @@ public:
         SetError (GPRRegSet, Read, -1);
         SetError (FPURegSet, Read, -1);
         SetError (EXCRegSet, Read, -1);
-        int flavor = data.GetU32 (&offset);
-        uint32_t count = data.GetU32 (&offset);
-        switch (flavor)
+        bool done = false;
+
+        while (!done)
         {
-            case GPRRegSet:
-                for (uint32_t i=0; i<count; ++i)
-                    gpr.r[i] = data.GetU32(&offset);
-                SetError (GPRRegSet, Read, 0);
-                break;
-            case FPURegSet:
-                // TODO: fill in FPU regs....
-                //SetError (FPURegSet, Read, -1);
-                break;
-            case EXCRegSet:
-                exc.exception = data.GetU32(&offset);
-                exc.fsr = data.GetU32(&offset);
-                exc.far = data.GetU32(&offset);
-                SetError (EXCRegSet, Read, 0);
-                break;
+            int flavor = data.GetU32 (&offset);
+            uint32_t count = data.GetU32 (&offset);
+            switch (flavor)
+            {
+                case GPRRegSet:
+                    for (uint32_t i=0; i<count; ++i)
+                        gpr.r[i] = data.GetU32(&offset);
+                    SetError (GPRRegSet, Read, 0);
+                    break;
+
+                case FPURegSet:
+                    {
+                        uint32_t *d = &fpu.floats.s[0];
+                        for (uint32_t i = 0; i < count && d < d + (sizeof (fpu.floats) / sizeof (uint32_t)); i++)
+                        {
+                            *d++ = data.GetU32(&offset);
+                        }
+                        SetError (FPURegSet, Read, 0);
+                    }
+                    break;
+
+                case EXCRegSet:
+                    exc.exception = data.GetU32(&offset);
+                    exc.fsr = data.GetU32(&offset);
+                    exc.far = data.GetU32(&offset);
+                    SetError (EXCRegSet, Read, 0);
+                    done = true;
+                    break;
+
+                // Unknown register set flavor, stop trying to parse.
+                default:
+                    done = true;
+            }
         }
     }
 protected:

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=181755&r1=181754&r2=181755&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h Mon May 13 22:25:58 2013
@@ -114,11 +114,17 @@ public:
     };
 
 
+    struct QReg
+    {
+        uint8_t bytes[16];
+    };
+
     struct FPU
     {
         union {
             uint32_t s[32];
-            uint64_t d[16];
+            uint64_t d[32];
+            QReg     q[16];  // the 128-bit NEON registers
         } floats;
         uint32_t fpscr;
     };
@@ -160,10 +166,10 @@ protected:
 
     enum
     {
-        GPRRegSet = 1,
-        FPURegSet = 2,
-        EXCRegSet = 3,
-        DBGRegSet = 4
+        GPRRegSet = 1, // ARM_THREAD_STATE
+        FPURegSet = 2, // ARM_VFP_STATE
+        EXCRegSet = 3, // ARM_EXCEPTION_STATE
+        DBGRegSet = 4  // ARM_DEBUG_STATE
     };
 
     enum





More information about the lldb-commits mailing list