mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 19:49:36 +00:00
7644d8ba4d
Fix handling concurrent watchpoint events so that they are reported correctly in LLDB. If multiple watchpoints are hit concurrently, the NetBSD kernel reports them as series of SIGTRAPs with a thread specified, and the debugger investigates DR6 in order to establish which watchpoint was hit. This is normally fine. However, LLDB disables and reenables the watchpoint on all threads after each hit, which results in the hit status from DR6 being wiped. As a result, it can't establish which watchpoint was hit in successive SIGTRAP processing. In order to workaround this problem, clear DR6 only if the breakpoint is overwritten with a new one. More specifically, move cleaning DR6 from ClearHardwareWatchpoint() to SetHardwareWatchpointWithIndex(), and do that only if the newly requested watchpoint is different from the one being set previously. This ensures that the disable-enable logic of LLDB does not clear watchpoint hit status for the remaining threads. This also involves refactoring of watchpoint logic. With the old logic, clearing watchpoint involved wiping dr6 & dr7, and setting it setting dr{0..3} & dr7. With the new logic, only enable bit is cleared from dr7, and the remaining bits are cleared/overwritten while setting new watchpoint. Differential Revision: https://reviews.llvm.org/D70025 |
||
---|---|---|
.. | ||
cmake | ||
docs | ||
examples | ||
include/lldb | ||
packages/Python/lldbsuite | ||
resources | ||
scripts | ||
source | ||
test | ||
third_party/Python/module | ||
tools | ||
unittests | ||
utils | ||
.arcconfig | ||
.clang-format | ||
.gitignore | ||
CMakeLists.txt | ||
CODE_OWNERS.txt | ||
LICENSE.TXT | ||
use_lldb_suite_root.py |