Set global enable bits (i.e. bits 1, 3, 5, 7) to enable watchpoints
on NetBSD rather than the local enable bits (0, 2, 4, 6). The former
are necessary for watchpoints to be correctly recognized by the NetBSD
kernel. The latter cause them to be reported as trace points.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Sorry about the delay, I was OOO last week. BTW, the usual rate of pinging on a patch is one week https://llvm.org/docs/DeveloperPolicy.html#code-reviews.
If the NetBSD kernel really sets the global-enable flag in the dr7 register, I'd be tempted to try to make it crash/misbehave by setting a hardware breakpoint somewhere in the early entry code (before it gets a chance to clear it, if it even does that), ideally in the breakpoint handler so it triggers an infinite loop :). However, that is not relevant to this patch...
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp | ||
---|---|---|
733 ↗ | (On Diff #206723) | Not a big deal, but I'd find 1 << (2*wp_index + 1) less surprising.. |
That's probably one of the reasons why NetBSD normally prevents unprivileged users from setting DRs.
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp | ||
---|---|---|
733 ↗ | (On Diff #206723) | Will do. |
I would follow the same kernel behavior here as Linux, but that can be done independently.