aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2020-04-02 14:40:59 +0200
committerPavel Labath <pavel@labath.sk>2020-04-02 14:42:25 +0200
commit451741a9d778a260ceee608a26b5fdf2d9926982 (patch)
tree945c6de2f63d9be79125b8ceeee0fde3eeff5f36 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent13a1504ffb9a9a4f82dc1b60d9e8cbb173c7d030 (diff)
downloadllvm-451741a9d778a260ceee608a26b5fdf2d9926982.zip
llvm-451741a9d778a260ceee608a26b5fdf2d9926982.tar.gz
llvm-451741a9d778a260ceee608a26b5fdf2d9926982.tar.bz2
[lldb] Change Communication::SetConnection to take a unique_ptr
The function takes ownership of the object. This makes that explicit, and avoids unowned pointers floating around.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index a3c19f7..618ed7c 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -960,7 +960,7 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) {
uint32_t retry_count = 0;
while (!m_gdb_comm.IsConnected()) {
if (conn_up->Connect(connect_url, &error) == eConnectionStatusSuccess) {
- m_gdb_comm.SetConnection(conn_up.release());
+ m_gdb_comm.SetConnection(std::move(conn_up));
break;
} else if (error.WasInterrupted()) {
// If we were interrupted, don't keep retrying.
@@ -3482,7 +3482,8 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
// Our process spawned correctly, we can now set our connection to use
// our end of the socket pair
cleanup_our.release();
- m_gdb_comm.SetConnection(new ConnectionFileDescriptor(our_socket, true));
+ m_gdb_comm.SetConnection(
+ std::make_unique<ConnectionFileDescriptor>(our_socket, true));
#endif
StartAsyncThread();
}