Recognize a platform binary in ProcessGDBRemote which determines plugins
authorJason Molenda <jason@molenda.com>
Fri, 9 Sep 2022 21:52:59 +0000 (14:52 -0700)
committerJason Molenda <jason@molenda.com>
Fri, 9 Sep 2022 21:57:08 +0000 (14:57 -0700)
commit1a608cfb5ca81d7b1d8ebd6b21c6be9db59c837a
tree01e2102daadd0c12e53079f900f86b06955f20bd
parentbd16ffb38981478ab116f431e0e4057b676bfff5
Recognize a platform binary in ProcessGDBRemote which determines plugins

Complete support of the binary-addresses key in the qProcessInfo packet
in ProcessGDBRemote, for detecting if one of the binaries needs to be
handled by a Platform plugin, and can be used to set the Process'
DynamicLoader plugin and the Target's Platform plugin.

Implement this method in PlatformDarwinKernel to recognize a kernel
fileset at that address, find the actual kernel address in the
fileset, set DynamicLoaderDarwinKernel and PlatformDarwinKernel
in the Process/Target; register the kernel address with the dynamic
loader so it will be loaded later during attach.

This patch only addresses the live debug scenario with a gdb remote
serial protocol connection. I'll handle corefiles in a subsequent
patch that builds on this.

Differential Revision: https://reviews.llvm.org/D133534
rdar://98754861
lldb/include/lldb/Target/Platform.h
lldb/include/lldb/Target/Process.h
lldb/source/Core/DynamicLoader.cpp
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Target/Platform.cpp
lldb/source/Target/Process.cpp