LLDB mainline
SBPlatform.cpp
Go to the documentation of this file.
1//===-- SBPlatform.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/API/SBDebugger.h"
12#include "lldb/API/SBError.h"
13#include "lldb/API/SBFileSpec.h"
17#include "lldb/API/SBTarget.h"
19#include "lldb/Host/File.h"
21#include "lldb/Target/Target.h"
23#include "lldb/Utility/Args.h"
25#include "lldb/Utility/Status.h"
26
27#include "llvm/Support/FileSystem.h"
28
29#include <functional>
30
31using namespace lldb;
32using namespace lldb_private;
33
34// PlatformConnectOptions
36 PlatformConnectOptions(const char *url = nullptr) {
37 if (url && url[0])
38 m_url = url;
39 }
40
42
43 std::string m_url;
44 std::string m_rsync_options;
46 bool m_rsync_enabled = false;
49};
50
51// PlatformShellCommand
53 PlatformShellCommand(llvm::StringRef shell_interpreter,
54 llvm::StringRef shell_command) {
55 if (!shell_interpreter.empty())
56 m_shell = shell_interpreter.str();
57
58 if (!m_shell.empty() && !shell_command.empty())
59 m_command = shell_command.str();
60 }
61
62 PlatformShellCommand(llvm::StringRef shell_command = llvm::StringRef()) {
63 if (!shell_command.empty())
64 m_command = shell_command.str();
65 }
66
68
69 std::string m_shell;
70 std::string m_command;
71 std::string m_working_dir;
72 std::string m_output;
73 int m_status = 0;
74 int m_signo = 0;
76};
77// SBPlatformConnectOptions
82
90
92
95 LLDB_INSTRUMENT_VA(this, rhs);
96
98 return *this;
99}
100
102 LLDB_INSTRUMENT_VA(this);
103
104 if (m_opaque_ptr->m_url.empty())
105 return nullptr;
106 return ConstString(m_opaque_ptr->m_url.c_str()).GetCString();
107}
108
109void SBPlatformConnectOptions::SetURL(const char *url) {
110 LLDB_INSTRUMENT_VA(this, url);
111
112 if (url && url[0])
113 m_opaque_ptr->m_url = url;
114 else
115 m_opaque_ptr->m_url.clear();
116}
117
119 LLDB_INSTRUMENT_VA(this);
120
121 return m_opaque_ptr->m_rsync_enabled;
122}
123
125 const char *options, const char *remote_path_prefix,
126 bool omit_hostname_from_remote_path) {
127 LLDB_INSTRUMENT_VA(this, options, remote_path_prefix,
128 omit_hostname_from_remote_path);
129
130 m_opaque_ptr->m_rsync_enabled = true;
131 m_opaque_ptr->m_rsync_omit_hostname_from_remote_path =
132 omit_hostname_from_remote_path;
133 if (remote_path_prefix && remote_path_prefix[0])
134 m_opaque_ptr->m_rsync_remote_path_prefix = remote_path_prefix;
135 else
136 m_opaque_ptr->m_rsync_remote_path_prefix.clear();
137
138 if (options && options[0])
139 m_opaque_ptr->m_rsync_options = options;
140 else
141 m_opaque_ptr->m_rsync_options.clear();
142}
143
145 LLDB_INSTRUMENT_VA(this);
146
147 m_opaque_ptr->m_rsync_enabled = false;
148}
149
151 LLDB_INSTRUMENT_VA(this);
152
153 return m_opaque_ptr->m_local_cache_directory.GetCString();
154}
155
157 LLDB_INSTRUMENT_VA(this, path);
158
159 if (path && path[0])
160 m_opaque_ptr->m_local_cache_directory.SetCString(path);
161 else
162 m_opaque_ptr->m_local_cache_directory = ConstString();
163}
164
165// SBPlatformShellCommand
167 const char *shell_command)
168 : m_opaque_ptr(new PlatformShellCommand(shell_interpreter, shell_command)) {
169 LLDB_INSTRUMENT_VA(this, shell_interpreter, shell_command);
170}
171
173 : m_opaque_ptr(new PlatformShellCommand(shell_command)) {
174 LLDB_INSTRUMENT_VA(this, shell_command);
175}
176
184
187
188 LLDB_INSTRUMENT_VA(this, rhs);
189
191 return *this;
192}
193
195
197 LLDB_INSTRUMENT_VA(this);
198
199 m_opaque_ptr->m_output = std::string();
200 m_opaque_ptr->m_status = 0;
201 m_opaque_ptr->m_signo = 0;
202}
203
205 LLDB_INSTRUMENT_VA(this);
206
207 if (m_opaque_ptr->m_shell.empty())
208 return nullptr;
209 return ConstString(m_opaque_ptr->m_shell.c_str()).GetCString();
210}
211
212void SBPlatformShellCommand::SetShell(const char *shell_interpreter) {
213 LLDB_INSTRUMENT_VA(this, shell_interpreter);
214
215 if (shell_interpreter && shell_interpreter[0])
216 m_opaque_ptr->m_shell = shell_interpreter;
217 else
218 m_opaque_ptr->m_shell.clear();
219}
220
222 LLDB_INSTRUMENT_VA(this);
223
224 if (m_opaque_ptr->m_command.empty())
225 return nullptr;
226 return ConstString(m_opaque_ptr->m_command.c_str()).GetCString();
227}
228
229void SBPlatformShellCommand::SetCommand(const char *shell_command) {
230 LLDB_INSTRUMENT_VA(this, shell_command);
231
232 if (shell_command && shell_command[0])
233 m_opaque_ptr->m_command = shell_command;
234 else
235 m_opaque_ptr->m_command.clear();
236}
237
239 LLDB_INSTRUMENT_VA(this);
240
241 if (m_opaque_ptr->m_working_dir.empty())
242 return nullptr;
243 return ConstString(m_opaque_ptr->m_working_dir.c_str()).GetCString();
244}
245
247 LLDB_INSTRUMENT_VA(this, path);
248
249 if (path && path[0])
250 m_opaque_ptr->m_working_dir = path;
251 else
252 m_opaque_ptr->m_working_dir.clear();
253}
254
256 LLDB_INSTRUMENT_VA(this);
257
258 if (m_opaque_ptr->m_timeout)
259 return m_opaque_ptr->m_timeout->count();
260 return UINT32_MAX;
261}
262
264 LLDB_INSTRUMENT_VA(this, sec);
265
266 if (sec == UINT32_MAX)
267 m_opaque_ptr->m_timeout = std::nullopt;
268 else
269 m_opaque_ptr->m_timeout = std::chrono::seconds(sec);
270}
271
273 LLDB_INSTRUMENT_VA(this);
274
275 return m_opaque_ptr->m_signo;
276}
277
279 LLDB_INSTRUMENT_VA(this);
280
281 return m_opaque_ptr->m_status;
282}
283
285 LLDB_INSTRUMENT_VA(this);
286
287 if (m_opaque_ptr->m_output.empty())
288 return nullptr;
289 return ConstString(m_opaque_ptr->m_output.c_str()).GetCString();
290}
291
292// SBPlatform
294
295SBPlatform::SBPlatform(const char *platform_name) {
296 LLDB_INSTRUMENT_VA(this, platform_name);
297
298 m_opaque_sp = Platform::Create(platform_name);
299}
300
302 LLDB_INSTRUMENT_VA(this, rhs);
303
305}
306
308 LLDB_INSTRUMENT_VA(this, rhs);
309
311 return *this;
312}
313
314SBPlatform::~SBPlatform() = default;
315
318
319 SBPlatform host_platform;
320 host_platform.m_opaque_sp = Platform::GetHostPlatform();
321 return host_platform;
322}
323
325 LLDB_INSTRUMENT_VA(this);
326 return this->operator bool();
327}
328SBPlatform::operator bool() const {
329 LLDB_INSTRUMENT_VA(this);
330
331 return m_opaque_sp.get() != nullptr;
332}
333
334bool SBPlatform::IsHost() const {
335 LLDB_INSTRUMENT_VA(this);
336 return m_opaque_sp.get() != nullptr && m_opaque_sp->IsHost();
337}
338
340 LLDB_INSTRUMENT_VA(this);
341
342 m_opaque_sp.reset();
343}
344
345const char *SBPlatform::GetName() {
346 LLDB_INSTRUMENT_VA(this);
347
348 PlatformSP platform_sp(GetSP());
349 if (platform_sp)
350 return ConstString(platform_sp->GetName()).AsCString(nullptr);
351 return nullptr;
352}
353
355
356void SBPlatform::SetSP(const lldb::PlatformSP &platform_sp) {
357 m_opaque_sp = platform_sp;
358}
359
361 LLDB_INSTRUMENT_VA(this);
362
363 PlatformSP platform_sp(GetSP());
364 if (platform_sp)
365 return platform_sp->GetWorkingDirectory().GetPathAsConstString().AsCString(
366 nullptr);
367 return nullptr;
368}
369
370bool SBPlatform::SetWorkingDirectory(const char *path) {
371 LLDB_INSTRUMENT_VA(this, path);
372
373 PlatformSP platform_sp(GetSP());
374 if (platform_sp) {
375 if (path)
376 platform_sp->SetWorkingDirectory(FileSpec(path));
377 else
378 platform_sp->SetWorkingDirectory(FileSpec());
379 return true;
380 }
381 return false;
382}
383
385 LLDB_INSTRUMENT_VA(this, connect_options);
386
387 SBError sb_error;
388 PlatformSP platform_sp(GetSP());
389 if (platform_sp && connect_options.GetURL()) {
390 Args args;
391 args.AppendArgument(connect_options.GetURL());
392 sb_error.ref() = platform_sp->ConnectRemote(args);
393 } else {
394 sb_error = Status::FromErrorString("invalid platform");
395 }
396 return sb_error;
397}
398
400 LLDB_INSTRUMENT_VA(this);
401
402 PlatformSP platform_sp(GetSP());
403 if (platform_sp)
404 platform_sp->DisconnectRemote();
405}
406
408 LLDB_INSTRUMENT_VA(this);
409
410 PlatformSP platform_sp(GetSP());
411 if (platform_sp)
412 return platform_sp->IsConnected();
413 return false;
414}
415
417 LLDB_INSTRUMENT_VA(this);
418
419 PlatformSP platform_sp(GetSP());
420 if (platform_sp) {
421 ArchSpec arch(platform_sp->GetSystemArchitecture());
422 if (arch.IsValid()) {
423 // Const-ify the string so we don't need to worry about the lifetime of
424 // the string
425 return ConstString(arch.GetTriple().getTriple().c_str()).GetCString();
426 }
427 }
428 return nullptr;
429}
430
432 LLDB_INSTRUMENT_VA(this);
433
434 PlatformSP platform_sp(GetSP());
435 if (platform_sp) {
436 std::string s = platform_sp->GetOSBuildString().value_or("");
437 if (!s.empty()) {
438 // Const-ify the string so we don't need to worry about the lifetime of
439 // the string
440 return ConstString(s).GetCString();
441 }
442 }
443 return nullptr;
444}
445
447 LLDB_INSTRUMENT_VA(this);
448
449 PlatformSP platform_sp(GetSP());
450 if (platform_sp) {
451 std::string s = platform_sp->GetOSKernelDescription().value_or("");
452 if (!s.empty()) {
453 // Const-ify the string so we don't need to worry about the lifetime of
454 // the string
455 return ConstString(s.c_str()).GetCString();
456 }
457 }
458 return nullptr;
459}
460
462 LLDB_INSTRUMENT_VA(this);
463
464 PlatformSP platform_sp(GetSP());
465 if (platform_sp)
466 return ConstString(platform_sp->GetHostname()).GetCString();
467 return nullptr;
468}
469
471 LLDB_INSTRUMENT_VA(this);
472
473 llvm::VersionTuple version;
474 if (PlatformSP platform_sp = GetSP())
475 version = platform_sp->GetOSVersion();
476 return version.empty() ? UINT32_MAX : version.getMajor();
477}
478
480 LLDB_INSTRUMENT_VA(this);
481
482 llvm::VersionTuple version;
483 if (PlatformSP platform_sp = GetSP())
484 version = platform_sp->GetOSVersion();
485 return version.getMinor().value_or(UINT32_MAX);
486}
487
489 LLDB_INSTRUMENT_VA(this);
490
491 llvm::VersionTuple version;
492 if (PlatformSP platform_sp = GetSP())
493 version = platform_sp->GetOSVersion();
494 return version.getSubminor().value_or(UINT32_MAX);
495}
496
497void SBPlatform::SetSDKRoot(const char *sysroot) {
498 LLDB_INSTRUMENT_VA(this, sysroot);
499 if (PlatformSP platform_sp = GetSP())
500 platform_sp->SetSDKRootDirectory(llvm::StringRef(sysroot).str());
501}
502
504 LLDB_INSTRUMENT_VA(this, src, dst);
505
506 SBError sb_error;
507 PlatformSP platform_sp(GetSP());
508 if (platform_sp) {
509 sb_error.ref() = platform_sp->GetFile(src.ref(), dst.ref());
510 } else {
511 sb_error = Status::FromErrorString("invalid platform");
512 }
513 return sb_error;
514}
515
517 LLDB_INSTRUMENT_VA(this, src, dst);
518 return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) {
519 if (src.Exists()) {
520 uint32_t permissions = FileSystem::Instance().GetPermissions(src.ref());
521 if (permissions == 0) {
522 if (FileSystem::Instance().IsDirectory(src.ref()))
523 permissions = eFilePermissionsDirectoryDefault;
524 else
525 permissions = eFilePermissionsFileDefault;
526 }
527
528 return platform_sp->PutFile(src.ref(), dst.ref(), permissions);
529 }
530
532 "'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str());
533 });
534}
535
537 LLDB_INSTRUMENT_VA(this, src, dst);
538 return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) {
539 if (src.Exists())
540 return platform_sp->Install(src.ref(), dst.ref());
541
544 "'src' argument doesn't exist: '%s'", src.ref().GetPath().c_str());
545 return error;
546 });
547}
548
550 LLDB_INSTRUMENT_VA(this, shell_command);
551 return ExecuteConnected(
552 [&](const lldb::PlatformSP &platform_sp) {
553 const char *command = shell_command.GetCommand();
554 if (!command)
555 return Status::FromErrorString("invalid shell command (empty)");
556
557 if (shell_command.GetWorkingDirectory() == nullptr) {
558 std::string platform_working_dir =
559 platform_sp->GetWorkingDirectory().GetPath();
560 if (!platform_working_dir.empty())
561 shell_command.SetWorkingDirectory(platform_working_dir.c_str());
562 }
563 return platform_sp->RunShellCommand(
564 shell_command.m_opaque_ptr->m_shell, command,
565 FileSpec(shell_command.GetWorkingDirectory()),
566 &shell_command.m_opaque_ptr->m_status,
567 &shell_command.m_opaque_ptr->m_signo,
568 &shell_command.m_opaque_ptr->m_output, nullptr,
569 shell_command.m_opaque_ptr->m_timeout);
570 });
571}
572
574 LLDB_INSTRUMENT_VA(this, launch_info);
575 return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) {
576 ProcessLaunchInfo info = launch_info.ref();
577 Status error = platform_sp->LaunchProcess(info);
578 launch_info.set_ref(info);
579 return error;
580 });
581}
582
584 const SBDebugger &debugger, SBTarget &target,
585 SBError &error) {
586 LLDB_INSTRUMENT_VA(this, attach_info, debugger, target, error);
587
588 if (PlatformSP platform_sp = GetSP()) {
589 if (platform_sp->IsConnected()) {
590 ProcessAttachInfo &info = attach_info.ref();
591 Status status;
592 ProcessSP process_sp = platform_sp->Attach(info, debugger.ref(),
593 target.GetSP().get(), status);
594 error.SetError(std::move(status));
595 return SBProcess(process_sp);
596 }
597
598 error = Status::FromErrorString("not connected");
599 return {};
600 }
601
602 error = Status::FromErrorString("invalid platform");
603 return {};
604}
605
607 if (PlatformSP platform_sp = GetSP()) {
608 if (platform_sp->IsConnected()) {
609 ProcessInstanceInfoList list = platform_sp->GetAllProcesses();
610 return SBProcessInfoList(list);
611 }
612 error = Status::FromErrorString("not connected");
613 return {};
614 }
615
616 error = Status::FromErrorString("invalid platform");
617 return {};
618}
619
621 LLDB_INSTRUMENT_VA(this, pid);
622 return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) {
623 return platform_sp->KillProcess(pid);
624 });
625}
626
628 const std::function<Status(const lldb::PlatformSP &)> &func) {
629 SBError sb_error;
630 const auto platform_sp(GetSP());
631 if (platform_sp) {
632 if (platform_sp->IsConnected())
633 sb_error.ref() = func(platform_sp);
634 else
635 sb_error = Status::FromErrorString("not connected");
636 } else
637 sb_error = Status::FromErrorString("invalid platform");
638
639 return sb_error;
640}
641
642SBError SBPlatform::MakeDirectory(const char *path, uint32_t file_permissions) {
643 LLDB_INSTRUMENT_VA(this, path, file_permissions);
644
645 SBError sb_error;
646 PlatformSP platform_sp(GetSP());
647 if (platform_sp) {
648 sb_error.ref() =
649 platform_sp->MakeDirectory(FileSpec(path), file_permissions);
650 } else {
651 sb_error = Status::FromErrorString("invalid platform");
652 }
653 return sb_error;
654}
655
656uint32_t SBPlatform::GetFilePermissions(const char *path) {
657 LLDB_INSTRUMENT_VA(this, path);
658
659 PlatformSP platform_sp(GetSP());
660 if (platform_sp) {
661 uint32_t file_permissions = 0;
662 platform_sp->GetFilePermissions(FileSpec(path), file_permissions);
663 return file_permissions;
664 }
665 return 0;
666}
667
669 uint32_t file_permissions) {
670 LLDB_INSTRUMENT_VA(this, path, file_permissions);
671
672 SBError sb_error;
673 PlatformSP platform_sp(GetSP());
674 if (platform_sp) {
675 sb_error.ref() =
676 platform_sp->SetFilePermissions(FileSpec(path), file_permissions);
677 } else {
678 sb_error = Status::FromErrorString("invalid platform");
679 }
680 return sb_error;
681}
682
684 LLDB_INSTRUMENT_VA(this);
685
686 if (auto platform_sp = GetSP())
687 return SBUnixSignals{platform_sp};
688
689 return SBUnixSignals();
690}
691
693 LLDB_INSTRUMENT_VA(this);
694 PlatformSP platform_sp(GetSP());
695
696 if (platform_sp) {
697 return SBEnvironment(platform_sp->GetEnvironment());
698 }
699
700 return SBEnvironment();
701}
702
704 lldb::SBPlatformLocateModuleCallback callback, void *callback_baton) {
705 LLDB_INSTRUMENT_VA(this, callback, callback_baton);
706 PlatformSP platform_sp(GetSP());
707 if (!platform_sp)
708 return SBError("invalid platform");
709
710 if (!callback) {
711 // Clear the callback.
712 platform_sp->SetLocateModuleCallback(nullptr);
713 return SBError();
714 }
715
716 // Platform.h does not accept lldb::SBPlatformLocateModuleCallback directly
717 // because of the SBModuleSpec and SBFileSpec dependencies. Use a lambda to
718 // convert ModuleSpec/FileSpec <--> SBModuleSpec/SBFileSpec for the callback
719 // arguments.
720 platform_sp->SetLocateModuleCallback(
721 [callback, callback_baton](const ModuleSpec &module_spec,
722 FileSpec &module_file_spec,
723 FileSpec &symbol_file_spec) {
724 SBModuleSpec module_spec_sb(module_spec);
725 SBFileSpec module_file_spec_sb;
726 SBFileSpec symbol_file_spec_sb;
727
728 SBError error = callback(callback_baton, module_spec_sb,
729 module_file_spec_sb, symbol_file_spec_sb);
730
731 if (error.Success()) {
732 module_file_spec = module_file_spec_sb.ref();
733 symbol_file_spec = symbol_file_spec_sb.ref();
734 }
735
736 return error.ref().Clone();
737 });
738 return SBError();
739}
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
lldb_private::ProcessAttachInfo & ref()
lldb_private::Debugger & ref() const
lldb_private::Status & ref()
Definition SBError.cpp:191
const lldb_private::FileSpec & ref() const
bool Exists() const
void set_ref(const lldb_private::ProcessLaunchInfo &info)
const lldb_private::ProcessLaunchInfo & ref() const
PlatformConnectOptions * m_opaque_ptr
Definition SBPlatform.h:53
const char * GetLocalCacheDirectory()
SBPlatformConnectOptions(const char *url)
void EnableRsync(const char *options, const char *remote_path_prefix, bool omit_remote_hostname)
SBPlatformConnectOptions & operator=(const SBPlatformConnectOptions &rhs)
void SetURL(const char *url)
void SetLocalCacheDirectory(const char *path)
SBPlatformShellCommand & operator=(const SBPlatformShellCommand &rhs)
void SetCommand(const char *shell_command)
void SetShell(const char *shell)
PlatformShellCommand * m_opaque_ptr
Definition SBPlatform.h:94
void SetTimeoutSeconds(uint32_t sec)
void SetWorkingDirectory(const char *path)
const char * GetWorkingDirectory()
SBPlatformShellCommand(const char *shell, const char *shell_command)
SBError ExecuteConnected(const std::function< lldb_private::Status(const lldb::PlatformSP &)> &func)
const char * GetName()
SBError Kill(const lldb::pid_t pid)
lldb::PlatformSP GetSP() const
bool IsHost() const
Returns true if this platform is the host platform, otherwise false.
SBError Launch(SBLaunchInfo &launch_info)
uint32_t GetOSMinorVersion()
uint32_t GetOSUpdateVersion()
bool IsValid() const
const char * GetTriple()
SBProcessInfoList GetAllProcesses(SBError &error)
uint32_t GetOSMajorVersion()
SBError ConnectRemote(SBPlatformConnectOptions &connect_options)
friend class SBDebugger
Definition SBPlatform.h:197
friend class SBTarget
Definition SBPlatform.h:198
void SetSDKRoot(const char *sysroot)
static SBPlatform GetHostPlatform()
SBEnvironment GetEnvironment()
Return the environment variables of the remote platform connection process.
SBError SetFilePermissions(const char *path, uint32_t file_permissions)
SBError MakeDirectory(const char *path, uint32_t file_permissions=eFilePermissionsDirectoryDefault)
SBUnixSignals GetUnixSignals() const
SBError Run(SBPlatformShellCommand &shell_command)
SBError SetLocateModuleCallback(lldb::SBPlatformLocateModuleCallback callback, void *callback_baton)
Set a callback as an implementation for locating module in order to implement own module cache system...
SBPlatform & operator=(const SBPlatform &rhs)
const char * GetOSDescription()
SBProcess Attach(SBAttachInfo &attach_info, const SBDebugger &debugger, SBTarget &target, SBError &error)
void SetSP(const lldb::PlatformSP &platform_sp)
const char * GetHostname()
lldb::PlatformSP m_opaque_sp
Definition SBPlatform.h:208
SBError Put(SBFileSpec &src, SBFileSpec &dst)
uint32_t GetFilePermissions(const char *path)
const char * GetWorkingDirectory()
SBError Get(SBFileSpec &src, SBFileSpec &dst)
const char * GetOSBuild()
SBError Install(SBFileSpec &src, SBFileSpec &dst)
bool SetWorkingDirectory(const char *path)
lldb::TargetSP GetSP() const
Definition SBTarget.cpp:592
An architecture specification class.
Definition ArchSpec.h:32
bool IsValid() const
Tests if this ArchSpec is valid.
Definition ArchSpec.h:367
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:457
A command line argument class.
Definition Args.h:33
void AppendArgument(llvm::StringRef arg_str, char quote_char='\0')
Appends a new argument to the end of the list argument list.
Definition Args.cpp:332
A uniqued constant string class.
Definition ConstString.h:40
const char * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) const
Get the string value as a C string.
A file utility class.
Definition FileSpec.h:57
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition FileSpec.cpp:374
uint32_t GetPermissions(const FileSpec &file_spec) const
Return the current permissions of the given file.
static FileSystem & Instance()
static lldb::PlatformSP Create(llvm::StringRef name)
Definition Platform.cpp:309
static lldb::PlatformSP GetHostPlatform()
Get the native host platform plug-in.
Definition Platform.cpp:138
An error handling class.
Definition Status.h:118
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition Status.cpp:106
static Status FromErrorString(const char *str)
Definition Status.h:141
#define UINT32_MAX
A class that represents a running process on the host machine.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
Definition Host.h:32
class LLDB_API SBProcessInfoList
Definition SBDefines.h:99
lldb::SBError(* SBPlatformLocateModuleCallback)(void *baton, const lldb::SBModuleSpec &module_spec, lldb::SBFileSpec &module_file_spec, lldb::SBFileSpec &symbol_file_spec)
Definition SBDefines.h:152
std::shared_ptr< lldb_private::Platform > PlatformSP
class LLDB_API SBUnixSignals
Definition SBDefines.h:140
class LLDB_API SBProcess
Definition SBDefines.h:97
std::shared_ptr< lldb_private::Process > ProcessSP
uint64_t pid_t
Definition lldb-types.h:83
class LLDB_API SBEnvironment
Definition SBDefines.h:68
class LLDB_API SBError
Definition SBDefines.h:69
PlatformConnectOptions(const char *url=nullptr)
std::string m_rsync_remote_path_prefix
~PlatformConnectOptions()=default
bool m_rsync_omit_hostname_from_remote_path
std::string m_rsync_options
ConstString m_local_cache_directory
PlatformShellCommand(llvm::StringRef shell_command=llvm::StringRef())
std::string m_command
std::string m_working_dir
Timeout< std::ratio< 1 > > m_timeout
PlatformShellCommand(llvm::StringRef shell_interpreter, llvm::StringRef shell_command)
~PlatformShellCommand()=default