llvm-capstone/lldb
Michał Górny 7644d8ba4d [lldb] [Process/NetBSD] Fix handling concurrent watchpoint events
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
2019-11-25 20:11:59 +01:00
..
cmake Revert "[CMake] Re-enable -Wno-gnu-anonymous-struct & -Wno-nested-anon-types." 2019-11-18 17:00:35 -08:00
docs [Docs] Generate the LLDB man page with Sphinx 2019-11-21 10:04:11 -08:00
examples [Examples] Move structured-data unpacking out of the loop. (NFC) 2019-11-22 15:43:39 -08:00
include/lldb [lldb][NFC] Allow range-based for-loops on VariableList 2019-11-25 15:03:46 +01:00
packages/Python/lldbsuite [lldb] [Process/NetBSD] Fix handling concurrent watchpoint events 2019-11-25 20:11:59 +01:00
resources
scripts [LLDB][Python] remove ArgInfo::count 2019-11-04 12:48:49 -08:00
source [lldb] [Process/NetBSD] Fix handling concurrent watchpoint events 2019-11-25 20:11:59 +01:00
test [lldb] [Process/NetBSD] Copy watchpoints to newly-created threads 2019-11-25 20:11:59 +01:00
third_party/Python/module Increase timeout in pexpect to lower chances of tests failing under ASAN. 2019-10-10 16:16:49 +00:00
tools Register Objective-C property accessors with their property decls. 2019-11-22 09:55:25 -08:00
unittests [lldb][NFC] Simplify ClangASTContext::GetBasicTypes 2019-11-20 12:47:14 +01:00
utils [LLDB] Fix inline variable only used in assertion. (NFC) 2019-10-25 15:47:17 -07:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt [lldb] Record framework build path and use it everywhere 2019-11-06 14:05:35 -08:00
CODE_OWNERS.txt [lldb][NFC] Cleanup mentions and code related to lldb-mi 2019-07-19 15:55:23 +00:00
LICENSE.TXT
use_lldb_suite_root.py