[Lldb-commits] [lldb] r138867 - in /lldb/trunk/tools/debugserver/source/MacOSX: i386/DNBArchImplI386.cpp x86_64/DNBArchImplX86_64.cpp

Johnny Chen johnny.chen at apple.com
Wed Aug 31 10:51:43 PDT 2011


Author: johnny
Date: Wed Aug 31 12:51:43 2011
New Revision: 138867

URL: http://llvm.org/viewvc/llvm-project?rev=138867&view=rev
Log:
Fix the shift amount applied to size_and_rw_bits() for debug control register,
which did not take into account the hardware index.

Modified:
    lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Modified: lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp?rev=138867&r1=138866&r2=138867&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp Wed Aug 31 12:51:43 2011
@@ -682,7 +682,8 @@
     //      dr1 -> bits{23-20}
     //      dr2 -> bits{27-24}
     //      dr3 -> bits{31-28}
-    debug_state.__dr7 |= (1 << (2*hw_index) | size_and_rw_bits(size, read, write) << 16);
+    debug_state.__dr7 |= (1 << (2*hw_index) |
+                          size_and_rw_bits(size, read, write) << (16+4*hw_index));
     uint32_t addr_32 = addr & 0xffffffff;
     switch (hw_index) {
     case 0:

Modified: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=138867&r1=138866&r2=138867&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Wed Aug 31 12:51:43 2011
@@ -611,7 +611,8 @@
     //      dr1 -> bits{23-20}
     //      dr2 -> bits{27-24}
     //      dr3 -> bits{31-28}
-    debug_state.__dr7 |= (1 << (2*hw_index) | size_and_rw_bits(size, read, write) << 16);
+    debug_state.__dr7 |= (1 << (2*hw_index) |
+                          size_and_rw_bits(size, read, write) << (16+4*hw_index));
     switch (hw_index) {
     case 0:
         debug_state.__dr0 == addr; break;





More information about the lldb-commits mailing list