LLDB  mainline
RemoteAwarePlatform.cpp
Go to the documentation of this file.
1 //===-- RemoteAwarePlatform.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "lldb/Core/Module.h"
11 #include "lldb/Core/ModuleList.h"
12 #include "lldb/Core/ModuleSpec.h"
13 #include "lldb/Host/FileSystem.h"
14 #include "lldb/Host/Host.h"
15 #include "lldb/Host/HostInfo.h"
17 
18 using namespace lldb_private;
19 using namespace lldb;
20 
21 bool RemoteAwarePlatform::GetModuleSpec(const FileSpec &module_file_spec,
22  const ArchSpec &arch,
23  ModuleSpec &module_spec) {
24  if (m_remote_platform_sp)
25  return m_remote_platform_sp->GetModuleSpec(module_file_spec, arch,
26  module_spec);
27 
28  return false;
29 }
30 
32  const ModuleSpec &module_spec, ModuleSP &exe_module_sp,
33  const FileSpecList *module_search_paths_ptr) {
34  Status error;
35  // Nothing special to do here, just use the actual file and architecture
36 
37  char exe_path[PATH_MAX];
38  ModuleSpec resolved_module_spec(module_spec);
39 
40  if (IsHost()) {
41  // If we have "ls" as the exe_file, resolve the executable location based
42  // on the current path variables
43  if (!FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec())) {
44  resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
45  resolved_module_spec.GetFileSpec().SetFile(exe_path,
46  FileSpec::Style::native);
47  FileSystem::Instance().Resolve(resolved_module_spec.GetFileSpec());
48  }
49 
50  if (!FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec()))
52  resolved_module_spec.GetFileSpec());
53 
54  // Resolve any executable within a bundle on MacOSX
55  Host::ResolveExecutableInBundle(resolved_module_spec.GetFileSpec());
56 
57  if (FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec()))
58  error.Clear();
59  else {
60  const uint32_t permissions = FileSystem::Instance().GetPermissions(
61  resolved_module_spec.GetFileSpec());
62  if (permissions && (permissions & eFilePermissionsEveryoneR) == 0)
63  error.SetErrorStringWithFormat(
64  "executable '%s' is not readable",
65  resolved_module_spec.GetFileSpec().GetPath().c_str());
66  else
67  error.SetErrorStringWithFormat(
68  "unable to find executable for '%s'",
69  resolved_module_spec.GetFileSpec().GetPath().c_str());
70  }
71  } else {
72  if (m_remote_platform_sp) {
73  return GetCachedExecutable(resolved_module_spec, exe_module_sp,
74  module_search_paths_ptr);
75  }
76 
77  // We may connect to a process and use the provided executable (Don't use
78  // local $PATH).
79 
80  // Resolve any executable within a bundle on MacOSX
81  Host::ResolveExecutableInBundle(resolved_module_spec.GetFileSpec());
82 
83  if (FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec()))
84  error.Clear();
85  else
86  error.SetErrorStringWithFormat("the platform is not currently "
87  "connected, and '%s' doesn't exist in "
88  "the system root.",
89  exe_path);
90  }
91 
92  if (error.Success()) {
93  if (resolved_module_spec.GetArchitecture().IsValid()) {
94  error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
95  module_search_paths_ptr, nullptr, nullptr);
96  if (error.Fail()) {
97  // If we failed, it may be because the vendor and os aren't known. If
98  // that is the case, try setting them to the host architecture and give
99  // it another try.
100  llvm::Triple &module_triple =
101  resolved_module_spec.GetArchitecture().GetTriple();
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();
109 
110  if (!is_vendor_specified)
111  module_triple.setVendorName(host_triple.getVendorName());
112  if (!is_os_specified)
113  module_triple.setOSName(host_triple.getOSName());
114 
115  error = ModuleList::GetSharedModule(resolved_module_spec,
116  exe_module_sp, module_search_paths_ptr, nullptr, nullptr);
117  }
118  }
119 
120  // TODO find out why exe_module_sp might be NULL
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",
125  resolved_module_spec.GetFileSpec().GetPath().c_str(),
126  resolved_module_spec.GetArchitecture().GetArchitectureName());
127  }
128  } else {
129  // No valid architecture was specified, ask the platform for the
130  // architectures that we should be using (in the correct order) and see
131  // if we can find a match that way
132  StreamString arch_names;
133  llvm::ListSeparator LS;
134  ArchSpec process_host_arch;
135  for (const ArchSpec &arch :
136  GetSupportedArchitectures(process_host_arch)) {
137  resolved_module_spec.GetArchitecture() = arch;
138  error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
139  module_search_paths_ptr, nullptr, nullptr);
140  // Did we find an executable using one of the
141  if (error.Success()) {
142  if (exe_module_sp && exe_module_sp->GetObjectFile())
143  break;
144  else
145  error.SetErrorToGenericError();
146  }
147 
148  arch_names << LS << arch.GetArchitectureName();
149  }
150 
151  if (error.Fail() || !exe_module_sp) {
152  if (FileSystem::Instance().Readable(
153  resolved_module_spec.GetFileSpec())) {
154  error.SetErrorStringWithFormatv(
155  "'{0}' doesn't contain any '{1}' platform architectures: {2}",
156  resolved_module_spec.GetFileSpec(), GetPluginName(),
157  arch_names.GetData());
158  } else {
159  error.SetErrorStringWithFormat(
160  "'%s' is not readable",
161  resolved_module_spec.GetFileSpec().GetPath().c_str());
162  }
163  }
164  }
165  }
166 
167  return error;
168 }
169 
171  llvm::StringRef command, const FileSpec &working_dir, int *status_ptr,
172  int *signo_ptr, std::string *command_output,
173  const Timeout<std::micro> &timeout) {
174  return RunShellCommand(llvm::StringRef(), command, working_dir, status_ptr,
175  signo_ptr, command_output, timeout);
176 }
177 
179  llvm::StringRef shell, llvm::StringRef command, const FileSpec &working_dir,
180  int *status_ptr, int *signo_ptr, std::string *command_output,
181  const Timeout<std::micro> &timeout) {
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);
186  return Platform::RunShellCommand(shell, command, working_dir, status_ptr,
187  signo_ptr, command_output, timeout);
188 }
189 
191  uint32_t file_permissions) {
192  if (m_remote_platform_sp)
193  return m_remote_platform_sp->MakeDirectory(file_spec, file_permissions);
194  return Platform::MakeDirectory(file_spec, file_permissions);
195 }
196 
198  uint32_t &file_permissions) {
199  if (m_remote_platform_sp)
200  return m_remote_platform_sp->GetFilePermissions(file_spec,
201  file_permissions);
202  return Platform::GetFilePermissions(file_spec, file_permissions);
203 }
204 
206  uint32_t file_permissions) {
207  if (m_remote_platform_sp)
208  return m_remote_platform_sp->SetFilePermissions(file_spec,
209  file_permissions);
210  return Platform::SetFilePermissions(file_spec, file_permissions);
211 }
212 
214  File::OpenOptions flags,
215  uint32_t mode, Status &error) {
216  if (m_remote_platform_sp)
217  return m_remote_platform_sp->OpenFile(file_spec, flags, mode, error);
218  return Platform::OpenFile(file_spec, flags, mode, error);
219 }
220 
222  if (m_remote_platform_sp)
223  return m_remote_platform_sp->CloseFile(fd, error);
224  return Platform::CloseFile(fd, error);
225 }
226 
227 uint64_t RemoteAwarePlatform::ReadFile(lldb::user_id_t fd, uint64_t offset,
228  void *dst, uint64_t dst_len,
229  Status &error) {
230  if (m_remote_platform_sp)
231  return m_remote_platform_sp->ReadFile(fd, offset, dst, dst_len, error);
232  return Platform::ReadFile(fd, offset, dst, dst_len, error);
233 }
234 
235 uint64_t RemoteAwarePlatform::WriteFile(lldb::user_id_t fd, uint64_t offset,
236  const void *src, uint64_t src_len,
237  Status &error) {
238  if (m_remote_platform_sp)
239  return m_remote_platform_sp->WriteFile(fd, offset, src, src_len, error);
240  return Platform::WriteFile(fd, offset, src, src_len, error);
241 }
242 
244  if (m_remote_platform_sp)
245  return m_remote_platform_sp->GetFileSize(file_spec);
246  return Platform::GetFileSize(file_spec);
247 }
248 
250  const FileSpec &dst) {
251  if (m_remote_platform_sp)
252  return m_remote_platform_sp->CreateSymlink(src, dst);
253  return Platform::CreateSymlink(src, dst);
254 }
255 
257  if (m_remote_platform_sp)
258  return m_remote_platform_sp->GetFileExists(file_spec);
259  return Platform::GetFileExists(file_spec);
260 }
261 
263  if (m_remote_platform_sp)
264  return m_remote_platform_sp->Unlink(file_spec);
265  return Platform::Unlink(file_spec);
266 }
267 
268 bool RemoteAwarePlatform::CalculateMD5(const FileSpec &file_spec, uint64_t &low,
269  uint64_t &high) {
270  if (m_remote_platform_sp)
271  return m_remote_platform_sp->CalculateMD5(file_spec, low, high);
272  return Platform::CalculateMD5(file_spec, low, high);
273 }
274 
276  if (IsRemote() && m_remote_platform_sp)
277  return m_remote_platform_sp->GetRemoteWorkingDirectory();
279 }
280 
282  const FileSpec &working_dir) {
283  if (IsRemote() && m_remote_platform_sp)
284  return m_remote_platform_sp->SetRemoteWorkingDirectory(working_dir);
285  return Platform::SetRemoteWorkingDirectory(working_dir);
286 }
287 
289  const UUID *uuid_ptr,
290  FileSpec &local_file) {
291  if (IsRemote() && m_remote_platform_sp)
292  return m_remote_platform_sp->GetFileWithUUID(platform_file, uuid_ptr,
293  local_file);
294 
295  // Default to the local case
296  local_file = platform_file;
297  return Status();
298 }
299 
301  if (m_remote_platform_sp) {
302  m_os_version = m_remote_platform_sp->GetOSVersion();
303  return !m_os_version.empty();
304  }
305  return false;
306 }
307 
308 llvm::Optional<std::string> RemoteAwarePlatform::GetRemoteOSBuildString() {
309  if (m_remote_platform_sp)
310  return m_remote_platform_sp->GetRemoteOSBuildString();
311  return llvm::None;
312 }
313 
315  if (m_remote_platform_sp)
316  return m_remote_platform_sp->GetRemoteOSKernelDescription();
317  return llvm::None;
318 }
319 
321  if (m_remote_platform_sp)
322  return m_remote_platform_sp->GetRemoteSystemArchitecture();
323  return ArchSpec();
324 }
325 
327  if (m_remote_platform_sp)
328  return m_remote_platform_sp->GetHostname();
329  return Platform::GetHostname();
330 }
331 
333  if (m_remote_platform_sp)
334  return m_remote_platform_sp->GetUserIDResolver();
336 }
337 
339  if (m_remote_platform_sp)
340  return m_remote_platform_sp->GetEnvironment();
341  return Platform::GetEnvironment();
342 }
343 
345  if (m_remote_platform_sp)
346  return m_remote_platform_sp->IsConnected();
347  return Platform::IsConnected();
348 }
349 
351  ProcessInstanceInfo &process_info) {
352  if (m_remote_platform_sp)
353  return m_remote_platform_sp->GetProcessInfo(pid, process_info);
354  return Platform::GetProcessInfo(pid, process_info);
355 }
356 
357 uint32_t
359  ProcessInstanceInfoList &process_infos) {
360  if (m_remote_platform_sp)
361  return m_remote_platform_sp->FindProcesses(match_info, process_infos);
362  return Platform::FindProcesses(match_info, process_infos);
363 }
364 
365 lldb::ProcessSP RemoteAwarePlatform::ConnectProcess(llvm::StringRef connect_url,
366  llvm::StringRef plugin_name,
367  Debugger &debugger,
368  Target *target,
369  Status &error) {
370  if (m_remote_platform_sp)
371  return m_remote_platform_sp->ConnectProcess(connect_url, plugin_name,
372  debugger, target, error);
373  return Platform::ConnectProcess(connect_url, plugin_name, debugger, target,
374  error);
375 }
376 
378  if (m_remote_platform_sp)
379  return m_remote_platform_sp->LaunchProcess(launch_info);
380  return Platform::LaunchProcess(launch_info);
381 }
382 
384  if (m_remote_platform_sp)
385  return m_remote_platform_sp->KillProcess(pid);
386  return Platform::KillProcess(pid);
387 }
388 
390  Status &error) {
391  if (m_remote_platform_sp)
392  return m_remote_platform_sp->ConnectToWaitingProcesses(debugger, error);
393  return Platform::ConnectToWaitingProcesses(debugger, error);
394 }
lldb_private::RemoteAwarePlatform::IsConnected
bool IsConnected() const override
Definition: RemoteAwarePlatform.cpp:344
lldb_private::RemoteAwarePlatform::SetFilePermissions
Status SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions) override
Definition: RemoteAwarePlatform.cpp:205
lldb_private::RemoteAwarePlatform::ConnectToWaitingProcesses
size_t ConnectToWaitingProcesses(Debugger &debugger, Status &error) override
Connect to all processes waiting for a debugger to attach.
Definition: RemoteAwarePlatform.cpp:389
lldb_private::ProcessInstanceInfo
Definition: ProcessInfo.h:106
lldb_private::UUID
Definition: UUID.h:23
lldb_private::RemoteAwarePlatform::CloseFile
bool CloseFile(lldb::user_id_t fd, Status &error) override
Definition: RemoteAwarePlatform.cpp:221
lldb_private::Host::ResolveExecutableInBundle
static bool ResolveExecutableInBundle(FileSpec &file)
When executable files may live within a directory, where the directory represents an executable bundl...
Definition: common/Host.cpp:328
lldb_private::RemoteAwarePlatform::GetRemoteSystemArchitecture
ArchSpec GetRemoteSystemArchitecture() override
Definition: RemoteAwarePlatform.cpp:320
lldb_private::ArchSpec
Definition: ArchSpec.h:32
FileSystem.h
lldb_private::Platform::WriteFile
virtual uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, Status &error)
Definition: Platform.cpp:709
lldb_private::Platform::GetEnvironment
virtual Environment GetEnvironment()
Definition: Platform.cpp:1467
lldb_private::RemoteAwarePlatform::ConnectProcess
lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Target *target, Status &error) override
Definition: RemoteAwarePlatform.cpp:365
ModuleSpec.h
Host.h
lldb_private::RemoteAwarePlatform::OpenFile
lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags, uint32_t mode, Status &error) override
Definition: RemoteAwarePlatform.cpp:213
RemoteAwarePlatform.h
lldb_private::File::OpenOptions
OpenOptions
Definition: File.h:49
lldb_private::Platform::MakeDirectory
virtual Status MakeDirectory(const FileSpec &file_spec, uint32_t permissions)
Definition: Platform.cpp:635
lldb_private::RemoteAwarePlatform::GetFilePermissions
Status GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions) override
Definition: RemoteAwarePlatform.cpp:197
Module.h
lldb_private::RemoteAwarePlatform::LaunchProcess
Status LaunchProcess(ProcessLaunchInfo &launch_info) override
Launch a new process on a platform, not necessarily for debugging, it could be just for running the p...
Definition: RemoteAwarePlatform.cpp:377
lldb_private::Platform::OpenFile
virtual lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags, uint32_t mode, Status &error)
Definition: Platform.cpp:675
lldb_private::ProcessInstanceInfoMatch
Definition: ProcessInfo.h:160
lldb_private::Platform::KillProcess
virtual Status KillProcess(const lldb::pid_t pid)
Kill process on a platform.
Definition: Platform.cpp:1049
lldb_private::FileSystem::ResolveExecutableLocation
bool ResolveExecutableLocation(FileSpec &file_spec)
Call into the Host to see if it can help find the file.
Definition: common/FileSystem.cpp:330
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:463
lldb_private::Platform::SetFilePermissions
virtual Status SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions)
Definition: Platform.cpp:662
lldb_private::Target
Definition: Target.h:469
lldb_private::RemoteAwarePlatform::GetFileExists
bool GetFileExists(const FileSpec &file_spec) override
Definition: RemoteAwarePlatform.cpp:256
lldb_private::Platform::GetFilePermissions
virtual Status GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions)
Definition: Platform.cpp:647
lldb_private::Platform::GetUserIDResolver
virtual UserIDResolver & GetUserIDResolver()
Definition: Platform.cpp:719
lldb_private::Platform::RunShellCommand
virtual lldb_private::Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout)
Definition: Platform.cpp:1279
lldb_private::FileSpec
Definition: FileSpec.h:55
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
ModuleList.h
lldb_private::ProcessLaunchInfo
Definition: ProcessLaunchInfo.h:31
lldb_private::RemoteAwarePlatform::GetRemoteOSKernelDescription
llvm::Optional< std::string > GetRemoteOSKernelDescription() override
Definition: RemoteAwarePlatform.cpp:314
lldb_private::Platform::GetRemoteWorkingDirectory
virtual FileSpec GetRemoteWorkingDirectory()
Definition: Platform.h:247
lldb_private::RemoteAwarePlatform::ReadFile
uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, Status &error) override
Definition: RemoteAwarePlatform.cpp:227
lldb_private::Platform::CreateSymlink
virtual Status CreateSymlink(const FileSpec &src, const FileSpec &dst)
Definition: Platform.cpp:1245
lldb_private::RemoteAwarePlatform::SetRemoteWorkingDirectory
bool SetRemoteWorkingDirectory(const FileSpec &working_dir) override
Definition: RemoteAwarePlatform.cpp:281
lldb_private::StreamString::GetData
const char * GetData() const
Definition: StreamString.h:43
lldb_private::Platform::ConnectToWaitingProcesses
virtual size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger, lldb_private::Status &error)
Connect to all processes waiting for a debugger to attach.
Definition: Platform.cpp:1824
lldb_private::Platform::SetRemoteWorkingDirectory
virtual bool SetRemoteWorkingDirectory(const FileSpec &working_dir)
Definition: Platform.cpp:738
StreamString.h
lldb_private::RemoteAwarePlatform::FindProcesses
uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &process_infos) override
Attach to an existing process by process name.
Definition: RemoteAwarePlatform.cpp:358
lldb_private::StreamString
Definition: StreamString.h:23
lldb_private::Platform::CalculateMD5
virtual bool CalculateMD5(const FileSpec &file_spec, uint64_t &low, uint64_t &high)
Definition: Platform.cpp:1311
lldb_private::RemoteAwarePlatform::GetEnvironment
lldb_private::Environment GetEnvironment() override
Definition: RemoteAwarePlatform.cpp:338
lldb_private::Platform::ReadFile
virtual uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, Status &error)
Definition: Platform.cpp:699
lldb_private::Debugger
Definition: Debugger.h:74
lldb_private::RemoteAwarePlatform::Unlink
Status Unlink(const FileSpec &file_spec) override
Definition: RemoteAwarePlatform.cpp:262
HostInfo.h
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::FileSystem::Resolve
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
Definition: common/FileSystem.cpp:235
lldb_private::RemoteAwarePlatform::GetProcessInfo
bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info) override
Definition: RemoteAwarePlatform.cpp:350
lldb_private::ArchSpec::IsValid
bool IsValid() const
Tests if this ArchSpec is valid.
Definition: ArchSpec.h:361
lldb_private::RemoteAwarePlatform::ResolveExecutable
Status ResolveExecutable(const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) override
Find a platform plugin for a given process.
Definition: RemoteAwarePlatform.cpp:31
lldb_private::UserIDResolver
An abstract interface for things that know how to map numeric user/group IDs into names.
Definition: UserIDResolver.h:23
lldb_private::RemoteAwarePlatform::CalculateMD5
bool CalculateMD5(const FileSpec &file_spec, uint64_t &low, uint64_t &high) override
Definition: RemoteAwarePlatform.cpp:268
lldb_private::ModuleSpec::GetFileSpec
FileSpec & GetFileSpec()
Definition: ModuleSpec.h:53
lldb_private::ModuleSpec
Definition: ModuleSpec.h:27
lldb_private::RemoteAwarePlatform::GetModuleSpec
bool GetModuleSpec(const FileSpec &module_file_spec, const ArchSpec &arch, ModuleSpec &module_spec) override
Definition: RemoteAwarePlatform.cpp:21
lldb_private::Status
Definition: Status.h:44
lldb_private::Timeout< std::micro >
lldb_private::RemoteAwarePlatform::MakeDirectory
Status MakeDirectory(const FileSpec &file_spec, uint32_t mode) override
Definition: RemoteAwarePlatform.cpp:190
lldb_private::ArchSpec::GetArchitectureName
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition: ArchSpec.cpp:547
lldb_private::RemoteAwarePlatform::WriteFile
uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, Status &error) override
Definition: RemoteAwarePlatform.cpp:235
uint32_t
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb_private::RemoteAwarePlatform::GetFileWithUUID
Status GetFileWithUUID(const FileSpec &platform_file, const UUID *uuid, FileSpec &local_file) override
Locate a file for a platform.
Definition: RemoteAwarePlatform.cpp:288
lldb_private::Environment
Definition: Environment.h:18
lldb_private::Platform::GetFileSize
virtual lldb::user_id_t GetFileSize(const FileSpec &file_spec)
Definition: Platform.cpp:689
lldb_private::Platform::FindProcesses
virtual uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &proc_infos)
Attach to an existing process by process name.
Definition: Platform.cpp:985
lldb_private::FileSystem::GetPermissions
uint32_t GetPermissions(const FileSpec &file_spec) const
Return the current permissions of the given file.
Definition: common/FileSystem.cpp:122
lldb_private::RemoteAwarePlatform::GetRemoteOSBuildString
llvm::Optional< std::string > GetRemoteOSBuildString() override
Definition: RemoteAwarePlatform.cpp:308
lldb_private::ModuleSpec::GetArchitecture
ArchSpec & GetArchitecture()
Definition: ModuleSpec.h:89
lldb_private::RemoteAwarePlatform::CreateSymlink
Status CreateSymlink(const FileSpec &src, const FileSpec &dst) override
Definition: RemoteAwarePlatform.cpp:249
lldb_private::Platform::IsConnected
virtual bool IsConnected() const
Definition: Platform.h:426
lldb_private::FileSystem::Instance
static FileSystem & Instance()
Definition: common/FileSystem.cpp:46
lldb_private::Platform::GetProcessInfo
virtual bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info)
Definition: Platform.cpp:976
lldb_private::RemoteAwarePlatform::GetRemoteOSVersion
bool GetRemoteOSVersion() override
Definition: RemoteAwarePlatform.cpp:300
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Platform::GetFileExists
virtual bool GetFileExists(const lldb_private::FileSpec &file_spec)
Definition: Platform.cpp:1253
lldb_private::RemoteAwarePlatform::GetFileSize
lldb::user_id_t GetFileSize(const FileSpec &file_spec) override
Definition: RemoteAwarePlatform.cpp:243
lldb_private::Platform::LaunchProcess
virtual Status LaunchProcess(ProcessLaunchInfo &launch_info)
Launch a new process on a platform, not necessarily for debugging, it could be just for running the p...
Definition: Platform.cpp:995
lldb_private::RemoteAwarePlatform::GetUserIDResolver
UserIDResolver & GetUserIDResolver() override
Definition: RemoteAwarePlatform.cpp:332
lldb_private::RemoteAwarePlatform::GetRemoteWorkingDirectory
FileSpec GetRemoteWorkingDirectory() override
Definition: RemoteAwarePlatform.cpp:275
lldb_private::Platform::CloseFile
virtual bool CloseFile(lldb::user_id_t fd, Status &error)
Definition: Platform.cpp:683
lldb_private::Platform::Unlink
virtual Status Unlink(const FileSpec &file_spec)
Definition: Platform.cpp:1259
lldb_private::FileSpec::SetFile
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
Definition: FileSpec.cpp:172
PATH_MAX
#define PATH_MAX
Definition: windows/PosixApi.h:25
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:364
lldb_private::RemoteAwarePlatform::KillProcess
Status KillProcess(const lldb::pid_t pid) override
Kill process on a platform.
Definition: RemoteAwarePlatform.cpp:383
lldb_private::ProcessInstanceInfoList
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
Definition: Host.h:31
lldb
Definition: SBAddress.h:15
lldb_private::ModuleList::GetSharedModule
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)
Definition: ModuleList.cpp:786
lldb_private::Platform::ConnectProcess
virtual lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url, llvm::StringRef plugin_name, Debugger &debugger, Target *target, Status &error)
Definition: Platform.cpp:1753
lldb_private::RemoteAwarePlatform::GetHostname
const char * GetHostname() override
Definition: RemoteAwarePlatform.cpp:326
lldb_private::Platform::GetHostname
virtual const char * GetHostname()
Definition: Platform.cpp:725
lldb_private::RemoteAwarePlatform::RunShellCommand
Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &timeout) override
Definition: RemoteAwarePlatform.cpp:170