[Lldb-commits] [lldb] 0a56927 - [LLDB][NFC] Fix LLDB_WATCH_TYPE_IS_VALID macro

Slava Gurevich via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 2 13:05:44 PDT 2022


Author: Slava Gurevich
Date: 2022-08-02T13:05:29-07:00
New Revision: 0a569274cb3b10401593ebd6eef01b74abbf4504

URL: https://github.com/llvm/llvm-project/commit/0a569274cb3b10401593ebd6eef01b74abbf4504
DIFF: https://github.com/llvm/llvm-project/commit/0a569274cb3b10401593ebd6eef01b74abbf4504.diff

LOG: [LLDB][NFC] Fix LLDB_WATCH_TYPE_IS_VALID macro

LLDB_WATCH_TYPE_IS_VALID would always return true when validating watchpoint type
by using bitwise-or instead of bitwise-and to apply validation flags.

Differential Revision: https://reviews.llvm.org/D130972

Added: 
    

Modified: 
    lldb/include/lldb/lldb-defines.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/lldb-defines.h b/lldb/include/lldb/lldb-defines.h
index 339071bbfc31..ad1283bfd229 100644
--- a/lldb/include/lldb/lldb-defines.h
+++ b/lldb/include/lldb/lldb-defines.h
@@ -45,7 +45,7 @@
 #define LLDB_WATCH_TYPE_READ (1u << 0)
 #define LLDB_WATCH_TYPE_WRITE (1u << 1)
 #define LLDB_WATCH_TYPE_IS_VALID(type)                                         \
-  ((type | LLDB_WATCH_TYPE_READ) || (type | LLDB_WATCH_TYPE_WRITE))
+  ((type & LLDB_WATCH_TYPE_READ) || (type & LLDB_WATCH_TYPE_WRITE))
 
 // Generic Register Numbers
 #define LLDB_REGNUM_GENERIC_PC 0    // Program Counter


        


More information about the lldb-commits mailing list