[Lldb-commits] [PATCH] D70022: [lldb] [Process/NetBSD] Improve threading support

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 8 11:57:38 PST 2019


mgorny created this revision.
mgorny added reviewers: labath, krytarowski.
mgorny added a child revision: D70023: [lldb] [Process/NetBSD] Copy watchpoints to newly-created threads.

Implement major improvements to multithreaded program support.  Notably,
support tracking new and exited threads, associate signals and events
with correct threads and support controlling individual threads when
resuming.

Firstly, use PT_SET_EVENT_MASK to enable reporting of created and exited
threads via SIGTRAP.  Handle TRAP_LWP events to keep track
of the currently running threads.

Secondly, update the signal (both generic and SIGTRAP) handling code
to account for per-thread signals correctly.  Signals delivered
to the whole process are reported on all threads, while per-thread
signals and events are reported only to the specific thread.
The remaining threads are marked as 'stopped with no reason'.  Note that
NetBSD always stops all threads on debugger events.

Thirdly, implement the ability to set every thread as running, stopped
or single-stepping separately while continuing the process.  This also
provides the ability to send a signal to the whole process or to one
of its thread while resuming.

Note 1: this is not perfect but the whole series is good enough to commit and work on fixing remaining bugs afterwards.

Note 2: the series in general fixes a lot of tests but I'm going to wait with test status updates until buildbot confirms.


https://reviews.llvm.org/D70022

Files:
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
  lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
  lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
  lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.cpp
  lldb/source/Plugins/Process/NetBSD/NativeThreadNetBSD.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70022.228505.patch
Type: text/x-patch
Size: 17635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191108/90786f26/attachment-0001.bin>


More information about the lldb-commits mailing list