[lldb] Prevent 'process connect' from using local-only plugins
authorMichał Górny <mgorny@moritz.systems>
Fri, 20 Nov 2020 16:12:22 +0000 (17:12 +0100)
committerMichał Górny <mgorny@moritz.systems>
Mon, 23 Nov 2020 08:48:55 +0000 (09:48 +0100)
commit18e4272a4fe4667a44f4d323140645a83ddfd864
tree24ca8ce3f6b8be27978b8ca89067194eaad9334c
parent66ace4dc0275c8d7740bc5ff57c20e85e6660371
[lldb] Prevent 'process connect' from using local-only plugins

Add a 'can_connect' parameter to Process plugin initialization, and use
it to filter plugins to these capable of remote connections.  This is
used to prevent 'process connect' from picking up a plugin that can only
be used locally, e.g. the legacy FreeBSD plugin.

Differential Revision: https://reviews.llvm.org/D91810
30 files changed:
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/ProcessTrace.h
lldb/include/lldb/Target/Target.h
lldb/include/lldb/lldb-private-interfaces.h
lldb/source/API/SBTarget.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.h
lldb/source/Target/Platform.cpp
lldb/source/Target/Process.cpp
lldb/source/Target/ProcessTrace.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TraceSessionFileParser.cpp
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
lldb/test/Shell/Commands/command-process-connect.test