[Lldb-commits] [PATCH] D67168: [Windows] Add support of watchpoints to `ProcessWindows`
    Zachary Turner via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Wed Sep  4 16:01:41 PDT 2019
    
    
  
zturner added inline comments.
================
Comment at: lldb/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp:82
 
-bool RegisterContextWindows::ClearHardwareBreakpoint(uint32_t hw_idx) {
-  return false;
-}
+  if (!size || size > 8 || size & (size - 1))
+    return false;
----------------
amccarth wrote:
> Clever!  It took me a minute or two to figure out what the point of that was checking.  Perhaps a comment to explain?
Isn't this equivalent to:
```
switch (size)
{
    case 1:
    case 2:
    case 4:
    case 8:
        break;
    default:
        return false;
}
```
?  That definitely seems much clearer.
I'm also pretty sure that on x86 you can't add a 64-bit watch, So you'd have to do something different depending on the target bitness if you want this to be correct for x86.
Repository:
  rLLDB LLDB
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67168/new/
https://reviews.llvm.org/D67168
    
    
More information about the lldb-commits
mailing list