Go to the documentation of this file.
24 if (m_remote_platform_sp)
25 return m_remote_platform_sp->GetModuleSpec(module_file_spec, arch,
32 const ModuleSpec &module_spec, ModuleSP &exe_module_sp,
33 const FileSpecList *module_search_paths_ptr) {
46 FileSpec::Style::native);
62 if (permissions && (permissions & eFilePermissionsEveryoneR) == 0)
63 error.SetErrorStringWithFormat(
64 "executable '%s' is not readable",
67 error.SetErrorStringWithFormat(
68 "unable to find executable for '%s'",
72 if (m_remote_platform_sp) {
73 return GetCachedExecutable(resolved_module_spec, exe_module_sp,
74 module_search_paths_ptr);
86 error.SetErrorStringWithFormat(
"the platform is not currently "
87 "connected, and '%s' doesn't exist in "
92 if (
error.Success()) {
95 module_search_paths_ptr,
nullptr,
nullptr);
100 llvm::Triple &module_triple =
102 bool is_vendor_specified =
103 (module_triple.getVendor() != llvm::Triple::UnknownVendor);
104 bool is_os_specified =
105 (module_triple.getOS() != llvm::Triple::UnknownOS);
106 if (!is_vendor_specified || !is_os_specified) {
107 const llvm::Triple &host_triple =
108 HostInfo::GetArchitecture(HostInfo::eArchKindDefault).GetTriple();
110 if (!is_vendor_specified)
111 module_triple.setVendorName(host_triple.getVendorName());
112 if (!is_os_specified)
113 module_triple.setOSName(host_triple.getOSName());
116 exe_module_sp, module_search_paths_ptr,
nullptr,
nullptr);
121 if (
error.Fail() || !exe_module_sp || !exe_module_sp->GetObjectFile()) {
122 exe_module_sp.reset();
123 error.SetErrorStringWithFormat(
124 "'%s' doesn't contain the architecture %s",
133 llvm::ListSeparator LS;
136 GetSupportedArchitectures(process_host_arch)) {
139 module_search_paths_ptr,
nullptr,
nullptr);
141 if (
error.Success()) {
142 if (exe_module_sp && exe_module_sp->GetObjectFile())
145 error.SetErrorToGenericError();
148 arch_names << LS << arch.GetArchitectureName();
151 if (
error.Fail() || !exe_module_sp) {
154 error.SetErrorStringWithFormatv(
155 "'{0}' doesn't contain any '{1}' platform architectures: {2}",
156 resolved_module_spec.
GetFileSpec(), GetPluginName(),
159 error.SetErrorStringWithFormat(
160 "'%s' is not readable",
171 llvm::StringRef command,
const FileSpec &working_dir,
int *status_ptr,
174 return RunShellCommand(llvm::StringRef(), command, working_dir, status_ptr,
175 signo_ptr, command_output, timeout);
179 llvm::StringRef shell, llvm::StringRef command,
const FileSpec &working_dir,
180 int *status_ptr,
int *signo_ptr,
std::string *command_output,
182 if (m_remote_platform_sp)
183 return m_remote_platform_sp->RunShellCommand(shell, command, working_dir,
184 status_ptr, signo_ptr,
185 command_output, timeout);
187 signo_ptr, command_output, timeout);
192 if (m_remote_platform_sp)
193 return m_remote_platform_sp->MakeDirectory(file_spec, file_permissions);
199 if (m_remote_platform_sp)
200 return m_remote_platform_sp->GetFilePermissions(file_spec,
207 if (m_remote_platform_sp)
208 return m_remote_platform_sp->SetFilePermissions(file_spec,
216 if (m_remote_platform_sp)
217 return m_remote_platform_sp->OpenFile(file_spec, flags, mode,
error);
222 if (m_remote_platform_sp)
223 return m_remote_platform_sp->CloseFile(fd,
error);
228 void *dst, uint64_t dst_len,
230 if (m_remote_platform_sp)
231 return m_remote_platform_sp->ReadFile(fd, offset, dst, dst_len,
error);
236 const void *src, uint64_t src_len,
238 if (m_remote_platform_sp)
239 return m_remote_platform_sp->WriteFile(fd, offset, src, src_len,
error);
244 if (m_remote_platform_sp)
245 return m_remote_platform_sp->GetFileSize(file_spec);
251 if (m_remote_platform_sp)
252 return m_remote_platform_sp->CreateSymlink(src, dst);
257 if (m_remote_platform_sp)
258 return m_remote_platform_sp->GetFileExists(file_spec);
263 if (m_remote_platform_sp)
264 return m_remote_platform_sp->Unlink(file_spec);
270 if (m_remote_platform_sp)
271 return m_remote_platform_sp->CalculateMD5(file_spec, low, high);
276 if (IsRemote() && m_remote_platform_sp)
277 return m_remote_platform_sp->GetRemoteWorkingDirectory();
283 if (IsRemote() && m_remote_platform_sp)
284 return m_remote_platform_sp->SetRemoteWorkingDirectory(working_dir);
289 const UUID *uuid_ptr,
291 if (IsRemote() && m_remote_platform_sp)
292 return m_remote_platform_sp->GetFileWithUUID(platform_file, uuid_ptr,
296 local_file = platform_file;
301 if (m_remote_platform_sp) {
302 m_os_version = m_remote_platform_sp->GetOSVersion();
303 return !m_os_version.empty();
309 if (m_remote_platform_sp)
310 return m_remote_platform_sp->GetRemoteOSBuildString();
315 if (m_remote_platform_sp)
316 return m_remote_platform_sp->GetRemoteOSKernelDescription();
321 if (m_remote_platform_sp)
322 return m_remote_platform_sp->GetRemoteSystemArchitecture();
327 if (m_remote_platform_sp)
328 return m_remote_platform_sp->GetHostname();
333 if (m_remote_platform_sp)
334 return m_remote_platform_sp->GetUserIDResolver();
339 if (m_remote_platform_sp)
340 return m_remote_platform_sp->GetEnvironment();
345 if (m_remote_platform_sp)
346 return m_remote_platform_sp->IsConnected();
352 if (m_remote_platform_sp)
353 return m_remote_platform_sp->GetProcessInfo(pid, process_info);
360 if (m_remote_platform_sp)
361 return m_remote_platform_sp->FindProcesses(match_info, process_infos);
366 llvm::StringRef plugin_name,
370 if (m_remote_platform_sp)
371 return m_remote_platform_sp->ConnectProcess(connect_url, plugin_name,
372 debugger, target,
error);
378 if (m_remote_platform_sp)
379 return m_remote_platform_sp->LaunchProcess(launch_info);
384 if (m_remote_platform_sp)
385 return m_remote_platform_sp->KillProcess(pid);
391 if (m_remote_platform_sp)
392 return m_remote_platform_sp->ConnectToWaitingProcesses(debugger,
error);
static bool ResolveExecutableInBundle(FileSpec &file)
When executable files may live within a directory, where the directory represents an executable bundl...
bool ResolveExecutableLocation(FileSpec &file_spec)
Call into the Host to see if it can help find the file.
llvm::Triple & GetTriple()
Architecture triple accessor.
static llvm::raw_ostream & error(Stream &strm)
const char * GetData() const
string(SUBSTRING ${p} 10 -1 pStripped) if($
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
bool IsValid() const
Tests if this ArchSpec is valid.
An abstract interface for things that know how to map numeric user/group IDs into names.
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
uint32_t GetPermissions(const FileSpec &file_spec) const
Return the current permissions of the given file.
ArchSpec & GetArchitecture()
static FileSystem & Instance()
A class that represents a running process on the host machine.
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
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)