diff --git a/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp b/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp index d5be96da944af50b7df96914eeda64a8e48af695..d69bef24f2125bb2ac7fa169502345cc9165818f 100644 --- a/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp +++ b/lldb/source/Plugins/Platform/HOS/PlatformHOS.cpp @@ -456,11 +456,8 @@ PlatformHOS::GetLibdlFunctionDeclarations(lldb_private::Process *process) { return PlatformPOSIX::GetLibdlFunctionDeclarations(process); } -HdcClient::SyncService *PlatformHOS::GetSyncService(Status &error) { - if (m_adb_sync_svc && m_adb_sync_svc->IsConnected()) - return m_adb_sync_svc.get(); - +std::unique_ptr PlatformHOS::GetSyncService(Status &error) { HdcClient hdc(m_device_id); - m_adb_sync_svc = hdc.GetSyncService(error); - return (error.Success()) ? m_adb_sync_svc.get() : nullptr; + std::unique_ptr adb_sync_svc = hdc.GetSyncService(error); + return (error.Success()) ? std::move(adb_sync_svc) : nullptr; } diff --git a/lldb/source/Plugins/Platform/HOS/PlatformHOS.h b/lldb/source/Plugins/Platform/HOS/PlatformHOS.h index 07057ab83e26a2723914b47821ced07c6456b450..40e291a2d35f35c6e16476b07e3ed9e69bd0d2e4 100644 --- a/lldb/source/Plugins/Platform/HOS/PlatformHOS.h +++ b/lldb/source/Plugins/Platform/HOS/PlatformHOS.h @@ -69,9 +69,8 @@ protected: GetLibdlFunctionDeclarations(lldb_private::Process *process) override; private: - HdcClient::SyncService *GetSyncService(Status &error); + std::unique_ptr GetSyncService(Status &error); - std::unique_ptr m_adb_sync_svc; std::string m_device_id; uint32_t m_sdk_version; };