1 //===-- SWIG Interface for SBPlatform ---------------------------*- C++ -*-===// 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 9 namespace lldb { 10 11 12 class SBPlatformConnectOptions 13 { 14 public: 15 SBPlatformConnectOptions (const char *url); 16 17 SBPlatformConnectOptions (const SBPlatformConnectOptions &rhs); 18 19 ~SBPlatformConnectOptions (); 20 21 const char * 22 GetURL(); 23 24 void 25 SetURL(const char *url); 26 27 bool 28 GetRsyncEnabled(); 29 30 void 31 EnableRsync (const char *options, 32 const char *remote_path_prefix, 33 bool omit_remote_hostname); 34 35 void 36 DisableRsync (); 37 38 const char * 39 GetLocalCacheDirectory(); 40 41 void 42 SetLocalCacheDirectory(const char *path); 43 }; 44 45 class SBPlatformShellCommand 46 { 47 public: 48 SBPlatformShellCommand (const char *shell_command); 49 50 SBPlatformShellCommand (const SBPlatformShellCommand &rhs); 51 52 ~SBPlatformShellCommand(); 53 54 void 55 Clear(); 56 57 const char * 58 GetCommand(); 59 60 void 61 SetCommand(const char *shell_command); 62 63 const char * 64 GetWorkingDirectory (); 65 66 void 67 SetWorkingDirectory (const char *path); 68 69 uint32_t 70 GetTimeoutSeconds (); 71 72 void 73 SetTimeoutSeconds (uint32_t sec); 74 75 int 76 GetSignal (); 77 78 int 79 GetStatus (); 80 81 const char * 82 GetOutput (); 83 }; 84 85 %feature("docstring", 86 "A class that represents a platform that can represent the current host or a remote host debug platform. 87 88 The SBPlatform class represents the current host, or a remote host. 89 It can be connected to a remote platform in order to provide ways 90 to remotely launch and attach to processes, upload/download files, 91 create directories, run remote shell commands, find locally cached 92 versions of files from the remote system, and much more. 93 94 SBPlatform objects can be created and then used to connect to a remote 95 platform which allows the SBPlatform to be used to get a list of the 96 current processes on the remote host, attach to one of those processes, 97 install programs on the remote system, attach and launch processes, 98 and much more. 99 100 Every SBTarget has a corresponding SBPlatform. The platform can be 101 specified upon target creation, or the currently selected platform 102 will attempt to be used when creating the target automatically as long 103 as the currently selected platform matches the target architecture 104 and executable type. If the architecture or executable type do not match, 105 a suitable platform will be found automatically." 106 107 ) SBPlatform; 108 class SBPlatform 109 { 110 public: 111 112 SBPlatform (); 113 114 SBPlatform (const char *); 115 116 ~SBPlatform(); 117 118 bool 119 IsValid () const; 120 121 explicit operator bool() const; 122 123 void 124 Clear (); 125 126 const char * 127 GetWorkingDirectory(); 128 129 bool 130 SetWorkingDirectory(const char *); 131 132 const char * 133 GetName (); 134 135 SBError 136 ConnectRemote (lldb::SBPlatformConnectOptions &connect_options); 137 138 void 139 DisconnectRemote (); 140 141 bool 142 IsConnected(); 143 144 const char * 145 GetTriple(); 146 147 const char * 148 GetHostname (); 149 150 const char * 151 GetOSBuild (); 152 153 const char * 154 GetOSDescription (); 155 156 uint32_t 157 GetOSMajorVersion (); 158 159 uint32_t 160 GetOSMinorVersion (); 161 162 uint32_t 163 GetOSUpdateVersion (); 164 165 lldb::SBError 166 Get (lldb::SBFileSpec &src, lldb::SBFileSpec &dst); 167 168 lldb::SBError 169 Put (lldb::SBFileSpec &src, lldb::SBFileSpec &dst); 170 171 lldb::SBError 172 Install (lldb::SBFileSpec &src, lldb::SBFileSpec &dst); 173 174 lldb::SBError 175 Run (lldb::SBPlatformShellCommand &shell_command); 176 177 lldb::SBError 178 Launch (lldb::SBLaunchInfo &launch_info); 179 180 lldb::SBError 181 Kill (const lldb::pid_t pid); 182 183 lldb::SBError 184 MakeDirectory (const char *path, uint32_t file_permissions = lldb::eFilePermissionsDirectoryDefault); 185 186 uint32_t 187 GetFilePermissions (const char *path); 188 189 lldb::SBError 190 SetFilePermissions (const char *path, uint32_t file_permissions); 191 192 lldb::SBUnixSignals 193 GetUnixSignals(); 194 195 }; 196 197 } // namespace lldb 198