9#ifndef LLDB_HOST_HOSTINFOBASE_H
10#define LLDB_HOST_HOSTINFOBASE_H
18#include "llvm/ADT/StringRef.h"
19#include "llvm/Support/Errc.h"
36struct HostInfoError :
public llvm::ErrorInfo<HostInfoError> {
40 HostInfoError(
const std::string message) :
message_(std::move(message)) {}
42 void log(llvm::raw_ostream &
OS)
const override {
OS <<
"HostInfoError"; }
44 std::error_code convertToErrorCode()
const override {
45 return llvm::inconvertibleErrorCode();
49char HostInfoError::ID = 0;
86 static std::optional<ArchitectureKind>
125 llvm::StringRef dir);
136 return llvm::make_error<HostInfoError>(
"cannot determine SDK root");
141 llvm::StringRef tool) {
142 return llvm::errorCodeToError(llvm::errc::no_such_file_or_directory);
const std::string message_
An architecture specification class.
static FileSpec GetGlobalTempDir()
Returns the global temporary directory.
static llvm::Expected< llvm::StringRef > GetSDKRoot(SDKOptions options)
Return the directory containing something like a SDK (reused for Swift).
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64)
void(FileSpec &this_file) SharedLibraryDirectoryHelper
A helper function for determining the liblldb location.
static bool ComputeSharedLibraryDirectory(FileSpec &file_spec)
static bool ComputeSupportExeDirectory(FileSpec &file_spec)
static ArchSpec GetAugmentedArchSpec(llvm::StringRef triple)
If the triple does not specify the vendor, os, and environment parts, we "augment" these using inform...
static FileSpec GetHeaderDir()
Returns the directory containing the lldb headers.
static llvm::StringRef GetDistributionId()
Returns the distribution id of the host.
static FileSpec GetXcodeDeveloperDirectory()
static llvm::Expected< llvm::StringRef > FindSDKTool(XcodeSDK sdk, llvm::StringRef tool)
Return the path to a specific tool in the specified Xcode SDK.
static const ArchSpec & GetArchitecture(ArchitectureKind arch_kind=eArchKindDefault)
static std::optional< ArchitectureKind > ParseArchitectureKind(llvm::StringRef kind)
static llvm::Triple GetTargetTriple()
Gets the host target triple.
static bool ComputePathRelativeToLibrary(FileSpec &file_spec, llvm::StringRef dir)
static bool ComputeTempFileBaseDirectory(FileSpec &file_spec)
static FileSpec GetSupportExeDir()
Returns the directory containing the support executables (debugserver, ...).
static bool ComputeUserPluginsDirectory(FileSpec &file_spec)
static FileSpec GetProcessTempDir()
Returns the proces temporary directory.
static SharedCacheImageInfo GetSharedCacheImageInfo(llvm::StringRef image_name)
Return information about module image_name if it is loaded in the current process's address space.
static bool ComputeHeaderDirectory(FileSpec &file_spec)
static FileSpec GetShlibDir()
Returns the directory containing the lldb shared library.
static FileSpec GetSystemPluginDir()
Returns the directory containing the system plugins.
static bool ComputeGlobalTempFileDirectory(FileSpec &file_spec)
static bool ComputeProcessTempFileDirectory(FileSpec &file_spec)
static FileSpec GetUserPluginDir()
Returns the directory containing the user plugins.
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec)
static FileSpec GetXcodeContentsDirectory()
static void Initialize(SharedLibraryDirectoryHelper *helper=nullptr)
An abstraction for Xcode-style SDKs that works like ArchSpec.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::optional< XcodeSDK > XcodeSDKSelection
lldb::DataBufferSP data_sp