[Lldb-commits] [PATCH] D38897: Add specific ppc64le hardware watchpoint handler

Ana Julia Caetano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 16 03:17:29 PDT 2017


anajuliapc added inline comments.


================
Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp:374
+  uint32_t tempControl = m_hwp_regs[wp_index].control;
+  long * tempSlot = reinterpret_cast<long *>(m_hwp_regs[wp_index].slot);
+
----------------
zturner wrote:
> `reinterpret_cast` from `long*` to `long`?  Is this correct?
Yes, It's strange but is the only way it works without changing `NativeProcessLinux::PtraceWrapper`. `PPC_PTRACE_DELHWDEBUG` works different from other PPC ptrace requests, because it must pass the return of `PPC_PTRACE_SETHWDEBUG` to [[ https://github.com/torvalds/linux/blob/master/Documentation/powerpc/ptrace.txt#L147 | ptrace ]] instead of a data structure. If you pass it as `long`, PtraceWrapper fails because it must receive a `void*`.

I'll check the other points, thanks for the comments.


https://reviews.llvm.org/D38897





More information about the lldb-commits mailing list