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
61protected:
62 static bool ComputeSupportExeDirectory(FileSpec &file_spec);
63 static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
64 ArchSpec &arch_64);
65 static bool ComputeHeaderDirectory(FileSpec &file_spec);
66 static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
67 static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
68
69 static std::string FindComponentInPath(llvm::StringRef path,
70 llvm::StringRef component);
71};
72
73} // namespace lldb_private
74
75#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 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.