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

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 1 05:23:36 PDT 2015


tberghammer requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp:820-821
@@ -819,1 +819,4 @@
+
+        ioVec.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs[m_max_hwp_supported - 1])
+                        + sizeof (dreg_state.dbg_regs [m_max_hwp_supported - 1]));
     }
----------------
You are using offsetof with a value determined in runtime (m_max_hwp_supported) what won't be work in all case (it isn't standard compliance AFAIK). I suggest to sue the following version instead:
```
ioVec.iov_len = (offsetof (struct user_hwdebug_state, dbg_regs) + sizeof (dreg_state.dbg_regs [0]) * m_max_hwp_supported);
```


http://reviews.llvm.org/D12522





More information about the lldb-commits mailing list