[Lldb-commits] [lldb] r167066 - in /lldb/trunk/source/Plugins: ObjectFile/Mach-O/ObjectFileMachO.cpp Process/Utility/RegisterContextDarwin_arm.h Process/Utility/RegisterContextDarwin_i386.h Process/Utility/RegisterContextDarwin_x86_64.h

Greg Clayton gclayton at apple.com
Tue Oct 30 16:57:32 PDT 2012


Author: gclayton
Date: Tue Oct 30 18:57:32 2012
New Revision: 167066

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

RegisterContextKDP_i386 was not correctly writing registers due to missing "virtual" keywords. Added the virtual keywords and made the functions pure virtual to ensure subclasses can't get away without implementing these functions.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.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=167066&r1=167065&r2=167066&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Oct 30 18:57:32 2012
@@ -259,7 +259,7 @@
 {
 public:
     RegisterContextDarwin_arm_Mach (lldb_private::Thread &thread, const DataExtractor &data) :
-    RegisterContextDarwin_arm (thread, 0)
+        RegisterContextDarwin_arm (thread, 0)
     {
         SetRegisterDataFrom_LC_THREAD (data);
     }
@@ -316,6 +316,12 @@
     {
         return 0;
     }
+
+    virtual int
+    DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg)
+    {
+        return -1;
+    }
     
     virtual int
     DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
@@ -334,6 +340,12 @@
     {
         return 0;
     }
+    
+    virtual int
+    DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg)
+    {
+        return -1;
+    }
 };
 
 #define MACHO_NLIST_ARM_SYMBOL_IS_THUMB 0x0008

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=167066&r1=167065&r2=167066&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h Tue Oct 30 18:57:32 2012
@@ -284,47 +284,26 @@
         return -1;
     }
     
-    int
-    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
-    {
-        return -1;
-    }
+    virtual int
+    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu) = 0;
     
-    int
-    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
-    {
-        return -1;
-    }
+    virtual int
+    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc) = 0;
 
-    int
-    DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg)
-    {
-        return -1;
-    }
+    virtual int
+    DoReadDBG (lldb::tid_t tid, int flavor, DBG &dbg) = 0;
 
-    int
-    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr) = 0;
     
-    int
-    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu) = 0;
     
-    int
-    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc) = 0;
 
-    int
-    DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteDBG (lldb::tid_t tid, int flavor, const DBG &dbg) = 0;
 
     int
     ReadRegisterSet (uint32_t set, bool force);

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h?rev=167066&r1=167065&r2=167066&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h Tue Oct 30 18:57:32 2012
@@ -230,40 +230,22 @@
 
     // Subclasses override these to do the actual reading.
     virtual int
-    DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
-    {
-        return -1;
-    }
+    DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr) = 0;
     
-    int
-    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
-    {
-        return -1;
-    }
+    virtual int
+    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu) = 0;
 
-    int
-    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
-    {
-        return -1;
-    }
+    virtual int
+    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc) = 0;
 
-    int
-    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr) = 0;
     
-    int
-    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu) = 0;
     
-    int
-    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
-    {
-        return -1;
-    }
+    virtual int
+    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc) = 0;
 
     int
     ReadRegisterSet (uint32_t set, bool force);

Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h?rev=167066&r1=167065&r2=167066&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h Tue Oct 30 18:57:32 2012
@@ -234,40 +234,22 @@
 
     // Subclasses override these to do the actual reading.
     virtual int
-    DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr)
-    {
-        return -1;
-    }
+    DoReadGPR (lldb::tid_t tid, int flavor, GPR &gpr) = 0;
     
     virtual int
-    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu)
-    {
-        return -1;
-    }
+    DoReadFPU (lldb::tid_t tid, int flavor, FPU &fpu) = 0;
     
     virtual int
-    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc)
-    {
-        return -1;
-    }
+    DoReadEXC (lldb::tid_t tid, int flavor, EXC &exc) = 0;
     
     virtual int
-    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr)
-    {
-        return -1;
-    }
+    DoWriteGPR (lldb::tid_t tid, int flavor, const GPR &gpr) = 0;
     
     virtual int
-    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu)
-    {
-        return -1;
-    }
+    DoWriteFPU (lldb::tid_t tid, int flavor, const FPU &fpu) = 0;
     
     virtual int
-    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc)
-    {
-        return -1;
-    }
+    DoWriteEXC (lldb::tid_t tid, int flavor, const EXC &exc) = 0;
     
     int
     ReadRegisterSet (uint32_t set, bool force);





More information about the lldb-commits mailing list