diff options
Diffstat (limited to 'source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp')
-rw-r--r-- | source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index f16ea017676f..e64ed66be3ca 100644 --- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -714,9 +714,9 @@ PlatformRemoteGDBServer::Attach (ProcessAttachInfo &attach_info, error = process_sp->ConnectRemote(nullptr, connect_url.c_str()); if (error.Success()) { - auto listener = attach_info.GetHijackListener(); - if (listener != nullptr) - process_sp->HijackProcessEvents(listener.get()); + ListenerSP listener_sp = attach_info.GetHijackListener(); + if (listener_sp) + process_sp->HijackProcessEvents(listener_sp); error = process_sp->Attach(attach_info); } @@ -1002,6 +1002,22 @@ PlatformRemoteGDBServer::ConnectProcess(const char* connect_url, } 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; |