NetBSD ptrace interface does not populate watchpoints to newly-created threads. Solve this via copying the watchpoints from the current thread when new thread is reported via TRAP_LWP. Add a test that verifies that when the user does not have permissions to set watchpoints on NetBSD, the 'watchpoint set' errors out gracefully and thread monitoring does not crash on being unable to copy watchpoints to new threads. Differential Revision: https://reviews.llvm.org/D70023
23 lines
880 B
Plaintext
23 lines
880 B
Plaintext
# Check that 'watchpoint set' errors out gracefully when we can't set dbregs
|
|
# and that new threads are monitored correctly even though we can't copy dbregs.
|
|
|
|
# REQUIRES: system-netbsd && (target-x86 || target-x86_64) && !dbregs-set
|
|
# RUN: %clang_host %p/Inputs/thread-dbreg.c -pthread -g -o %t.out
|
|
# RUN: %lldb -b -o 'settings set interpreter.stop-command-source-on-error false' -s %s %t.out 2>&1 | FileCheck %s
|
|
|
|
settings show interpreter.stop-command-source-on-error
|
|
# CHECK: interpreter.stop-command-source-on-error (boolean) = false
|
|
|
|
b main
|
|
# CHECK: Breakpoint {{[0-9]+}}: where = {{.*}}`main
|
|
b thread_func
|
|
# CHECK: Breakpoint {{[0-9]+}}: where = {{.*}}`thread_func
|
|
run
|
|
# CHECK: stop reason = breakpoint
|
|
watchpoint set variable g_watchme
|
|
# CHECK: error: Watchpoint creation failed
|
|
cont
|
|
# CHECK: stop reason = breakpoint
|
|
cont
|
|
# CHECK: Process {{[0-9]+}} exited with status = 0
|