[Lldb-commits] [PATCH] D63792: [lldb] [Process/NetBSD] Use global enable bits for watchpoints

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 1 02:53:30 PDT 2019

labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

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...

Comment at: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp:733
   // for watchpoints 0, 1, 2, or 3, respectively, set bits 1, 3, 5, or 7
-  uint64_t enable_bit = 1 << (2 * wp_index);
+  uint64_t enable_bit = 2 << (2 * wp_index);
Not a big deal, but I'd find `1 << (2*wp_index + 1)` less surprising..



More information about the lldb-commits mailing list