diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/API/SBPlatform.cpp | |
parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) |
Notes
Diffstat (limited to 'source/API/SBPlatform.cpp')
-rw-r--r-- | source/API/SBPlatform.cpp | 375 |
1 files changed, 298 insertions, 77 deletions
diff --git a/source/API/SBPlatform.cpp b/source/API/SBPlatform.cpp index aedad871cd208..f3708d8e084f3 100644 --- a/source/API/SBPlatform.cpp +++ b/source/API/SBPlatform.cpp @@ -1,13 +1,13 @@ //===-- SBPlatform.cpp ------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "lldb/API/SBPlatform.h" +#include "SBReproducerPrivate.h" #include "lldb/API/SBError.h" #include "lldb/API/SBFileSpec.h" #include "lldb/API/SBLaunchInfo.h" @@ -26,11 +26,9 @@ using namespace lldb; using namespace lldb_private; -//---------------------------------------------------------------------- // PlatformConnectOptions -//---------------------------------------------------------------------- struct PlatformConnectOptions { - PlatformConnectOptions(const char *url = NULL) + PlatformConnectOptions(const char *url = nullptr) : m_url(), m_rsync_options(), m_rsync_remote_path_prefix(), m_rsync_enabled(false), m_rsync_omit_hostname_from_remote_path(false), m_local_cache_directory() { @@ -48,11 +46,9 @@ struct PlatformConnectOptions { ConstString m_local_cache_directory; }; -//---------------------------------------------------------------------- // PlatformShellCommand -//---------------------------------------------------------------------- struct PlatformShellCommand { - PlatformShellCommand(const char *shell_command = NULL) + PlatformShellCommand(const char *shell_command = nullptr) : m_command(), m_working_dir(), m_status(0), m_signo(0) { if (shell_command && shell_command[0]) m_command = shell_command; @@ -67,31 +63,45 @@ struct PlatformShellCommand { int m_signo; Timeout<std::ratio<1>> m_timeout = llvm::None; }; -//---------------------------------------------------------------------- // SBPlatformConnectOptions -//---------------------------------------------------------------------- SBPlatformConnectOptions::SBPlatformConnectOptions(const char *url) - : m_opaque_ptr(new PlatformConnectOptions(url)) {} + : m_opaque_ptr(new PlatformConnectOptions(url)) { + LLDB_RECORD_CONSTRUCTOR(SBPlatformConnectOptions, (const char *), url); +} SBPlatformConnectOptions::SBPlatformConnectOptions( const SBPlatformConnectOptions &rhs) : m_opaque_ptr(new PlatformConnectOptions()) { + LLDB_RECORD_CONSTRUCTOR(SBPlatformConnectOptions, + (const lldb::SBPlatformConnectOptions &), rhs); + *m_opaque_ptr = *rhs.m_opaque_ptr; } SBPlatformConnectOptions::~SBPlatformConnectOptions() { delete m_opaque_ptr; } void SBPlatformConnectOptions::operator=(const SBPlatformConnectOptions &rhs) { + LLDB_RECORD_METHOD( + void, + SBPlatformConnectOptions, operator=,( + const lldb::SBPlatformConnectOptions &), + rhs); + *m_opaque_ptr = *rhs.m_opaque_ptr; } const char *SBPlatformConnectOptions::GetURL() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformConnectOptions, GetURL); + if (m_opaque_ptr->m_url.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_url.c_str(); } void SBPlatformConnectOptions::SetURL(const char *url) { + LLDB_RECORD_METHOD(void, SBPlatformConnectOptions, SetURL, (const char *), + url); + if (url && url[0]) m_opaque_ptr->m_url = url; else @@ -99,12 +109,18 @@ void SBPlatformConnectOptions::SetURL(const char *url) { } bool SBPlatformConnectOptions::GetRsyncEnabled() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBPlatformConnectOptions, GetRsyncEnabled); + return m_opaque_ptr->m_rsync_enabled; } void SBPlatformConnectOptions::EnableRsync( const char *options, const char *remote_path_prefix, bool omit_hostname_from_remote_path) { + LLDB_RECORD_METHOD(void, SBPlatformConnectOptions, EnableRsync, + (const char *, const char *, bool), options, + remote_path_prefix, omit_hostname_from_remote_path); + m_opaque_ptr->m_rsync_enabled = true; m_opaque_ptr->m_rsync_omit_hostname_from_remote_path = omit_hostname_from_remote_path; @@ -120,47 +136,66 @@ void SBPlatformConnectOptions::EnableRsync( } void SBPlatformConnectOptions::DisableRsync() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBPlatformConnectOptions, DisableRsync); + m_opaque_ptr->m_rsync_enabled = false; } const char *SBPlatformConnectOptions::GetLocalCacheDirectory() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformConnectOptions, + GetLocalCacheDirectory); + return m_opaque_ptr->m_local_cache_directory.GetCString(); } void SBPlatformConnectOptions::SetLocalCacheDirectory(const char *path) { + LLDB_RECORD_METHOD(void, SBPlatformConnectOptions, SetLocalCacheDirectory, + (const char *), path); + if (path && path[0]) m_opaque_ptr->m_local_cache_directory.SetCString(path); else m_opaque_ptr->m_local_cache_directory = ConstString(); } -//---------------------------------------------------------------------- // SBPlatformShellCommand -//---------------------------------------------------------------------- SBPlatformShellCommand::SBPlatformShellCommand(const char *shell_command) - : m_opaque_ptr(new PlatformShellCommand(shell_command)) {} + : m_opaque_ptr(new PlatformShellCommand(shell_command)) { + LLDB_RECORD_CONSTRUCTOR(SBPlatformShellCommand, (const char *), + shell_command); +} SBPlatformShellCommand::SBPlatformShellCommand( const SBPlatformShellCommand &rhs) : m_opaque_ptr(new PlatformShellCommand()) { + LLDB_RECORD_CONSTRUCTOR(SBPlatformShellCommand, + (const lldb::SBPlatformShellCommand &), rhs); + *m_opaque_ptr = *rhs.m_opaque_ptr; } SBPlatformShellCommand::~SBPlatformShellCommand() { delete m_opaque_ptr; } void SBPlatformShellCommand::Clear() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBPlatformShellCommand, Clear); + m_opaque_ptr->m_output = std::string(); m_opaque_ptr->m_status = 0; m_opaque_ptr->m_signo = 0; } const char *SBPlatformShellCommand::GetCommand() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetCommand); + if (m_opaque_ptr->m_command.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_command.c_str(); } void SBPlatformShellCommand::SetCommand(const char *shell_command) { + LLDB_RECORD_METHOD(void, SBPlatformShellCommand, SetCommand, (const char *), + shell_command); + if (shell_command && shell_command[0]) m_opaque_ptr->m_command = shell_command; else @@ -168,12 +203,18 @@ void SBPlatformShellCommand::SetCommand(const char *shell_command) { } const char *SBPlatformShellCommand::GetWorkingDirectory() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, + GetWorkingDirectory); + if (m_opaque_ptr->m_working_dir.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_working_dir.c_str(); } void SBPlatformShellCommand::SetWorkingDirectory(const char *path) { + LLDB_RECORD_METHOD(void, SBPlatformShellCommand, SetWorkingDirectory, + (const char *), path); + if (path && path[0]) m_opaque_ptr->m_working_dir = path; else @@ -181,34 +222,52 @@ void SBPlatformShellCommand::SetWorkingDirectory(const char *path) { } uint32_t SBPlatformShellCommand::GetTimeoutSeconds() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBPlatformShellCommand, + GetTimeoutSeconds); + if (m_opaque_ptr->m_timeout) return m_opaque_ptr->m_timeout->count(); return UINT32_MAX; } void SBPlatformShellCommand::SetTimeoutSeconds(uint32_t sec) { + LLDB_RECORD_METHOD(void, SBPlatformShellCommand, SetTimeoutSeconds, + (uint32_t), sec); + if (sec == UINT32_MAX) m_opaque_ptr->m_timeout = llvm::None; else m_opaque_ptr->m_timeout = std::chrono::seconds(sec); } -int SBPlatformShellCommand::GetSignal() { return m_opaque_ptr->m_signo; } +int SBPlatformShellCommand::GetSignal() { + LLDB_RECORD_METHOD_NO_ARGS(int, SBPlatformShellCommand, GetSignal); + + return m_opaque_ptr->m_signo; +} -int SBPlatformShellCommand::GetStatus() { return m_opaque_ptr->m_status; } +int SBPlatformShellCommand::GetStatus() { + LLDB_RECORD_METHOD_NO_ARGS(int, SBPlatformShellCommand, GetStatus); + + return m_opaque_ptr->m_status; +} const char *SBPlatformShellCommand::GetOutput() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetOutput); + if (m_opaque_ptr->m_output.empty()) - return NULL; + return nullptr; return m_opaque_ptr->m_output.c_str(); } -//---------------------------------------------------------------------- // SBPlatform -//---------------------------------------------------------------------- -SBPlatform::SBPlatform() : m_opaque_sp() {} +SBPlatform::SBPlatform() : m_opaque_sp() { + LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBPlatform); +} SBPlatform::SBPlatform(const char *platform_name) : m_opaque_sp() { + LLDB_RECORD_CONSTRUCTOR(SBPlatform, (const char *), platform_name); + Status error; if (platform_name && platform_name[0]) m_opaque_sp = Platform::Create(ConstString(platform_name), error); @@ -216,15 +275,29 @@ SBPlatform::SBPlatform(const char *platform_name) : m_opaque_sp() { SBPlatform::~SBPlatform() {} -bool SBPlatform::IsValid() const { return m_opaque_sp.get() != NULL; } +bool SBPlatform::IsValid() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBPlatform, IsValid); + return this->operator bool(); +} +SBPlatform::operator bool() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBPlatform, operator bool); + + return m_opaque_sp.get() != nullptr; +} + +void SBPlatform::Clear() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBPlatform, Clear); -void SBPlatform::Clear() { m_opaque_sp.reset(); } + m_opaque_sp.reset(); +} const char *SBPlatform::GetName() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetName); + PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetName().GetCString(); - return NULL; + return nullptr; } lldb::PlatformSP SBPlatform::GetSP() const { return m_opaque_sp; } @@ -234,13 +307,18 @@ void SBPlatform::SetSP(const lldb::PlatformSP &platform_sp) { } const char *SBPlatform::GetWorkingDirectory() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetWorkingDirectory); + PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetWorkingDirectory().GetCString(); - return NULL; + return nullptr; } bool SBPlatform::SetWorkingDirectory(const char *path) { + LLDB_RECORD_METHOD(bool, SBPlatform, SetWorkingDirectory, (const char *), + path); + PlatformSP platform_sp(GetSP()); if (platform_sp) { if (path) @@ -253,6 +331,9 @@ bool SBPlatform::SetWorkingDirectory(const char *path) { } SBError SBPlatform::ConnectRemote(SBPlatformConnectOptions &connect_options) { + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, ConnectRemote, + (lldb::SBPlatformConnectOptions &), connect_options); + SBError sb_error; PlatformSP platform_sp(GetSP()); if (platform_sp && connect_options.GetURL()) { @@ -263,16 +344,20 @@ SBError SBPlatform::ConnectRemote(SBPlatformConnectOptions &connect_options) { } else { sb_error.SetErrorString("invalid platform"); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } void SBPlatform::DisconnectRemote() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBPlatform, DisconnectRemote); + PlatformSP platform_sp(GetSP()); if (platform_sp) platform_sp->DisconnectRemote(); } bool SBPlatform::IsConnected() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBPlatform, IsConnected); + PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->IsConnected(); @@ -280,6 +365,8 @@ bool SBPlatform::IsConnected() { } const char *SBPlatform::GetTriple() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetTriple); + PlatformSP platform_sp(GetSP()); if (platform_sp) { ArchSpec arch(platform_sp->GetSystemArchitecture()); @@ -289,10 +376,12 @@ const char *SBPlatform::GetTriple() { return ConstString(arch.GetTriple().getTriple().c_str()).GetCString(); } } - return NULL; + return nullptr; } const char *SBPlatform::GetOSBuild() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetOSBuild); + PlatformSP platform_sp(GetSP()); if (platform_sp) { std::string s; @@ -304,10 +393,12 @@ const char *SBPlatform::GetOSBuild() { } } } - return NULL; + return nullptr; } const char *SBPlatform::GetOSDescription() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetOSDescription); + PlatformSP platform_sp(GetSP()); if (platform_sp) { std::string s; @@ -319,17 +410,21 @@ const char *SBPlatform::GetOSDescription() { } } } - return NULL; + return nullptr; } const char *SBPlatform::GetHostname() { + LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatform, GetHostname); + PlatformSP platform_sp(GetSP()); if (platform_sp) return platform_sp->GetHostname(); - return NULL; + return nullptr; } uint32_t SBPlatform::GetOSMajorVersion() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBPlatform, GetOSMajorVersion); + llvm::VersionTuple version; if (PlatformSP platform_sp = GetSP()) version = platform_sp->GetOSVersion(); @@ -337,6 +432,8 @@ uint32_t SBPlatform::GetOSMajorVersion() { } uint32_t SBPlatform::GetOSMinorVersion() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBPlatform, GetOSMinorVersion); + llvm::VersionTuple version; if (PlatformSP platform_sp = GetSP()) version = platform_sp->GetOSVersion(); @@ -344,6 +441,8 @@ uint32_t SBPlatform::GetOSMinorVersion() { } uint32_t SBPlatform::GetOSUpdateVersion() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBPlatform, GetOSUpdateVersion); + llvm::VersionTuple version; if (PlatformSP platform_sp = GetSP()) version = platform_sp->GetOSVersion(); @@ -351,6 +450,9 @@ uint32_t SBPlatform::GetOSUpdateVersion() { } SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) { + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Get, + (lldb::SBFileSpec &, lldb::SBFileSpec &), src, dst); + SBError sb_error; PlatformSP platform_sp(GetSP()); if (platform_sp) { @@ -358,50 +460,60 @@ SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) { } else { sb_error.SetErrorString("invalid platform"); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } SBError SBPlatform::Put(SBFileSpec &src, SBFileSpec &dst) { - return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { - if (src.Exists()) { - uint32_t permissions = FileSystem::Instance().GetPermissions(src.ref()); - if (permissions == 0) { - if (FileSystem::Instance().IsDirectory(src.ref())) - permissions = eFilePermissionsDirectoryDefault; - else - permissions = eFilePermissionsFileDefault; - } - - return platform_sp->PutFile(src.ref(), dst.ref(), permissions); - } - - Status error; - error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", - src.ref().GetPath().c_str()); - return error; - }); + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Put, + (lldb::SBFileSpec &, lldb::SBFileSpec &), src, dst); + return LLDB_RECORD_RESULT( + ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { + if (src.Exists()) { + uint32_t permissions = + FileSystem::Instance().GetPermissions(src.ref()); + if (permissions == 0) { + if (FileSystem::Instance().IsDirectory(src.ref())) + permissions = eFilePermissionsDirectoryDefault; + else + permissions = eFilePermissionsFileDefault; + } + + return platform_sp->PutFile(src.ref(), dst.ref(), permissions); + } + + Status error; + error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", + src.ref().GetPath().c_str()); + return error; + })); } SBError SBPlatform::Install(SBFileSpec &src, SBFileSpec &dst) { - return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { - if (src.Exists()) - return platform_sp->Install(src.ref(), dst.ref()); + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Install, + (lldb::SBFileSpec &, lldb::SBFileSpec &), src, dst); + return LLDB_RECORD_RESULT( + ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { + if (src.Exists()) + return platform_sp->Install(src.ref(), dst.ref()); - Status error; - error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", - src.ref().GetPath().c_str()); - return error; - }); + Status error; + error.SetErrorStringWithFormat("'src' argument doesn't exist: '%s'", + src.ref().GetPath().c_str()); + return error; + })); } SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) { - return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Run, + (lldb::SBPlatformShellCommand &), shell_command); + return LLDB_RECORD_RESULT(ExecuteConnected([&](const lldb::PlatformSP + &platform_sp) { const char *command = shell_command.GetCommand(); if (!command) return Status("invalid shell command (empty)"); const char *working_dir = shell_command.GetWorkingDirectory(); - if (working_dir == NULL) { + if (working_dir == nullptr) { working_dir = platform_sp->GetWorkingDirectory().GetCString(); if (working_dir) shell_command.SetWorkingDirectory(working_dir); @@ -411,22 +523,27 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) { &shell_command.m_opaque_ptr->m_signo, &shell_command.m_opaque_ptr->m_output, shell_command.m_opaque_ptr->m_timeout); - }); + })); } SBError SBPlatform::Launch(SBLaunchInfo &launch_info) { - return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { - ProcessLaunchInfo info = launch_info.ref(); - Status error = platform_sp->LaunchProcess(info); - launch_info.set_ref(info); - return error; - }); + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Launch, (lldb::SBLaunchInfo &), + launch_info); + return LLDB_RECORD_RESULT( + ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { + ProcessLaunchInfo info = launch_info.ref(); + Status error = platform_sp->LaunchProcess(info); + launch_info.set_ref(info); + return error; + })); } SBError SBPlatform::Kill(const lldb::pid_t pid) { - return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { - return platform_sp->KillProcess(pid); - }); + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, Kill, (const lldb::pid_t), pid); + return LLDB_RECORD_RESULT( + ExecuteConnected([&](const lldb::PlatformSP &platform_sp) { + return platform_sp->KillProcess(pid); + })); } SBError SBPlatform::ExecuteConnected( @@ -445,6 +562,9 @@ SBError SBPlatform::ExecuteConnected( } SBError SBPlatform::MakeDirectory(const char *path, uint32_t file_permissions) { + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, MakeDirectory, + (const char *, uint32_t), path, file_permissions); + SBError sb_error; PlatformSP platform_sp(GetSP()); if (platform_sp) { @@ -453,10 +573,13 @@ SBError SBPlatform::MakeDirectory(const char *path, uint32_t file_permissions) { } else { sb_error.SetErrorString("invalid platform"); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } uint32_t SBPlatform::GetFilePermissions(const char *path) { + LLDB_RECORD_METHOD(uint32_t, SBPlatform, GetFilePermissions, (const char *), + path); + PlatformSP platform_sp(GetSP()); if (platform_sp) { uint32_t file_permissions = 0; @@ -468,6 +591,9 @@ uint32_t SBPlatform::GetFilePermissions(const char *path) { SBError SBPlatform::SetFilePermissions(const char *path, uint32_t file_permissions) { + LLDB_RECORD_METHOD(lldb::SBError, SBPlatform, SetFilePermissions, + (const char *, uint32_t), path, file_permissions); + SBError sb_error; PlatformSP platform_sp(GetSP()); if (platform_sp) { @@ -476,12 +602,107 @@ SBError SBPlatform::SetFilePermissions(const char *path, } else { sb_error.SetErrorString("invalid platform"); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } SBUnixSignals SBPlatform::GetUnixSignals() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBUnixSignals, SBPlatform, + GetUnixSignals); + if (auto platform_sp = GetSP()) - return SBUnixSignals{platform_sp}; + return LLDB_RECORD_RESULT(SBUnixSignals{platform_sp}); + + return LLDB_RECORD_RESULT(SBUnixSignals()); +} + +namespace lldb_private { +namespace repro { + +template <> +void RegisterMethods<SBPlatformConnectOptions>(Registry &R) { + LLDB_REGISTER_CONSTRUCTOR(SBPlatformConnectOptions, (const char *)); + LLDB_REGISTER_CONSTRUCTOR(SBPlatformConnectOptions, + (const lldb::SBPlatformConnectOptions &)); + LLDB_REGISTER_METHOD( + void, + SBPlatformConnectOptions, operator=,( + const lldb::SBPlatformConnectOptions &)); + LLDB_REGISTER_METHOD(const char *, SBPlatformConnectOptions, GetURL, ()); + LLDB_REGISTER_METHOD(void, SBPlatformConnectOptions, SetURL, + (const char *)); + LLDB_REGISTER_METHOD(bool, SBPlatformConnectOptions, GetRsyncEnabled, ()); + LLDB_REGISTER_METHOD(void, SBPlatformConnectOptions, EnableRsync, + (const char *, const char *, bool)); + LLDB_REGISTER_METHOD(void, SBPlatformConnectOptions, DisableRsync, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatformConnectOptions, + GetLocalCacheDirectory, ()); + LLDB_REGISTER_METHOD(void, SBPlatformConnectOptions, SetLocalCacheDirectory, + (const char *)); +} + +template <> +void RegisterMethods<SBPlatformShellCommand>(Registry &R) { + LLDB_REGISTER_CONSTRUCTOR(SBPlatformShellCommand, (const char *)); + LLDB_REGISTER_CONSTRUCTOR(SBPlatformShellCommand, + (const lldb::SBPlatformShellCommand &)); + LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, Clear, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatformShellCommand, GetCommand, ()); + LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, SetCommand, + (const char *)); + LLDB_REGISTER_METHOD(const char *, SBPlatformShellCommand, + GetWorkingDirectory, ()); + LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, SetWorkingDirectory, + (const char *)); + LLDB_REGISTER_METHOD(uint32_t, SBPlatformShellCommand, GetTimeoutSeconds, + ()); + LLDB_REGISTER_METHOD(void, SBPlatformShellCommand, SetTimeoutSeconds, + (uint32_t)); + LLDB_REGISTER_METHOD(int, SBPlatformShellCommand, GetSignal, ()); + LLDB_REGISTER_METHOD(int, SBPlatformShellCommand, GetStatus, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatformShellCommand, GetOutput, ()); +} + +template <> +void RegisterMethods<SBPlatform>(Registry &R) { + LLDB_REGISTER_CONSTRUCTOR(SBPlatform, ()); + LLDB_REGISTER_CONSTRUCTOR(SBPlatform, (const char *)); + LLDB_REGISTER_METHOD_CONST(bool, SBPlatform, IsValid, ()); + LLDB_REGISTER_METHOD_CONST(bool, SBPlatform, operator bool, ()); + LLDB_REGISTER_METHOD(void, SBPlatform, Clear, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetName, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetWorkingDirectory, ()); + LLDB_REGISTER_METHOD(bool, SBPlatform, SetWorkingDirectory, (const char *)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, ConnectRemote, + (lldb::SBPlatformConnectOptions &)); + LLDB_REGISTER_METHOD(void, SBPlatform, DisconnectRemote, ()); + LLDB_REGISTER_METHOD(bool, SBPlatform, IsConnected, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetTriple, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetOSBuild, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetOSDescription, ()); + LLDB_REGISTER_METHOD(const char *, SBPlatform, GetHostname, ()); + LLDB_REGISTER_METHOD(uint32_t, SBPlatform, GetOSMajorVersion, ()); + LLDB_REGISTER_METHOD(uint32_t, SBPlatform, GetOSMinorVersion, ()); + LLDB_REGISTER_METHOD(uint32_t, SBPlatform, GetOSUpdateVersion, ()); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Get, + (lldb::SBFileSpec &, lldb::SBFileSpec &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Put, + (lldb::SBFileSpec &, lldb::SBFileSpec &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Install, + (lldb::SBFileSpec &, lldb::SBFileSpec &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Run, + (lldb::SBPlatformShellCommand &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Launch, + (lldb::SBLaunchInfo &)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, Kill, (const lldb::pid_t)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, MakeDirectory, + (const char *, uint32_t)); + LLDB_REGISTER_METHOD(uint32_t, SBPlatform, GetFilePermissions, + (const char *)); + LLDB_REGISTER_METHOD(lldb::SBError, SBPlatform, SetFilePermissions, + (const char *, uint32_t)); + LLDB_REGISTER_METHOD_CONST(lldb::SBUnixSignals, SBPlatform, GetUnixSignals, + ()); +} - return {}; +} } |