Index: lldb/include/lldb/Host/Host.h =================================================================== --- lldb/include/lldb/Host/Host.h +++ lldb/include/lldb/Host/Host.h @@ -196,8 +196,6 @@ static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info); - static const lldb::UnixSignalsSP &GetUnixSignals(); - /// Launch the process specified in launch_info. The monitoring callback in /// launch_info must be set, and it will be called when the process /// terminates. Index: lldb/include/lldb/Target/Platform.h =================================================================== --- lldb/include/lldb/Target/Platform.h +++ lldb/include/lldb/Target/Platform.h @@ -689,7 +689,7 @@ virtual const lldb::UnixSignalsSP &GetRemoteUnixSignals(); - const lldb::UnixSignalsSP &GetUnixSignals(); + lldb::UnixSignalsSP GetUnixSignals(); //------------------------------------------------------------------ /// Locate a queue name given a thread's qaddr Index: lldb/include/lldb/Target/UnixSignals.h =================================================================== --- lldb/include/lldb/Target/UnixSignals.h +++ lldb/include/lldb/Target/UnixSignals.h @@ -22,6 +22,7 @@ class UnixSignals { public: static lldb::UnixSignalsSP Create(const ArchSpec &arch); + static lldb::UnixSignalsSP CreateForHost(); //------------------------------------------------------------------ // Constructors and Destructors Index: lldb/source/Host/common/Host.cpp =================================================================== --- lldb/source/Host/common/Host.cpp +++ lldb/source/Host/common/Host.cpp @@ -56,7 +56,6 @@ #include "lldb/Host/ProcessLauncher.h" #include "lldb/Host/ThreadLauncher.h" #include "lldb/Host/posix/ConnectionFileDescriptorPosix.h" -#include "lldb/Target/UnixSignals.h" #include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" @@ -613,12 +612,6 @@ #endif -const UnixSignalsSP &Host::GetUnixSignals() { - static const auto s_unix_signals_sp = - UnixSignals::Create(HostInfo::GetArchitecture()); - return s_unix_signals_sp; -} - std::unique_ptr Host::CreateDefaultConnection(llvm::StringRef url) { #if defined(_WIN32) if (url.startswith("file://")) Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -398,7 +398,7 @@ StringExtractorGDBRemote &packet) { StructuredData::Array signal_array; - const auto &signals = Host::GetUnixSignals(); + lldb::UnixSignalsSP signals = UnixSignals::CreateForHost(); for (auto signo = signals->GetFirstSignalNumber(); signo != LLDB_INVALID_SIGNAL_NUMBER; signo = signals->GetNextSignalNumber(signo)) { Index: lldb/source/Target/Platform.cpp =================================================================== --- lldb/source/Target/Platform.cpp +++ lldb/source/Target/Platform.cpp @@ -1739,9 +1739,9 @@ return s_default_unix_signals_sp; } -const UnixSignalsSP &Platform::GetUnixSignals() { +UnixSignalsSP Platform::GetUnixSignals() { if (IsHost()) - return Host::GetUnixSignals(); + return UnixSignals::CreateForHost(); return GetRemoteUnixSignals(); } Index: lldb/source/Target/UnixSignals.cpp =================================================================== --- lldb/source/Target/UnixSignals.cpp +++ lldb/source/Target/UnixSignals.cpp @@ -11,6 +11,7 @@ #include "Plugins/Process/Utility/LinuxSignals.h" #include "Plugins/Process/Utility/MipsLinuxSignals.h" #include "Plugins/Process/Utility/NetBSDSignals.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Host/StringConvert.h" #include "lldb/Utility/ArchSpec.h" @@ -50,6 +51,12 @@ } } +lldb::UnixSignalsSP UnixSignals::CreateForHost() { + static lldb::UnixSignalsSP s_unix_signals_sp = + Create(HostInfo::GetArchitecture()); + return s_unix_signals_sp; +} + //---------------------------------------------------------------------- // UnixSignals constructor //----------------------------------------------------------------------