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