Author: Pavel Labath Date: 2021-03-14T22:43:52+01:00 New Revision: 463863fffea5c26b0410ee030205fc6bf066f763
URL: https://github.com/llvm/llvm-project/commit/463863fffea5c26b0410ee030205fc6bf066f763 DIFF: https://github.com/llvm/llvm-project/commit/463863fffea5c26b0410ee030205fc6bf066f763.diff LOG: [lldb] Move PlatformPOSIX::ConnectToWaitingProcesses to RemoteAwarePlatform The functionality is not posix specific. Also force the usage of the gdb-remote process plugin in the gdb platform class. This is not sufficient to make TestPlatformConnect pass on windows (it seems it suffers from module loading issues, unrelated to this test), but it at least makes it shut down correctly, so I change the skip to an xfail. Added: Modified: lldb/include/lldb/Target/RemoteAwarePlatform.h lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp lldb/source/Target/RemoteAwarePlatform.cpp lldb/test/API/commands/platform/connect/TestPlatformConnect.py Removed: ################################################################################ diff --git a/lldb/include/lldb/Target/RemoteAwarePlatform.h b/lldb/include/lldb/Target/RemoteAwarePlatform.h index 6d6ac99c093f..269d15299889 100644 --- a/lldb/include/lldb/Target/RemoteAwarePlatform.h +++ b/lldb/include/lldb/Target/RemoteAwarePlatform.h @@ -97,6 +97,9 @@ class RemoteAwarePlatform : public Platform { Status KillProcess(const lldb::pid_t pid) override; + size_t ConnectToWaitingProcesses(Debugger &debugger, + Status &error) override; + protected: lldb::PlatformSP m_remote_platform_sp; }; diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp index 09ba83a4e94b..c8a006001fcb 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp @@ -994,13 +994,6 @@ PlatformPOSIX::GetLibdlFunctionDeclarations(lldb_private::Process *process) { )"; } -size_t PlatformPOSIX::ConnectToWaitingProcesses(Debugger &debugger, - Status &error) { - if (m_remote_platform_sp) - return m_remote_platform_sp->ConnectToWaitingProcesses(debugger, error); - return Platform::ConnectToWaitingProcesses(debugger, error); -} - ConstString PlatformPOSIX::GetFullNameForDylib(ConstString basename) { if (basename.IsEmpty()) return basename; diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h index 72c54f4147c2..1cba4c5eb2e9 100644 --- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h +++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h @@ -71,9 +71,6 @@ class PlatformPOSIX : public lldb_private::RemoteAwarePlatform { lldb_private::Status UnloadImage(lldb_private::Process *process, uint32_t image_token) override; - size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger, - lldb_private::Status &error) override; - lldb_private::ConstString GetFullNameForDylib(lldb_private::ConstString basename) override; protected: diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 8227199f52b6..7fce11cb147c 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -843,7 +843,7 @@ size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger &debugger, GetPendingGdbServerList(connection_urls); for (size_t i = 0; i < connection_urls.size(); ++i) { - ConnectProcess(connection_urls[i].c_str(), "", debugger, nullptr, error); + ConnectProcess(connection_urls[i].c_str(), "gdb-remote", debugger, nullptr, error); if (error.Fail()) return i; // We already connected to i process succsessfully } diff --git a/lldb/source/Target/RemoteAwarePlatform.cpp b/lldb/source/Target/RemoteAwarePlatform.cpp index 3a186adca04c..b0c43ffa839e 100644 --- a/lldb/source/Target/RemoteAwarePlatform.cpp +++ b/lldb/source/Target/RemoteAwarePlatform.cpp @@ -437,3 +437,10 @@ Status RemoteAwarePlatform::KillProcess(const lldb::pid_t pid) { return m_remote_platform_sp->KillProcess(pid); return Status("the platform is not currently connected"); } + +size_t RemoteAwarePlatform::ConnectToWaitingProcesses(Debugger &debugger, + Status &error) { + if (m_remote_platform_sp) + return m_remote_platform_sp->ConnectToWaitingProcesses(debugger, error); + return Platform::ConnectToWaitingProcesses(debugger, error); +} diff --git a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py index 5c6ee5743208..a7a3f3adf803 100644 --- a/lldb/test/API/commands/platform/connect/TestPlatformConnect.py +++ b/lldb/test/API/commands/platform/connect/TestPlatformConnect.py @@ -11,8 +11,8 @@ class TestPlatformProcessConnect(TestBase): @skipIfRemote @expectedFailureAll(hostoslist=["windows"], triple='.*-android') - @skipIfWindows # lldb-server does not terminate correctly @skipIfDarwin # lldb-server not found correctly + @expectedFailureAll(oslist=["windows"]) # process modules not loaded @add_test_categories(["lldb-server"]) def test_platform_process_connect(self): self.build() _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits