LLDB mainline
HostInfoMacOSX.h
Go to the documentation of this file.
1//===-- HostInfoMacOSX.h ----------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_HOST_MACOSX_HOSTINFOMACOSX_H
10#define LLDB_HOST_MACOSX_HOSTINFOMACOSX_H
11
15#include "llvm/ADT/StringRef.h"
16#include "llvm/Support/VersionTuple.h"
17#include <optional>
18
19namespace lldb_private {
20
21class ArchSpec;
22
24 friend class HostInfoBase;
25
26public:
27 static llvm::VersionTuple GetOSVersion();
28 static llvm::VersionTuple GetMacCatalystVersion();
29 static std::optional<std::string> GetOSBuildString();
35
36 /// Query xcrun to find an Xcode SDK directory.
37 ///
38 /// Note, this is an expensive operation if the SDK we're querying
39 /// does not exist in an Xcode installation path on the host.
40 static llvm::Expected<llvm::StringRef> GetSDKRoot(SDKOptions options);
41 static llvm::Expected<llvm::StringRef> FindSDKTool(XcodeSDK sdk,
42 llvm::StringRef tool);
43
44 /// Shared cache utilities
46 GetSharedCacheImageInfo(llvm::StringRef image_name);
47
48protected:
49 static bool ComputeSupportExeDirectory(FileSpec &file_spec);
50 static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
51 ArchSpec &arch_64);
52 static bool ComputeHeaderDirectory(FileSpec &file_spec);
53 static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
54 static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
55
56 static std::string FindComponentInPath(llvm::StringRef path,
57 llvm::StringRef component);
58};
59
60} // namespace lldb_private
61
62#endif
An architecture specification class.
Definition ArchSpec.h:31
A file utility class.
Definition FileSpec.h:57
static llvm::Expected< llvm::StringRef > GetSDKRoot(SDKOptions options)
Query xcrun to find an Xcode SDK directory.
static FileSpec GetProgramFileSpec()
static std::optional< std::string > GetOSBuildString()
static FileSpec GetCurrentXcodeToolchainDirectory()
static FileSpec GetXcodeContentsDirectory()
static bool ComputeSupportExeDirectory(FileSpec &file_spec)
static std::string FindComponentInPath(llvm::StringRef path, llvm::StringRef component)
static SharedCacheImageInfo GetSharedCacheImageInfo(llvm::StringRef image_name)
Shared cache utilities.
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64)
static bool ComputeUserPluginsDirectory(FileSpec &file_spec)
static FileSpec GetCurrentCommandLineToolsDirectory()
static llvm::VersionTuple GetMacCatalystVersion()
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec)
static bool ComputeHeaderDirectory(FileSpec &file_spec)
static FileSpec GetXcodeDeveloperDirectory()
static llvm::VersionTuple GetOSVersion()
static llvm::Expected< llvm::StringRef > FindSDKTool(XcodeSDK sdk, llvm::StringRef tool)
An abstraction for Xcode-style SDKs that works like ArchSpec.
Definition XcodeSDK.h:25
A class that represents a running process on the host machine.