[Lldb-commits] [PATCH] D98822: [lldb] [Process/Linux] Watch for fork notifications

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 23 14:24:57 PDT 2021


mgorny updated this revision to Diff 332792.
mgorny retitled this revision from "[lldb] follow-fork/vfork support [WIP]" to "[lldb] [Process/Linux] Watch for fork notifications".
mgorny edited the summary of this revision.
mgorny added a comment.

So I've decided to circle back a bit and start by adding server-side detaching-on-fork support. This means that this patch doesn't depend on multiprocess support anymore.

It includes refactoring clone/fork/vfork event monitoring into a single function. Right now, only forks are supported — the handler creates a local `NativeProcessLinux` instance (@labath, any suggestions how to make this less hacky?), duplicates parent's breakpoints into it (just like the child gets parent's memory) and uses it to clear these breakpoints and detach the child process. I suppose this will make things easier when we want to make the class more persistent in the future.

TODO: vfork, clone


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98822/new/

https://reviews.llvm.org/D98822

Files:
  lldb/include/lldb/Host/common/NativeProcessProtocol.h
  lldb/source/Host/common/NativeProcessProtocol.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
  lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
  lldb/test/Shell/Subprocess/Inputs/fork.c
  lldb/test/Shell/Subprocess/fork-follow-parent-softbp.test
  lldb/test/Shell/Subprocess/fork-follow-parent.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98822.332792.patch
Type: text/x-patch
Size: 11627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210323/505d1c5d/attachment.bin>


More information about the lldb-commits mailing list