diff options
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 38d9e40..d660a4d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -843,7 +843,7 @@ Status GDBRemoteCommunication::StartListenThread(const char *hostname, m_listen_url = listen_url; SetConnection(std::make_unique<ConnectionFileDescriptor>()); llvm::Expected<HostThread> listen_thread = ThreadLauncher::LaunchThread( - listen_url, GDBRemoteCommunication::ListenThread, this); + listen_url, [this] { return GDBRemoteCommunication::ListenThread(); }); if (!listen_thread) return Status(listen_thread.takeError()); m_listen_thread = *listen_thread; @@ -857,23 +857,22 @@ bool GDBRemoteCommunication::JoinListenThread() { return true; } -lldb::thread_result_t -GDBRemoteCommunication::ListenThread(lldb::thread_arg_t arg) { - GDBRemoteCommunication *comm = (GDBRemoteCommunication *)arg; +lldb::thread_result_t GDBRemoteCommunication::ListenThread() { Status error; ConnectionFileDescriptor *connection = - (ConnectionFileDescriptor *)comm->GetConnection(); + (ConnectionFileDescriptor *)GetConnection(); if (connection) { // Do the listen on another thread so we can continue on... if (connection->Connect( - comm->m_listen_url.c_str(), [comm](llvm::StringRef port_str) { + m_listen_url.c_str(), + [this](llvm::StringRef port_str) { uint16_t port = 0; llvm::to_integer(port_str, port, 10); - comm->m_port_promise.set_value(port); + m_port_promise.set_value(port); }, &error) != eConnectionStatusSuccess) - comm->SetConnection(nullptr); + SetConnection(nullptr); } return {}; } |