[Lldb-commits] [lldb] r217998 - Retry remote connection one time in case of timeout and return an error that specifies why debugging failed.

Greg Clayton gclayton at apple.com
Wed Sep 17 17:14:39 PDT 2014


Author: gclayton
Date: Wed Sep 17 19:14:38 2014
New Revision: 217998

URL: http://llvm.org/viewvc/llvm-project?rev=217998&view=rev
Log:
Retry remote connection one time in case of timeout and return an error that specifies why debugging failed.

Modified:
    lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp

Modified: lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=217998&r1=217997&r2=217998&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Wed Sep 17 19:14:38 2014
@@ -488,10 +488,16 @@ PlatformRemoteGDBServer::DebugProcess (l
                                                                 port + port_offset);
                         assert (connect_url_len < (int)sizeof(connect_url));
                         error = process_sp->ConnectRemote (NULL, connect_url);
+                        // Retry the connect remote one time...
+                        if (error.Fail())
+                            error = process_sp->ConnectRemote (NULL, connect_url);
                         if (error.Success())
                             error = process_sp->Launch(launch_info);
                         else if (debugserver_pid != LLDB_INVALID_PROCESS_ID)
+                        {
+                            printf ("error: connect remote failed (%s)\n", error.AsCString());
                             m_gdb_client.KillSpawnedProcess(debugserver_pid);
+                        }
                     }
                 }
             }





More information about the lldb-commits mailing list