31PlatformRemoteDarwinDevice::SDKDirectoryInfo::SDKDirectoryInfo(
33 : directory(sdk_dir), build(), user_cached(false) {
35 llvm::StringRef build_str;
36 std::tie(version, build_str) = ParseVersionBuildDir(dirname_str);
37 build.SetString(build_str);
54 strm.
Printf(
" SDK Path: \"%s\"\n", sdk_directory);
56 strm.
PutCString(
" SDK Path: error: unable to locate SDK\n");
59 for (uint32_t i = 0; i < num_sdk_infos; ++i) {
61 strm.
Printf(
" SDK Roots: [%2u] \"%s\"\n", i,
71 std::string sdkroot_path =
75 if (!sdkroot_path.empty() && platform_file_path && platform_file_path[0]) {
80 const char *paths_to_try[] = {
"Symbols",
"",
"Symbols.Internal",
nullptr};
81 for (
size_t i = 0; paths_to_try[i] !=
nullptr; i++) {
82 local_file.
SetFile(sdkroot_path, FileSpec::Style::native);
83 if (paths_to_try[i][0] !=
'\0')
88 LLDB_LOGF(log,
"Found a copy of %s in the SDK dir %s/%s",
89 platform_file_path, sdkroot_path.c_str(), paths_to_try[i]);
100 const UUID *uuid_ptr,
105 if (platform_file.
GetPath(platform_file_path,
sizeof(platform_file_path))) {
107 if (os_version_dir) {
108 std::string resolved_path =
109 (llvm::Twine(os_version_dir) +
"/" + platform_file_path).str();
111 local_file.
SetFile(resolved_path, FileSpec::Style::native);
115 LLDB_LOGF(log,
"Found a copy of %s in the DeviceSupport dir %s",
116 platform_file_path, os_version_dir);
121 resolved_path = (llvm::Twine(os_version_dir) +
"/Symbols.Internal/" +
125 local_file.
SetFile(resolved_path, FileSpec::Style::native);
130 "Found a copy of %s in the DeviceSupport dir %s/Symbols.Internal",
131 platform_file_path, os_version_dir);
135 (llvm::Twine(os_version_dir) +
"/Symbols/" + platform_file_path)
138 local_file.
SetFile(resolved_path, FileSpec::Style::native);
141 LLDB_LOGF(log,
"Found a copy of %s in the DeviceSupport dir %s/Symbols",
142 platform_file_path, os_version_dir);
146 local_file = platform_file;
151 "unable to locate a platform file for '{0}' in platform '{1}'",
172 if (platform_file.
GetPath(platform_file_path,
sizeof(platform_file_path))) {
182 if (connected_sdk_idx < num_sdk_infos) {
183 LLDB_LOGV(log,
"Searching for {0} in sdk path {1}", platform_file,
200 LLDB_LOGV(log,
"Searching for {0} in sdk path {1}", platform_file,
218 const uint32_t current_sdk_idx =
220 if (current_sdk_idx < num_sdk_infos &&
222 LLDB_LOGV(log,
"Searching for {0} in sdk path {1}", platform_file,
237 for (uint32_t sdk_idx = 0; sdk_idx < num_sdk_infos; ++sdk_idx) {
242 LLDB_LOGV(log,
"Searching for {0} in sdk path {1}", platform_file,
265 module_search_paths_ptr, old_modules,
274 module_spec, process, module_sp, module_search_paths_ptr, old_modules,
280 const bool always_create =
false;
282 module_search_paths_ptr, old_modules,
283 did_create_ptr, always_create);
286 module_sp->SetPlatformFileSpec(platform_file);
296 for (uint32_t i = 0; i < num_sdk_infos; ++i) {
313 if (sdk_info ==
nullptr) {
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
#define LLDB_LOGV(log,...)
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
void AppendPathComponent(llvm::StringRef component)
const ConstString & GetFilename() const
Filename string const get accessor.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void Clear()
Clears the object state.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
static FileSystem & Instance()
static Status GetSharedModule(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr, llvm::SmallVectorImpl< lldb::ModuleSP > *old_modules, bool *did_create_ptr, bool always_create=false)
virtual llvm::StringRef GetPluginName()=0
A plug-in interface definition class for debugging a process.
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::Module > ModuleSP