[all-commits] [llvm/llvm-project] dae7b1: [lldb] Split out NetBSD/x86 watchpoint impl for un...

Michał Górny via All-commits all-commits at lists.llvm.org
Fri Oct 23 03:20:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: dae7b10034a515a34aca593fee24d5b73dc0785f
      https://github.com/llvm/llvm-project/commit/dae7b10034a515a34aca593fee24d5b73dc0785f
  Author: Michał Górny <mgorny at moritz.systems>
  Date:   2020-10-23 (Fri, 23 Oct 2020)

  Changed paths:
    M lldb/include/lldb/Host/common/NativeRegisterContext.h
    M lldb/source/Host/common/NativeRegisterContext.cpp
    M lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.cpp
    M lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD.h
    M lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
    M lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
    M lldb/source/Plugins/Process/Utility/CMakeLists.txt
    A lldb/source/Plugins/Process/Utility/NativeRegisterContextWatchpoint_x86.cpp
    A lldb/source/Plugins/Process/Utility/NativeRegisterContextWatchpoint_x86.h

  Log Message:
  -----------
  [lldb] Split out NetBSD/x86 watchpoint impl for unification

Split the current NetBSD watchpoint implementation for x86 into Utility,
and revamp it to improve readability.  This code is meant to be used
as a common class for all x86 watchpoint implementation, particularly
these on FreeBSD and Linux.

The code uses global watchpoint enable bits, as required by the NetBSD
kernel.  If it ever becomes necessary for any platform to use local
enable bits instead, this can be trivially abstracted out.

The code also postpones clearing DR6 until a new different watchpoint
is being set in place of the old one.  This is necessary since LLDB
repeatedly reenables watchpoints on all threads, by clearing
and restoring them.  When DR6 is cleared as a part of that, then pending
events on other threads can no longer be associated with watchpoints
correctly.

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




More information about the All-commits mailing list