diff options
Diffstat (limited to 'lldb/source/Plugins')
5 files changed, 23 insertions, 12 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index d9acc996ca2..606d1f879f1 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -28,8 +28,10 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/StringRef.h" #include "llvm/Support/MathExtras.h" #define CASE_AND_STREAM(s, def, width) \ @@ -1277,8 +1279,8 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, const ArchSpec host_arch32 = Host::GetArchitecture (Host::eSystemDefaultArchitecture32); if (host_arch32.GetCore() == arch_spec.GetCore()) { - arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); - arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); + arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data()); } } break; @@ -1287,8 +1289,8 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl §ion_headers, const ArchSpec host_arch64 = Host::GetArchitecture (Host::eSystemDefaultArchitecture64); if (host_arch64.GetCore() == arch_spec.GetCore()) { - arch_spec.GetTriple().setOSName (Host::GetOSString().GetCString()); - arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString()); + arch_spec.GetTriple().setOSName(HostInfo::GetOSString().data()); + arch_spec.GetTriple().setVendorName(HostInfo::GetVendorString().data()); } } break; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp index c56415de009..6fb0079b23b 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -27,6 +27,7 @@ #include "lldb/Host/FileSpec.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" @@ -261,7 +262,9 @@ PlatformMacOSX::GetFileWithUUID (const lldb_private::FileSpec &platform_file, if (IsRemote() && m_remote_platform_sp) { std::string local_os_build; - Host::GetOSBuildString(local_os_build); +#if !defined(__linux__) + HostInfo::GetOSBuildString(local_os_build); +#endif std::string remote_os_build; m_remote_platform_sp->GetOSBuildString(remote_os_build); if (local_os_build.compare(remote_os_build) == 0) diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp index d3e1deac61f..331f2c30cdd 100644 --- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp +++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp @@ -23,6 +23,7 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/Module.h" #include "lldb/Breakpoint/BreakpointLocation.h" @@ -662,7 +663,7 @@ PlatformWindows::GetStatus (Stream &strm) uint32_t major; uint32_t minor; uint32_t update; - if (!Host::GetOSVersion(major, minor, update)) + if (!HostInfo::GetOSVersion(major, minor, update)) { strm << "Windows"; return; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index b87b8c9f24a..c2b58fd1377 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -27,6 +27,7 @@ #include "lldb/Core/StreamString.h" #include "lldb/Host/Endian.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/Target.h" @@ -2779,7 +2780,7 @@ GDBRemoteCommunicationClient::LaunchGDBserverAndGetPort (lldb::pid_t &pid, const hostname = remote_accept_hostname; else { - if (Host::GetHostname (hostname)) + if (HostInfo::GetHostname(hostname)) { // Make the GDB server we launch only accept connections from this host stream.Printf("host:%s;", hostname.c_str()); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index aab665961dc..96538202625 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -33,6 +33,7 @@ #include "lldb/Host/File.h" #include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" +#include "lldb/Host/HostInfo.h" #include "lldb/Host/TimeValue.h" #include "lldb/Target/FileAction.h" #include "lldb/Target/Platform.h" @@ -1229,7 +1230,7 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet uint32_t major = UINT32_MAX; uint32_t minor = UINT32_MAX; uint32_t update = UINT32_MAX; - if (Host::GetOSVersion (major, minor, update)) + if (HostInfo::GetOSVersion(major, minor, update)) { if (major != UINT32_MAX) { @@ -1245,18 +1246,21 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet } std::string s; - if (Host::GetOSBuildString (s)) +#if !defined(__linux__) + if (HostInfo::GetOSBuildString(s)) { response.PutCString ("os_build:"); response.PutCStringAsRawHex8(s.c_str()); response.PutChar(';'); } - if (Host::GetOSKernelDescription (s)) + if (HostInfo::GetOSKernelDescription(s)) { response.PutCString ("os_kernel:"); response.PutCStringAsRawHex8(s.c_str()); response.PutChar(';'); } +#endif + #if defined(__APPLE__) #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) @@ -1267,7 +1271,7 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet response.PutCStringAsRawHex8("127.0.0.1"); response.PutChar(';'); #else // #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) - if (Host::GetHostname (s)) + if (HostInfo::GetHostname(s)) { response.PutCString ("hostname:"); response.PutCStringAsRawHex8(s.c_str()); @@ -1276,7 +1280,7 @@ GDBRemoteCommunicationServer::Handle_qHostInfo (StringExtractorGDBRemote &packet #endif // #if defined(__arm__) || defined(__arm64__) || defined(__aarch64__) #else // #if defined(__APPLE__) - if (Host::GetHostname (s)) + if (HostInfo::GetHostname(s)) { response.PutCString ("hostname:"); response.PutCStringAsRawHex8(s.c_str()); |