2222
2323#include < algorithm>
2424#include < mutex>
25- #include < optional>
2625
2726using namespace lldb_private ;
2827
2928namespace {
3029struct HostInfoAIXFields {
3130 llvm::once_flag m_distribution_once_flag;
3231 std::string m_distribution_id;
33- llvm::once_flag m_os_version_once_flag;
34- llvm::VersionTuple m_os_version;
3532};
3633} // namespace
3734
@@ -50,33 +47,6 @@ void HostInfoAIX::Terminate() {
5047 HostInfoBase::Terminate ();
5148}
5249
53- llvm::VersionTuple HostInfoAIX::GetOSVersion () {
54- assert (g_fields && " Missing call to Initialize?" );
55- llvm::call_once (g_fields->m_os_version_once_flag , []() {
56- struct utsname un;
57- if (uname (&un) != 0 )
58- return ;
59-
60- llvm::StringRef release = un.release ;
61- // The kernel release string can include a lot of stuff (e.g.
62- // 4.9.0-6-amd64). We're only interested in the numbered prefix.
63- release = release.substr (0 , release.find_first_not_of (" 0123456789." ));
64- g_fields->m_os_version .tryParse (release);
65- });
66-
67- return g_fields->m_os_version ;
68- }
69-
70- std::optional<std::string> HostInfoAIX::GetOSBuildString () {
71- struct utsname un;
72- ::memset (&un, 0 , sizeof (utsname));
73-
74- if (uname (&un) < 0 )
75- return std::nullopt ;
76-
77- return std::string (un.release );
78- }
79-
8050llvm::StringRef HostInfoAIX::GetDistributionId () {
8151 assert (g_fields && " Missing call to Initialize?" );
8252 // Try to run 'lbs_release -i', and use that response for the distribution
@@ -167,35 +137,6 @@ FileSpec HostInfoAIX::GetProgramFileSpec() {
167137 return g_program_filespec;
168138}
169139
170- bool HostInfoAIX::ComputeSupportExeDirectory (FileSpec &file_spec) {
171- if (HostInfoPosix::ComputeSupportExeDirectory (file_spec) &&
172- file_spec.IsAbsolute () && FileSystem::Instance ().Exists (file_spec))
173- return true ;
174- file_spec.SetDirectory (GetProgramFileSpec ().GetDirectory ());
175- return !file_spec.GetDirectory ().IsEmpty ();
176- }
177-
178- bool HostInfoAIX::ComputeSystemPluginsDirectory (FileSpec &file_spec) {
179- FileSpec temp_file (" /usr/" LLDB_INSTALL_LIBDIR_BASENAME " /lldb/plugins" );
180- FileSystem::Instance ().Resolve (temp_file);
181- file_spec.SetDirectory (temp_file.GetPath ());
182- return true ;
183- }
184-
185- bool HostInfoAIX::ComputeUserPluginsDirectory (FileSpec &file_spec) {
186- // XDG Base Directory Specification
187- // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html If
188- // XDG_DATA_HOME exists, use that, otherwise use ~/.local/share/lldb.
189- const char *xdg_data_home = getenv (" XDG_DATA_HOME" );
190- if (xdg_data_home && xdg_data_home[0 ]) {
191- std::string user_plugin_dir (xdg_data_home);
192- user_plugin_dir += " /lldb" ;
193- file_spec.SetDirectory (user_plugin_dir.c_str ());
194- } else
195- file_spec.SetDirectory (" ~/.local/share/lldb" );
196- return true ;
197- }
198-
199140void HostInfoAIX::ComputeHostArchitectureSupport (ArchSpec &arch_32,
200141 ArchSpec &arch_64) {
201142 HostInfoPosix::ComputeHostArchitectureSupport (arch_32, arch_64);
0 commit comments