[Lldb-commits] [PATCH] D12522: AArch64 Watchpoints: Make sure we are only setting supported no of debug registers.

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 19 06:21:22 PDT 2015


omjavaid updated this revision to Diff 37748.
omjavaid added a comment.

This patch fixes unexpected behaviour of watchpoint code on Nexus 9 (AArch64).


http://reviews.llvm.org/D12522

Files:
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp

Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
===================================================================
--- source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -807,11 +807,12 @@
 
     memset (&dreg_state, 0, sizeof (dreg_state));
     ioVec.iov_base = &dreg_state;
-    ioVec.iov_len = sizeof (dreg_state);
 
     if (hwbType == eDREGTypeWATCH)
     {
         hwbType = NT_ARM_HW_WATCH;
+        ioVec.iov_len = sizeof (dreg_state.dbg_info) + sizeof (dreg_state.pad)
+                + (sizeof (dreg_state.dbg_regs [0]) * m_max_hwp_supported);
 
         for (uint32_t i = 0; i < m_max_hwp_supported; i++)
         {
@@ -822,6 +823,8 @@
     else
     {
         hwbType = NT_ARM_HW_BREAK;
+        ioVec.iov_len = sizeof (dreg_state.dbg_info) + sizeof (dreg_state.pad)
+                + (sizeof (dreg_state.dbg_regs [0]) * m_max_hbp_supported);
 
         for (uint32_t i = 0; i < m_max_hbp_supported; i++)
         {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12522.37748.patch
Type: text/x-patch
Size: 1047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151019/acec7f70/attachment-0001.bin>


More information about the lldb-commits mailing list