[Lldb-commits] [PATCH] D18082: [LLDB]{MIPS] Fix TestPlatformProcessConnect.py

Nitesh Jain via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 11 05:04:35 PST 2016


nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, tberghammer, labath.
nitesh.jain added subscribers: jaydeep, bhushan, sagar, mohit.bhakkad, lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

The patch http://reviews.llvm.org/D14952 which modifies the platform connect with automatically connecting to the process instance if it was started by the remote platform. However this fails for Linux Platform. Since PlatformRemoteGDBServer doesn't implement "ConnectToWaitingProcesses". Thus Platform::ConnectToWaitingProcesses was called and LLDB failed connecting to the remote process instance. This Patch implements "ConnectToWaitingProcesses" for PlatformRemoteGDBServer and hence fixes TestPlatformProcessConnect.py failure for linux Platform.

Repository:
  rL LLVM

http://reviews.llvm.org/D18082

Files:
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h

Index: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
===================================================================
--- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
+++ source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
@@ -224,6 +224,9 @@
                     lldb_private::Target *target,
                     lldb_private::Error &error) override;
 
+    size_t
+    ConnectToWaitingProcesses(lldb_private::Debugger& debugger, lldb_private::Error& error) override;
+
     virtual size_t
     GetPendingGdbServerList(std::vector<std::string>& connection_urls);
 
Index: source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
===================================================================
--- source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -1002,6 +1002,22 @@
 }
 
 size_t
+PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger& debugger, Error& error)
+{
+    std::vector<std::string> connection_urls;
+    GetPendingGdbServerList(connection_urls);
+
+    for (size_t i = 0; i < connection_urls.size(); ++i)
+    {
+        ConnectProcess(connection_urls[i].c_str(), nullptr, debugger, nullptr, error);
+        if (error.Fail())
+            return i; // We already connected to i process succsessfully
+    }
+    return connection_urls.size();
+
+}
+
+size_t
 PlatformRemoteGDBServer::GetPendingGdbServerList(std::vector<std::string>& connection_urls)
 {
     std::vector<std::pair<uint16_t, std::string>> remote_servers;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18082.50420.patch
Type: text/x-patch
Size: 1577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160311/3e103198/attachment.bin>


More information about the lldb-commits mailing list