mgorny created this revision. mgorny added reviewers: krytarowski, labath, joerg.
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. https://reviews.llvm.org/D63792 Files: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp +++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp @@ -691,7 +691,7 @@ uint64_t control_bits = reg_value.GetAsUInt64(); - is_vacant = !(control_bits & (1 << (2 * wp_index))); + is_vacant = !(control_bits & (2 << (2 * wp_index))); return error; } @@ -730,7 +730,7 @@ return error; // 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); // set bits 16-17, 20-21, 24-25, or 28-29 // with 0b01 for write, and 0b11 for read/write
Index: lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp =================================================================== --- lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp +++ lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp @@ -691,7 +691,7 @@ uint64_t control_bits = reg_value.GetAsUInt64(); - is_vacant = !(control_bits & (1 << (2 * wp_index))); + is_vacant = !(control_bits & (2 << (2 * wp_index))); return error; } @@ -730,7 +730,7 @@ return error; // 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); // set bits 16-17, 20-21, 24-25, or 28-29 // with 0b01 for write, and 0b11 for read/write
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits