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
50
52 GetSharedCacheImageInfo(ConstString filepath, const UUID &sc_uuid,
55 GetSharedCacheImageInfo(const UUID &uuid, const UUID &sc_uuid,
57
58 static bool SharedCacheIndexFiles(FileSpec &filepath, UUID &uuid,
60
61 /// Check whether a bundle at the given path has a valid code signature that
62 /// chains to a trusted anchor in the system trust store.
63 static bool IsBundleCodeSignTrusted(const FileSpec &bundle_path);
64
65protected:
66 static bool ComputeSupportExeDirectory(FileSpec &file_spec);
67 static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
68 ArchSpec &arch_64);
69 static bool ComputeHeaderDirectory(FileSpec &file_spec);
70 static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
71 static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
72
73 static std::string FindComponentInPath(llvm::StringRef path,
74 llvm::StringRef component);
75};
76
77} // namespace lldb_private
78
79#endif
An architecture specification class.
Definition ArchSpec.h:32
A uniqued constant string class.
Definition ConstString.h:40
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 bool IsBundleCodeSignTrusted(const FileSpec &bundle_path)
Check whether a bundle at the given path has a valid code signature that chains to a trusted anchor i...
static bool SharedCacheIndexFiles(FileSpec &filepath, UUID &uuid, lldb::SymbolSharedCacheUse sc_mode)
static FileSpec GetProgramFileSpec()
static std::optional< std::string > GetOSBuildString()
static FileSpec GetCurrentXcodeToolchainDirectory()
static SharedCacheImageInfo GetSharedCacheImageInfo(ConstString filepath, lldb::SymbolSharedCacheUse sc_mode)
Shared cache utilities.
static FileSpec GetXcodeContentsDirectory()
static bool ComputeSupportExeDirectory(FileSpec &file_spec)
static std::string FindComponentInPath(llvm::StringRef path, llvm::StringRef component)
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)
Represents UUID's of various sizes.
Definition UUID.h:27
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.