|
LLDB mainline
|
#include "lldb/Host/macosx/HostInfoMacOSX.h"#include "lldb/Host/FileSystem.h"#include "lldb/Host/Host.h"#include "lldb/Host/HostInfo.h"#include "lldb/Utility/Args.h"#include "lldb/Utility/ConstString.h"#include "lldb/Utility/DataBuffer.h"#include "lldb/Utility/DataExtractor.h"#include "lldb/Utility/LLDBLog.h"#include "lldb/Utility/Log.h"#include "lldb/Utility/Timer.h"#include "lldb/Utility/VirtualDataExtractor.h"#include "llvm/ADT/DenseMap.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/StringMap.h"#include "llvm/Support/FileSystem.h"#include "llvm/Support/Path.h"#include "llvm/Support/RWMutex.h"#include "llvm/Support/raw_ostream.h"#include <optional>#include <string>#include <cstdlib>#include <dlfcn.h>#include <sys/sysctl.h>#include <sys/syslimits.h>#include <sys/types.h>#include <uuid/uuid.h>#include <AvailabilityMacros.h>#include <CoreFoundation/CoreFoundation.h>#include <Foundation/Foundation.h>#include <mach-o/dyld.h>#include <objc/objc-auto.h>#include <TargetConditionals.h>Go to the source code of this file.
Classes | |
| struct | segment |
Macros | |
| #define | CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) |
| #define | CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) |
| #define | CPU_ARCH_ABI64_32 0x02000000 |
| #define | CPU_TYPE_ARM64_32 (CPU_TYPE_ARM | CPU_ARCH_ABI64_32) |
Typedefs | |
| typedef struct dyld_process_s * | dyld_process_t |
| typedef struct dyld_process_snapshot_s * | dyld_process_snapshot_t |
| typedef struct dyld_shared_cache_s * | dyld_shared_cache_t |
| typedef struct dyld_image_s * | dyld_image_t |
Functions | |
| static void | ParseOSVersion (llvm::VersionTuple &version, NSString *Key) |
| static bool | ResolveAndVerifyCandidateSupportDir (FileSpec &path) |
| Resolve the given candidate support dir and return true if it's valid. | |
| static std::string | GetEnvDeveloperDir () |
| Return and cache $DEVELOPER_DIR if it is set and exists. | |
| static llvm::Expected< std::string > | xcrun (const std::string &sdk, llvm::ArrayRef< llvm::StringRef > arguments, llvm::StringRef developer_dir="") |
| static llvm::Expected< std::string > | GetXcodeSDK (XcodeSDK sdk) |
| static llvm::Expected< llvm::StringRef > | find_cached_path (llvm::StringMap< ErrorOrPath > &cache, std::mutex &mutex, llvm::StringRef key, std::function< llvm::Expected< std::string >(void)> compute) |
| int | dyld_shared_cache_iterate_text (const uuid_t cacheUuid, void(^callback)(const dyld_shared_cache_dylib_text_info *info)) |
| uint8_t * | _dyld_get_shared_cache_range (size_t *length) |
| bool | _dyld_get_shared_cache_uuid (uuid_t uuid) |
| bool | dyld_image_for_each_segment_info (dyld_image_t image, void(^)(const char *segmentName, uint64_t vmAddr, uint64_t vmSize, int perm)) |
| const char * | dyld_shared_cache_file_path (void) |
| bool | dyld_shared_cache_for_file (const char *filePath, void(^block)(dyld_shared_cache_t cache)) |
| void | dyld_shared_cache_copy_uuid (dyld_shared_cache_t cache, uuid_t *uuid) |
| uint64_t | dyld_shared_cache_get_base_address (dyld_shared_cache_t cache) |
| void | dyld_shared_cache_for_each_image (dyld_shared_cache_t cache, void(^block)(dyld_image_t image)) |
| bool | dyld_image_copy_uuid (dyld_image_t cache, uuid_t *uuid) |
| const char * | dyld_image_get_installname (dyld_image_t image) |
| const char * | dyld_image_get_file_path (dyld_image_t image) |
| static DataExtractorSP | map_shared_cache_binary_segments (void *image) |
| SharedCacheInfo & | GetSharedCacheSingleton (SymbolSharedCacheUse sc_mode) |
| #define CPU_ARCH_ABI64_32 0x02000000 |
Definition at line 67 of file HostInfoMacOSX.mm.
| #define CPU_SUBTYPE_X86_64_H ((cpu_subtype_t)8) |
Definition at line 60 of file HostInfoMacOSX.mm.
Referenced by lldb_private::HostInfoMacOSX::ComputeHostArchitectureSupport(), and LaunchProcessPosixSpawn().
| #define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64) |
Definition at line 63 of file HostInfoMacOSX.mm.
Referenced by lldb_private::HostInfoMacOSX::ComputeHostArchitectureSupport(), and GetMacOSXProcessCPUType().
| #define CPU_TYPE_ARM64_32 (CPU_TYPE_ARM | CPU_ARCH_ABI64_32) |
Definition at line 68 of file HostInfoMacOSX.mm.
Referenced by lldb_private::HostInfoMacOSX::ComputeHostArchitectureSupport(), and GetMacOSXProcessCPUType().
| typedef struct dyld_image_s* dyld_image_t |
Definition at line 664 of file HostInfoMacOSX.mm.
| typedef struct dyld_process_snapshot_s* dyld_process_snapshot_t |
Definition at line 662 of file HostInfoMacOSX.mm.
| typedef struct dyld_process_s* dyld_process_t |
Definition at line 661 of file HostInfoMacOSX.mm.
| typedef struct dyld_shared_cache_s* dyld_shared_cache_t |
Definition at line 663 of file HostInfoMacOSX.mm.
| uint8_t * _dyld_get_shared_cache_range | ( | size_t * | length | ) |
| bool dyld_image_copy_uuid | ( | dyld_image_t | cache, |
| uuid_t * | uuid ) |
Referenced by ObjectFileMachO::ParseSymtab().
| bool dyld_image_for_each_segment_info | ( | dyld_image_t | image, |
| void(^)(const char *segmentName, uint64_t vmAddr, uint64_t vmSize, int perm) | ) |
Referenced by map_shared_cache_binary_segments().
| const char * dyld_image_get_file_path | ( | dyld_image_t | image | ) |
| const char * dyld_image_get_installname | ( | dyld_image_t | image | ) |
| void dyld_shared_cache_copy_uuid | ( | dyld_shared_cache_t | cache, |
| uuid_t * | uuid ) |
Referenced by ObjectFileMachO::ParseSymtab().
| const char * dyld_shared_cache_file_path | ( | void | ) |
| void dyld_shared_cache_for_each_image | ( | dyld_shared_cache_t | cache, |
| void(^)(dyld_image_t image) | block ) |
Referenced by ObjectFileMachO::ParseSymtab().
| bool dyld_shared_cache_for_file | ( | const char * | filePath, |
| void(^)(dyld_shared_cache_t cache) | block ) |
| uint64_t dyld_shared_cache_get_base_address | ( | dyld_shared_cache_t | cache | ) |
| int dyld_shared_cache_iterate_text | ( | const uuid_t | cacheUuid, |
| void(^)(const dyld_shared_cache_dylib_text_info *info) | callback ) |
|
static |
Definition at line 589 of file HostInfoMacOSX.mm.
References error(), LLDB_SCOPED_TIMER, and lldb_private::toString().
Referenced by lldb_private::HostInfoMacOSX::FindSDKTool(), and lldb_private::HostInfoMacOSX::GetSDKRoot().
|
static |
Return and cache $DEVELOPER_DIR if it is set and exists.
Definition at line 329 of file HostInfoMacOSX.mm.
References lldb_private::FileSpec::GetPath(), and lldb_private::FileSystem::Instance().
Referenced by lldb_private::HostInfoMacOSX::GetXcodeContentsDirectory(), and GetXcodeSDK().
| SharedCacheInfo & GetSharedCacheSingleton | ( | SymbolSharedCacheUse | sc_mode | ) |
Definition at line 1062 of file HostInfoMacOSX.mm.
Referenced by lldb_private::HostInfoMacOSX::GetSharedCacheImageInfo(), lldb_private::HostInfoMacOSX::GetSharedCacheImageInfo(), lldb_private::HostInfoMacOSX::GetSharedCacheImageInfo(), lldb_private::HostInfoMacOSX::GetSharedCacheImageInfo(), and lldb_private::HostInfoMacOSX::SharedCacheIndexFiles().
|
static |
Definition at line 497 of file HostInfoMacOSX.mm.
References lldb_private::XcodeSDK::FindXcodeContentsDirectoryInPath(), lldb_private::XcodeSDK::GetCanonicalName(), GetEnvDeveloperDir(), lldb_private::GetLog(), lldb_private::XcodeSDK::GetString(), lldb_private::Host, lldb_private::FileSystem::Instance(), lldb_private::XcodeSDK::Info::internal, LLDB_LOG, lldb_private::XcodeSDK::MacOSX, lldb_private::XcodeSDK::Parse(), lldb_private::XcodeSDK::Info::type, lldb_private::XcodeSDK::Info::version, and xcrun().
Referenced by lldb_private::HostInfoMacOSX::GetSDKRoot().
|
static |
Definition at line 791 of file HostInfoMacOSX.mm.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Append(), segment::data, dyld_image_for_each_segment_info(), lldb_private::GetLog(), lldb_private::Log::GetVerbose(), LLDB_LOGF, lldb_private::Modules, segment::name, segment::size, UINT64_MAX, segment::vmaddr, and segment::vmsize.
|
static |
Definition at line 86 of file HostInfoMacOSX.mm.
Referenced by lldb_private::HostInfoMacOSX::GetMacCatalystVersion(), and lldb_private::HostInfoMacOSX::GetOSVersion().
Resolve the given candidate support dir and return true if it's valid.
Definition at line 136 of file HostInfoMacOSX.mm.
References lldb_private::FileSystem::Instance(), lldb_private::FileSystem::IsDirectory(), and lldb_private::FileSystem::Resolve().
Referenced by lldb_private::HostInfoMacOSX::ComputeSupportExeDirectory().
|
static |
Definition at line 432 of file HostInfoMacOSX.mm.
References lldb_private::Args::AppendArgument(), error(), lldb_private::Args::GetCommandString(), lldb_private::GetLog(), lldb_private::Host, LLDB_LOG, and lldb_private::Host::RunShellCommand().
Referenced by lldb_private::HostInfoMacOSX::FindSDKTool(), and GetXcodeSDK().