LLDB mainline
lldb_private::HostInfoBase Class Reference

#include <HostInfoBase.h>

Inheritance diagram for lldb_private::HostInfoBase:
[legend]

Classes

struct  SDKOptions

Public Types

enum  ArchitectureKind { eArchKindDefault , eArchKind32 , eArchKind64 }
using SharedLibraryDirectoryHelper = void(FileSpec &this_file)
 A helper function for determining the liblldb location.

Static Public Member Functions

static void Initialize (SharedLibraryDirectoryHelper *helper=nullptr)
static void Terminate ()
static llvm::Triple GetTargetTriple ()
 Gets the host target triple.
static const ArchSpecGetArchitecture (ArchitectureKind arch_kind=eArchKindDefault)
static std::optional< ArchitectureKindParseArchitectureKind (llvm::StringRef kind)
static FileSpec GetShlibDir ()
 Returns the directory containing the lldb shared library.
static FileSpec GetSupportExeDir ()
 Returns the directory containing the support executables (debugserver, ...).
static FileSpec GetHeaderDir ()
 Returns the directory containing the lldb headers.
static FileSpec GetSystemPluginDir ()
 Returns the directory containing the system plugins.
static FileSpec GetUserHomeDir ()
 Returns the directory containing the users home (e.g.
static FileSpec GetUserLLDBDir ()
 Returns the directory containing the users lldb home (e.g.
static FileSpec GetUserPluginDir ()
 Returns the directory containing the user plugins.
static FileSpec GetProcessTempDir ()
 Returns the process temporary directory.
static FileSpec GetGlobalTempDir ()
 Returns the global temporary directory.
static ArchSpec GetAugmentedArchSpec (llvm::StringRef triple)
 If the triple does not specify the vendor, os, and environment parts, we "augment" these using information from the host and return the resulting ArchSpec object.
static bool ComputePathRelativeToLibrary (FileSpec &file_spec, llvm::StringRef dir)
static FileSpec GetXcodeContentsDirectory ()
static FileSpec GetXcodeDeveloperDirectory ()
static FileSpec GetCurrentXcodeToolchainDirectory ()
static FileSpec GetCurrentCommandLineToolsDirectory ()
static llvm::Expected< llvm::StringRef > GetSDKRoot (SDKOptions options)
 Return the directory containing something like a SDK (reused for Swift).
static llvm::Expected< llvm::StringRef > FindSDKTool (XcodeSDK sdk, llvm::StringRef tool)
 Return the path to a specific tool in the specified Xcode SDK.
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 llvm::StringRef GetDistributionId ()
 Returns the distribution id of the host.

Static Protected Member Functions

static bool ComputeSharedLibraryDirectory (FileSpec &file_spec)
static bool ComputeSupportExeDirectory (FileSpec &file_spec)
static bool ComputeProcessTempFileDirectory (FileSpec &file_spec)
static bool ComputeGlobalTempFileDirectory (FileSpec &file_spec)
static bool ComputeTempFileBaseDirectory (FileSpec &file_spec)
static bool ComputeHeaderDirectory (FileSpec &file_spec)
static bool ComputeSystemPluginsDirectory (FileSpec &file_spec)
static bool ComputeUserHomeDirectory (FileSpec &file_spec)
static bool ComputeUserLLDBHomeDirectory (FileSpec &file_spec)
static bool ComputeUserPluginsDirectory (FileSpec &file_spec)
static void ComputeHostArchitectureSupport (ArchSpec &arch_32, ArchSpec &arch_64)

Private Member Functions

 HostInfoBase ()=default
 ~HostInfoBase ()=default

Detailed Description

Definition at line 52 of file HostInfoBase.h.

Member Typedef Documentation

◆ SharedLibraryDirectoryHelper

A helper function for determining the liblldb location.

It receives a FileSpec with the location of file containing this code. It can (optionally) replace it with a file spec pointing to a more canonical copy.

Definition at line 63 of file HostInfoBase.h.

Member Enumeration Documentation

◆ ArchitectureKind

Enumerator
eArchKindDefault 
eArchKind32 
eArchKind64 

Definition at line 74 of file HostInfoBase.h.

Constructor & Destructor Documentation

◆ HostInfoBase()

lldb_private::HostInfoBase::HostInfoBase ( )
privatedefault

◆ ~HostInfoBase()

lldb_private::HostInfoBase::~HostInfoBase ( )
privatedefault

Member Function Documentation

◆ ComputeGlobalTempFileDirectory()

◆ ComputeHeaderDirectory()

bool HostInfoBase::ComputeHeaderDirectory ( FileSpec & file_spec)
staticprotected

Definition at line 331 of file HostInfoBase.cpp.

◆ ComputeHostArchitectureSupport()

void HostInfoBase::ComputeHostArchitectureSupport ( ArchSpec & arch_32,
ArchSpec & arch_64 )
staticprotected

◆ ComputePathRelativeToLibrary()

◆ ComputeProcessTempFileDirectory()

◆ ComputeSharedLibraryDirectory()

◆ ComputeSupportExeDirectory()

bool HostInfoBase::ComputeSupportExeDirectory ( FileSpec & file_spec)
staticprotected

Definition at line 289 of file HostInfoBase.cpp.

References GetShlibDir().

◆ ComputeSystemPluginsDirectory()

bool HostInfoBase::ComputeSystemPluginsDirectory ( FileSpec & file_spec)
staticprotected

Definition at line 337 of file HostInfoBase.cpp.

◆ ComputeTempFileBaseDirectory()

bool HostInfoBase::ComputeTempFileBaseDirectory ( FileSpec & file_spec)
staticprotected

◆ ComputeUserHomeDirectory()

bool HostInfoBase::ComputeUserHomeDirectory ( FileSpec & file_spec)
staticprotected

◆ ComputeUserLLDBHomeDirectory()

bool HostInfoBase::ComputeUserLLDBHomeDirectory ( FileSpec & file_spec)
staticprotected

◆ ComputeUserPluginsDirectory()

bool HostInfoBase::ComputeUserPluginsDirectory ( FileSpec & file_spec)
staticprotected

Definition at line 357 of file HostInfoBase.cpp.

◆ FindSDKTool()

llvm::Expected< llvm::StringRef > lldb_private::HostInfoBase::FindSDKTool ( XcodeSDK sdk,
llvm::StringRef tool )
inlinestatic

Return the path to a specific tool in the specified Xcode SDK.

Definition at line 150 of file HostInfoBase.h.

◆ GetArchitecture()

const ArchSpec & HostInfoBase::GetArchitecture ( ArchitectureKind arch_kind = eArchKindDefault)
static

Definition at line 100 of file HostInfoBase.cpp.

References eArchKind32, eArchKind64, and g_fields.

◆ GetAugmentedArchSpec()

ArchSpec HostInfoBase::GetAugmentedArchSpec ( llvm::StringRef triple)
static

If the triple does not specify the vendor, os, and environment parts, we "augment" these using information from the host and return the resulting ArchSpec object.

Definition at line 223 of file HostInfoBase.cpp.

References lldb_private::ArchSpec::ContainsOnlyArch().

◆ GetCurrentCommandLineToolsDirectory()

FileSpec lldb_private::HostInfoBase::GetCurrentCommandLineToolsDirectory ( )
inlinestatic

Definition at line 138 of file HostInfoBase.h.

◆ GetCurrentXcodeToolchainDirectory()

FileSpec lldb_private::HostInfoBase::GetCurrentXcodeToolchainDirectory ( )
inlinestatic

Definition at line 137 of file HostInfoBase.h.

◆ GetDistributionId()

llvm::StringRef lldb_private::HostInfoBase::GetDistributionId ( )
inlinestatic

Returns the distribution id of the host.

This will be something like "ubuntu", "fedora", etc. on Linux.

Returns
Returns either std::nullopt or a reference to a const std::string containing the distribution id

Definition at line 168 of file HostInfoBase.h.

◆ GetGlobalTempDir()

FileSpec HostInfoBase::GetGlobalTempDir ( )
static

Returns the global temporary directory.

This directory will not be cleaned up when this process exits. Only the directory member of the FileSpec is filled in.

Definition at line 211 of file HostInfoBase.cpp.

References g_fields.

◆ GetHeaderDir()

FileSpec HostInfoBase::GetHeaderDir ( )
static

Returns the directory containing the lldb headers.

Only the directory member of the FileSpec is filled in.

Definition at line 146 of file HostInfoBase.cpp.

References g_fields.

◆ GetProcessTempDir()

FileSpec HostInfoBase::GetProcessTempDir ( )
static

Returns the process temporary directory.

This directory will be cleaned up when this process exits. Only the directory member of the FileSpec is filled in.

Definition at line 199 of file HostInfoBase.cpp.

References g_fields.

◆ GetSDKRoot()

llvm::Expected< llvm::StringRef > lldb_private::HostInfoBase::GetSDKRoot ( SDKOptions options)
inlinestatic

Return the directory containing something like a SDK (reused for Swift).

Definition at line 145 of file HostInfoBase.h.

◆ GetSharedCacheImageInfo()

SharedCacheImageInfo lldb_private::HostInfoBase::GetSharedCacheImageInfo ( llvm::StringRef image_name)
inlinestatic

Return information about module image_name if it is loaded in the current process's address space.

Definition at line 158 of file HostInfoBase.h.

◆ GetShlibDir()

FileSpec HostInfoBase::GetShlibDir ( )
static

Returns the directory containing the lldb shared library.

Only the directory member of the FileSpec is filled in.

Definition at line 126 of file HostInfoBase.cpp.

References g_fields.

Referenced by lldb_private::HostInfoMacOSX::ComputeHeaderDirectory(), ComputePathRelativeToLibrary(), ComputeSupportExeDirectory(), lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory(), and lldb_private::HostInfoMacOSX::ComputeSystemPluginsDirectory().

◆ GetSupportExeDir()

FileSpec HostInfoBase::GetSupportExeDir ( )
static

Returns the directory containing the support executables (debugserver, ...).

Only the directory member of the FileSpec is filled in.

Definition at line 136 of file HostInfoBase.cpp.

References g_fields.

◆ GetSystemPluginDir()

FileSpec HostInfoBase::GetSystemPluginDir ( )
static

Returns the directory containing the system plugins.

Only the directory member of the FileSpec is filled in.

Definition at line 156 of file HostInfoBase.cpp.

References g_fields.

◆ GetTargetTriple()

llvm::Triple HostInfoBase::GetTargetTriple ( )
static

Gets the host target triple.

Returns
The host target triple.

Definition at line 93 of file HostInfoBase.cpp.

References g_fields.

◆ GetUserHomeDir()

FileSpec HostInfoBase::GetUserHomeDir ( )
static

Returns the directory containing the users home (e.g.

~/). Only the directory member of the FileSpec is filled in.

Definition at line 168 of file HostInfoBase.cpp.

References g_fields.

Referenced by ComputeUserLLDBHomeDirectory(), and lldb_private::HostInfoMacOSX::ComputeUserPluginsDirectory().

◆ GetUserLLDBDir()

FileSpec HostInfoBase::GetUserLLDBDir ( )
static

Returns the directory containing the users lldb home (e.g.

~/.lldb/). Only the directory member of the FileSpec is filled in.

Definition at line 178 of file HostInfoBase.cpp.

References g_fields.

◆ GetUserPluginDir()

FileSpec HostInfoBase::GetUserPluginDir ( )
static

Returns the directory containing the user plugins.

Only the directory member of the FileSpec is filled in.

Definition at line 188 of file HostInfoBase.cpp.

References g_fields.

◆ GetXcodeContentsDirectory()

FileSpec lldb_private::HostInfoBase::GetXcodeContentsDirectory ( )
inlinestatic

Definition at line 135 of file HostInfoBase.h.

◆ GetXcodeDeveloperDirectory()

FileSpec lldb_private::HostInfoBase::GetXcodeDeveloperDirectory ( )
inlinestatic

Definition at line 136 of file HostInfoBase.h.

◆ Initialize()

◆ ParseArchitectureKind()

std::optional< HostInfoBase::ArchitectureKind > HostInfoBase::ParseArchitectureKind ( llvm::StringRef kind)
static

◆ Terminate()


The documentation for this class was generated from the following files: