Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 1 | //===-- GDBRemoteCommunicationClient.h --------------------------*- 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 | #ifndef liblldb_GDBRemoteCommunicationClient_h_ |
| 11 | #define liblldb_GDBRemoteCommunicationClient_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
Greg Clayton | adc00cb | 2011-05-20 23:38:13 +0000 | [diff] [blame] | 15 | #include <vector> |
| 16 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 17 | // Other libraries and framework includes |
| 18 | // Project includes |
| 19 | #include "lldb/Core/ArchSpec.h" |
Greg Clayton | 46fb558 | 2011-11-18 07:03:08 +0000 | [diff] [blame] | 20 | #include "lldb/Target/Process.h" |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 21 | |
| 22 | #include "GDBRemoteCommunication.h" |
| 23 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 24 | namespace lldb_private { |
| 25 | namespace process_gdb_remote { |
| 26 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 27 | class GDBRemoteCommunicationClient : public GDBRemoteCommunication |
| 28 | { |
| 29 | public: |
| 30 | //------------------------------------------------------------------ |
| 31 | // Constructors and Destructors |
| 32 | //------------------------------------------------------------------ |
Tamas Berghammer | e13c273 | 2015-02-11 10:29:30 +0000 | [diff] [blame] | 33 | GDBRemoteCommunicationClient(); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 34 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 35 | ~GDBRemoteCommunicationClient(); |
| 36 | |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 37 | //------------------------------------------------------------------ |
| 38 | // After connecting, send the handshake to the server to make sure |
| 39 | // we are communicating with it. |
| 40 | //------------------------------------------------------------------ |
| 41 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 42 | HandshakeWithServer (Error *error_ptr); |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 43 | |
Greg Clayton | 3dedae1 | 2013-12-06 21:45:27 +0000 | [diff] [blame] | 44 | PacketResult |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 45 | SendPacketAndWaitForResponse (const char *send_payload, |
| 46 | StringExtractorGDBRemote &response, |
| 47 | bool send_async); |
| 48 | |
Greg Clayton | 3dedae1 | 2013-12-06 21:45:27 +0000 | [diff] [blame] | 49 | PacketResult |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 50 | SendPacketAndWaitForResponse (const char *send_payload, |
| 51 | size_t send_length, |
| 52 | StringExtractorGDBRemote &response, |
| 53 | bool send_async); |
| 54 | |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 55 | // For packets which specify a range of output to be returned, |
| 56 | // return all of the output via a series of request packets of the form |
| 57 | // <prefix>0,<size> |
| 58 | // <prefix><size>,<size> |
| 59 | // <prefix><size>*2,<size> |
| 60 | // <prefix><size>*3,<size> |
| 61 | // ... |
| 62 | // until a "$l..." packet is received, indicating the end. |
| 63 | // (size is in hex; this format is used by a standard gdbserver to |
| 64 | // return the given portion of the output specified by <prefix>; |
| 65 | // for example, "qXfer:libraries-svr4:read::fff,1000" means |
| 66 | // "return a chunk of the xml description file for shared |
| 67 | // library load addresses, where the chunk starts at offset 0xfff |
| 68 | // and continues for 0x1000 bytes"). |
| 69 | // Concatenate the resulting server response packets together and |
| 70 | // return in response_string. If any packet fails, the return value |
| 71 | // indicates that failure and the returned string value is undefined. |
| 72 | PacketResult |
| 73 | SendPacketsAndConcatenateResponses (const char *send_payload_prefix, |
| 74 | std::string &response_string); |
| 75 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 76 | lldb::StateType |
| 77 | SendContinuePacketAndWaitForResponse (ProcessGDBRemote *process, |
| 78 | const char *packet_payload, |
| 79 | size_t packet_length, |
| 80 | StringExtractorGDBRemote &response); |
Ewan Crawford | 76df288 | 2015-06-23 12:32:06 +0000 | [diff] [blame] | 81 | bool |
| 82 | SendvContPacket (ProcessGDBRemote *process, |
| 83 | const char *payload, |
| 84 | size_t packet_length, |
| 85 | StringExtractorGDBRemote &response); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 86 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 87 | bool |
Tamas Berghammer | 30b8cd3 | 2015-03-23 15:50:03 +0000 | [diff] [blame] | 88 | GetThreadSuffixSupported () override; |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 89 | |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 90 | // This packet is usually sent first and the boolean return value |
| 91 | // indicates if the packet was send and any response was received |
| 92 | // even in the response is UNIMPLEMENTED. If the packet failed to |
| 93 | // get a response, then false is returned. This quickly tells us |
Bruce Mitchener | d93c4a3 | 2014-07-01 21:22:11 +0000 | [diff] [blame] | 94 | // if we were able to connect and communicate with the remote GDB |
Greg Clayton | fb90931 | 2013-11-23 01:58:15 +0000 | [diff] [blame] | 95 | // server |
| 96 | bool |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 97 | QueryNoAckModeSupported (); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 98 | |
Greg Clayton | 4463399 | 2012-04-10 03:22:03 +0000 | [diff] [blame] | 99 | void |
| 100 | GetListThreadsInStopReplySupported (); |
| 101 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 102 | bool |
| 103 | SendAsyncSignal (int signo); |
| 104 | |
| 105 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 106 | SendInterrupt (Mutex::Locker &locker, |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 107 | uint32_t seconds_to_wait_for_stop, |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 108 | bool &timed_out); |
| 109 | |
| 110 | lldb::pid_t |
Oleksiy Vyalov | 1ef7b2c | 2015-02-04 23:19:15 +0000 | [diff] [blame] | 111 | GetCurrentProcessID (bool allow_lazy = true); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 112 | |
| 113 | bool |
| 114 | GetLaunchSuccess (std::string &error_str); |
| 115 | |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 116 | uint16_t |
Greg Clayton | dbf0457 | 2013-12-04 19:40:33 +0000 | [diff] [blame] | 117 | LaunchGDBserverAndGetPort (lldb::pid_t &pid, const char *remote_accept_hostname); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 118 | |
| 119 | bool |
| 120 | KillSpawnedProcess (lldb::pid_t pid); |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 121 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 122 | //------------------------------------------------------------------ |
| 123 | /// Sends a GDB remote protocol 'A' packet that delivers program |
| 124 | /// arguments to the remote server. |
| 125 | /// |
| 126 | /// @param[in] argv |
| 127 | /// A NULL terminated array of const C strings to use as the |
| 128 | /// arguments. |
| 129 | /// |
| 130 | /// @return |
| 131 | /// Zero if the response was "OK", a positive value if the |
| 132 | /// the response was "Exx" where xx are two hex digits, or |
| 133 | /// -1 if the call is unsupported or any other unexpected |
| 134 | /// response was received. |
| 135 | //------------------------------------------------------------------ |
| 136 | int |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 137 | SendArgumentsPacket (const ProcessLaunchInfo &launch_info); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 138 | |
| 139 | //------------------------------------------------------------------ |
| 140 | /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the |
| 141 | /// environment that will get used when launching an application |
| 142 | /// in conjunction with the 'A' packet. This function can be called |
| 143 | /// multiple times in a row in order to pass on the desired |
| 144 | /// environment that the inferior should be launched with. |
| 145 | /// |
| 146 | /// @param[in] name_equal_value |
| 147 | /// A NULL terminated C string that contains a single environment |
| 148 | /// in the format "NAME=VALUE". |
| 149 | /// |
| 150 | /// @return |
| 151 | /// Zero if the response was "OK", a positive value if the |
| 152 | /// the response was "Exx" where xx are two hex digits, or |
| 153 | /// -1 if the call is unsupported or any other unexpected |
| 154 | /// response was received. |
| 155 | //------------------------------------------------------------------ |
| 156 | int |
| 157 | SendEnvironmentPacket (char const *name_equal_value); |
| 158 | |
Greg Clayton | c4103b3 | 2011-05-08 04:53:50 +0000 | [diff] [blame] | 159 | int |
| 160 | SendLaunchArchPacket (const char *arch); |
Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 161 | |
| 162 | int |
| 163 | SendLaunchEventDataPacket (const char *data, bool *was_supported = NULL); |
| 164 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 165 | //------------------------------------------------------------------ |
| 166 | /// Sends a "vAttach:PID" where PID is in hex. |
| 167 | /// |
| 168 | /// @param[in] pid |
| 169 | /// A process ID for the remote gdb server to attach to. |
| 170 | /// |
| 171 | /// @param[out] response |
| 172 | /// The response received from the gdb server. If the return |
| 173 | /// value is zero, \a response will contain a stop reply |
| 174 | /// packet. |
| 175 | /// |
| 176 | /// @return |
| 177 | /// Zero if the attach was successful, or an error indicating |
| 178 | /// an error code. |
| 179 | //------------------------------------------------------------------ |
| 180 | int |
| 181 | SendAttach (lldb::pid_t pid, |
| 182 | StringExtractorGDBRemote& response); |
| 183 | |
| 184 | |
| 185 | //------------------------------------------------------------------ |
Vince Harron | e0be425 | 2015-02-06 18:32:57 +0000 | [diff] [blame] | 186 | /// Sends a GDB remote protocol 'I' packet that delivers stdin |
| 187 | /// data to the remote process. |
| 188 | /// |
| 189 | /// @param[in] data |
| 190 | /// A pointer to stdin data. |
| 191 | /// |
| 192 | /// @param[in] data_len |
| 193 | /// The number of bytes available at \a data. |
| 194 | /// |
| 195 | /// @return |
| 196 | /// Zero if the attach was successful, or an error indicating |
| 197 | /// an error code. |
| 198 | //------------------------------------------------------------------ |
| 199 | int |
| 200 | SendStdinNotification(const char* data, size_t data_len); |
| 201 | |
| 202 | //------------------------------------------------------------------ |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 203 | /// Sets the path to use for stdin/out/err for a process |
| 204 | /// that will be launched with the 'A' packet. |
| 205 | /// |
| 206 | /// @param[in] path |
| 207 | /// The path to use for stdin/out/err |
| 208 | /// |
| 209 | /// @return |
| 210 | /// Zero if the for success, or an error code for failure. |
| 211 | //------------------------------------------------------------------ |
| 212 | int |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 213 | SetSTDIN(const FileSpec &file_spec); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 214 | int |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 215 | SetSTDOUT(const FileSpec &file_spec); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 216 | int |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 217 | SetSTDERR(const FileSpec &file_spec); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 218 | |
| 219 | //------------------------------------------------------------------ |
| 220 | /// Sets the disable ASLR flag to \a enable for a process that will |
| 221 | /// be launched with the 'A' packet. |
| 222 | /// |
| 223 | /// @param[in] enable |
Jim Ingham | 106d028 | 2014-06-25 02:32:56 +0000 | [diff] [blame] | 224 | /// A boolean value indicating whether to disable ASLR or not. |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 225 | /// |
| 226 | /// @return |
| 227 | /// Zero if the for success, or an error code for failure. |
| 228 | //------------------------------------------------------------------ |
| 229 | int |
| 230 | SetDisableASLR (bool enable); |
Jim Ingham | 106d028 | 2014-06-25 02:32:56 +0000 | [diff] [blame] | 231 | |
| 232 | //------------------------------------------------------------------ |
| 233 | /// Sets the DetachOnError flag to \a enable for the process controlled by the stub. |
| 234 | /// |
| 235 | /// @param[in] enable |
| 236 | /// A boolean value indicating whether to detach on error or not. |
| 237 | /// |
| 238 | /// @return |
| 239 | /// Zero if the for success, or an error code for failure. |
| 240 | //------------------------------------------------------------------ |
| 241 | int |
| 242 | SetDetachOnError (bool enable); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 243 | |
| 244 | //------------------------------------------------------------------ |
| 245 | /// Sets the working directory to \a path for a process that will |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 246 | /// be launched with the 'A' packet for non platform based |
| 247 | /// connections. If this packet is sent to a GDB server that |
| 248 | /// implements the platform, it will change the current working |
| 249 | /// directory for the platform process. |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 250 | /// |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 251 | /// @param[in] working_dir |
Bruce Mitchener | d93c4a3 | 2014-07-01 21:22:11 +0000 | [diff] [blame] | 252 | /// The path to a directory to use when launching our process |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 253 | /// |
| 254 | /// @return |
| 255 | /// Zero if the for success, or an error code for failure. |
| 256 | //------------------------------------------------------------------ |
| 257 | int |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 258 | SetWorkingDir(const FileSpec &working_dir); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 259 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 260 | //------------------------------------------------------------------ |
| 261 | /// Gets the current working directory of a remote platform GDB |
| 262 | /// server. |
| 263 | /// |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 264 | /// @param[out] working_dir |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 265 | /// The current working directory on the remote platform. |
| 266 | /// |
| 267 | /// @return |
| 268 | /// Boolean for success |
| 269 | //------------------------------------------------------------------ |
| 270 | bool |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 271 | GetWorkingDir(FileSpec &working_dir); |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 272 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 273 | lldb::addr_t |
| 274 | AllocateMemory (size_t size, uint32_t permissions); |
| 275 | |
| 276 | bool |
| 277 | DeallocateMemory (lldb::addr_t addr); |
| 278 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 279 | Error |
Jim Ingham | acff895 | 2013-05-02 00:27:30 +0000 | [diff] [blame] | 280 | Detach (bool keep_stopped); |
Greg Clayton | 37a0a24 | 2012-04-11 00:24:49 +0000 | [diff] [blame] | 281 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 282 | Error |
| 283 | GetMemoryRegionInfo (lldb::addr_t addr, MemoryRegionInfo &range_info); |
Greg Clayton | 46fb558 | 2011-11-18 07:03:08 +0000 | [diff] [blame] | 284 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 285 | Error |
Johnny Chen | 6463720 | 2012-05-23 21:09:52 +0000 | [diff] [blame] | 286 | GetWatchpointSupportInfo (uint32_t &num); |
| 287 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 288 | Error |
Enrico Granata | f04a219 | 2012-07-13 23:18:48 +0000 | [diff] [blame] | 289 | GetWatchpointSupportInfo (uint32_t &num, bool& after); |
| 290 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 291 | Error |
Enrico Granata | f04a219 | 2012-07-13 23:18:48 +0000 | [diff] [blame] | 292 | GetWatchpointsTriggerAfterInstruction (bool &after); |
| 293 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 294 | const ArchSpec & |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 295 | GetHostArchitecture (); |
Greg Clayton | 9ac6d2d | 2013-10-25 18:13:17 +0000 | [diff] [blame] | 296 | |
| 297 | uint32_t |
| 298 | GetHostDefaultPacketTimeout(); |
Jason Molenda | f17b5ac | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 299 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 300 | const ArchSpec & |
Jason Molenda | f17b5ac | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 301 | GetProcessArchitecture (); |
| 302 | |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 303 | void |
| 304 | GetRemoteQSupported(); |
| 305 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 306 | bool |
| 307 | GetVContSupported (char flavor); |
| 308 | |
Jim Ingham | cd16df9 | 2012-07-20 21:37:13 +0000 | [diff] [blame] | 309 | bool |
Sean Callanan | b1de114 | 2013-09-04 23:24:15 +0000 | [diff] [blame] | 310 | GetpPacketSupported (lldb::tid_t tid); |
Hafiz Abid Qadeer | 9a78cdf | 2013-08-29 09:09:45 +0000 | [diff] [blame] | 311 | |
| 312 | bool |
Jason Molenda | bdc4f12 | 2014-05-06 02:59:39 +0000 | [diff] [blame] | 313 | GetxPacketSupported (); |
| 314 | |
| 315 | bool |
Jim Ingham | cd16df9 | 2012-07-20 21:37:13 +0000 | [diff] [blame] | 316 | GetVAttachOrWaitSupported (); |
| 317 | |
Jim Ingham | 279ceec | 2012-07-25 21:12:43 +0000 | [diff] [blame] | 318 | bool |
| 319 | GetSyncThreadStateSupported(); |
| 320 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 321 | void |
| 322 | ResetDiscoverableSettings(); |
| 323 | |
| 324 | bool |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 325 | GetHostInfo (bool force = false); |
Ewan Crawford | 78baa19 | 2015-05-13 09:18:18 +0000 | [diff] [blame] | 326 | |
| 327 | bool |
| 328 | GetDefaultThreadId (lldb::tid_t &tid); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 329 | |
| 330 | bool |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 331 | GetOSVersion (uint32_t &major, |
| 332 | uint32_t &minor, |
| 333 | uint32_t &update); |
| 334 | |
| 335 | bool |
| 336 | GetOSBuildString (std::string &s); |
| 337 | |
| 338 | bool |
| 339 | GetOSKernelDescription (std::string &s); |
| 340 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 341 | ArchSpec |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 342 | GetSystemArchitecture (); |
| 343 | |
| 344 | bool |
| 345 | GetHostname (std::string &s); |
| 346 | |
Greg Clayton | 37a0a24 | 2012-04-11 00:24:49 +0000 | [diff] [blame] | 347 | lldb::addr_t |
| 348 | GetShlibInfoAddr(); |
| 349 | |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 350 | bool |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 351 | GetSupportsThreadSuffix (); |
| 352 | |
| 353 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 354 | GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info); |
Greg Clayton | 32e0a75 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 355 | |
| 356 | uint32_t |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 357 | FindProcesses (const ProcessInstanceInfoMatch &process_match_info, |
| 358 | ProcessInstanceInfoList &process_infos); |
Greg Clayton | 32e0a75 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 359 | |
| 360 | bool |
| 361 | GetUserName (uint32_t uid, std::string &name); |
| 362 | |
| 363 | bool |
| 364 | GetGroupName (uint32_t gid, std::string &name); |
| 365 | |
| 366 | bool |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 367 | HasFullVContSupport () |
| 368 | { |
| 369 | return GetVContSupported ('A'); |
| 370 | } |
| 371 | |
| 372 | bool |
| 373 | HasAnyVContSupport () |
| 374 | { |
| 375 | return GetVContSupported ('a'); |
| 376 | } |
| 377 | |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 378 | bool |
| 379 | GetStopReply (StringExtractorGDBRemote &response); |
| 380 | |
| 381 | bool |
Greg Clayton | f402f78 | 2012-10-13 02:11:55 +0000 | [diff] [blame] | 382 | GetThreadStopInfo (lldb::tid_t tid, |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 383 | StringExtractorGDBRemote &response); |
| 384 | |
| 385 | bool |
| 386 | SupportsGDBStoppointPacket (GDBStoppointType type) |
| 387 | { |
| 388 | switch (type) |
| 389 | { |
| 390 | case eBreakpointSoftware: return m_supports_z0; |
| 391 | case eBreakpointHardware: return m_supports_z1; |
| 392 | case eWatchpointWrite: return m_supports_z2; |
| 393 | case eWatchpointRead: return m_supports_z3; |
| 394 | case eWatchpointReadWrite: return m_supports_z4; |
Zachary Turner | 568b0de | 2015-02-18 18:44:03 +0000 | [diff] [blame] | 395 | default: return false; |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 396 | } |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 397 | } |
| 398 | uint8_t |
| 399 | SendGDBStoppointTypePacket (GDBStoppointType type, // Type of breakpoint or watchpoint |
| 400 | bool insert, // Insert or remove? |
| 401 | lldb::addr_t addr, // Address of breakpoint or watchpoint |
| 402 | uint32_t length); // Byte Size of breakpoint or watchpoint |
| 403 | |
Ewan Crawford | 78baa19 | 2015-05-13 09:18:18 +0000 | [diff] [blame] | 404 | bool |
| 405 | SetNonStopMode (const bool enable); |
| 406 | |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 407 | void |
Greg Clayton | e034a04 | 2015-05-21 20:52:06 +0000 | [diff] [blame] | 408 | TestPacketSpeed (const uint32_t num_packets, uint32_t max_send, uint32_t max_recv, bool json, Stream &strm); |
Greg Clayton | 9b1e1cd | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 409 | |
| 410 | // This packet is for testing the speed of the interface only. Both |
| 411 | // the client and server need to support it, but this allows us to |
| 412 | // measure the packet speed without any other work being done on the |
| 413 | // other end and avoids any of that work affecting the packet send |
| 414 | // and response times. |
| 415 | bool |
| 416 | SendSpeedTestPacket (uint32_t send_size, |
| 417 | uint32_t recv_size); |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 418 | |
| 419 | bool |
Jason Molenda | e9ca4af | 2013-02-23 02:04:45 +0000 | [diff] [blame] | 420 | SetCurrentThread (uint64_t tid); |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 421 | |
| 422 | bool |
Jason Molenda | e9ca4af | 2013-02-23 02:04:45 +0000 | [diff] [blame] | 423 | SetCurrentThreadForRun (uint64_t tid); |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 424 | |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 425 | bool |
Steve Pucci | 03904ac | 2014-03-04 23:18:46 +0000 | [diff] [blame] | 426 | GetQXferAuxvReadSupported (); |
| 427 | |
| 428 | bool |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 429 | GetQXferLibrariesReadSupported (); |
| 430 | |
| 431 | bool |
| 432 | GetQXferLibrariesSVR4ReadSupported (); |
| 433 | |
| 434 | uint64_t |
| 435 | GetRemoteMaxPacketSize(); |
| 436 | |
| 437 | bool |
Greg Clayton | b30c50c | 2015-05-29 00:01:55 +0000 | [diff] [blame] | 438 | GetEchoSupported (); |
| 439 | |
| 440 | bool |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 441 | GetAugmentedLibrariesSVR4ReadSupported (); |
| 442 | |
Colin Riley | c3c95b2 | 2015-04-16 15:51:33 +0000 | [diff] [blame] | 443 | bool |
| 444 | GetQXferFeaturesReadSupported (); |
| 445 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 446 | LazyBool |
Jim Ingham | 372787f | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 447 | SupportsAllocDeallocMemory () // const |
Greg Clayton | 2a48f52 | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 448 | { |
Jim Ingham | 372787f | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 449 | // Uncomment this to have lldb pretend the debug server doesn't respond to alloc/dealloc memory packets. |
| 450 | // m_supports_alloc_dealloc_memory = lldb_private::eLazyBoolNo; |
Greg Clayton | 70b5765 | 2011-05-15 01:25:55 +0000 | [diff] [blame] | 451 | return m_supports_alloc_dealloc_memory; |
Greg Clayton | 2a48f52 | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 452 | } |
| 453 | |
Greg Clayton | adc00cb | 2011-05-20 23:38:13 +0000 | [diff] [blame] | 454 | size_t |
| 455 | GetCurrentThreadIDs (std::vector<lldb::tid_t> &thread_ids, |
| 456 | bool &sequence_mutex_unavailable); |
| 457 | |
Greg Clayton | 2687cd1 | 2012-03-29 01:55:41 +0000 | [diff] [blame] | 458 | bool |
| 459 | GetInterruptWasSent () const |
| 460 | { |
| 461 | return m_interrupt_sent; |
| 462 | } |
Han Ming Ong | 4b6459f | 2013-01-18 23:11:53 +0000 | [diff] [blame] | 463 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 464 | lldb::user_id_t |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 465 | OpenFile (const FileSpec& file_spec, uint32_t flags, mode_t mode, Error &error); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 466 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 467 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 468 | CloseFile (lldb::user_id_t fd, Error &error); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 469 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 470 | lldb::user_id_t |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 471 | GetFileSize (const FileSpec& file_spec); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 472 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 473 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 474 | GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 475 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 476 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 477 | SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions); |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 478 | |
| 479 | uint64_t |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 480 | ReadFile (lldb::user_id_t fd, |
| 481 | uint64_t offset, |
| 482 | void *dst, |
| 483 | uint64_t dst_len, |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 484 | Error &error); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 485 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 486 | uint64_t |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 487 | WriteFile (lldb::user_id_t fd, |
| 488 | uint64_t offset, |
| 489 | const void* src, |
| 490 | uint64_t src_len, |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 491 | Error &error); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 492 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 493 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 494 | CreateSymlink(const FileSpec &src, |
| 495 | const FileSpec &dst); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 496 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 497 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 498 | Unlink(const FileSpec &file_spec); |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 499 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 500 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 501 | MakeDirectory(const FileSpec &file_spec, uint32_t mode); |
| 502 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 503 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 504 | GetFileExists (const FileSpec& file_spec); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 505 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 506 | Error |
Chaoren Lin | d3173f3 | 2015-05-29 19:52:29 +0000 | [diff] [blame] | 507 | RunShellCommand(const char *command, // Shouldn't be NULL |
| 508 | const FileSpec &working_dir, // Pass empty FileSpec to use the current working directory |
| 509 | int *status_ptr, // Pass NULL if you don't want the process exit status |
| 510 | int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit |
| 511 | std::string *command_output, // Pass NULL if you don't want the command output |
| 512 | uint32_t timeout_sec); // Timeout in seconds to wait for shell program to finish |
| 513 | |
Greg Clayton | fbb7634 | 2013-11-20 21:07:01 +0000 | [diff] [blame] | 514 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 515 | CalculateMD5 (const FileSpec& file_spec, uint64_t &high, uint64_t &low); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 516 | |
Han Ming Ong | 4b6459f | 2013-01-18 23:11:53 +0000 | [diff] [blame] | 517 | std::string |
| 518 | HarmonizeThreadIdsForProfileData (ProcessGDBRemote *process, |
| 519 | StringExtractorGDBRemote &inputStringExtractor); |
Daniel Malea | e0f8f57 | 2013-08-26 23:57:52 +0000 | [diff] [blame] | 520 | |
Greg Clayton | f74cf86 | 2013-11-13 23:28:31 +0000 | [diff] [blame] | 521 | bool |
| 522 | ReadRegister(lldb::tid_t tid, |
| 523 | uint32_t reg_num, |
| 524 | StringExtractorGDBRemote &response); |
| 525 | |
| 526 | bool |
| 527 | ReadAllRegisters (lldb::tid_t tid, |
| 528 | StringExtractorGDBRemote &response); |
| 529 | |
| 530 | bool |
| 531 | SaveRegisterState (lldb::tid_t tid, uint32_t &save_id); |
| 532 | |
| 533 | bool |
| 534 | RestoreRegisterState (lldb::tid_t tid, uint32_t save_id); |
Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 535 | |
| 536 | const char * |
| 537 | GetGDBServerProgramName(); |
Greg Clayton | f74cf86 | 2013-11-13 23:28:31 +0000 | [diff] [blame] | 538 | |
Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 539 | uint32_t |
| 540 | GetGDBServerProgramVersion(); |
| 541 | |
| 542 | bool |
| 543 | AvoidGPackets(ProcessGDBRemote *process); |
| 544 | |
Jason Molenda | 705b180 | 2014-06-13 02:37:02 +0000 | [diff] [blame] | 545 | bool |
| 546 | GetThreadExtendedInfoSupported(); |
| 547 | |
Oleksiy Vyalov | 6801be3 | 2015-02-25 22:15:44 +0000 | [diff] [blame] | 548 | bool |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 549 | GetModuleInfo (const FileSpec& module_file_spec, |
| 550 | const ArchSpec& arch_spec, |
| 551 | ModuleSpec &module_spec); |
Oleksiy Vyalov | 6801be3 | 2015-02-25 22:15:44 +0000 | [diff] [blame] | 552 | |
Colin Riley | c3c95b2 | 2015-04-16 15:51:33 +0000 | [diff] [blame] | 553 | bool |
| 554 | ReadExtFeature (const lldb_private::ConstString object, |
| 555 | const lldb_private::ConstString annex, |
| 556 | std::string & out, |
| 557 | lldb_private::Error & err); |
| 558 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 559 | protected: |
| 560 | |
Greg Clayton | 3dedae1 | 2013-12-06 21:45:27 +0000 | [diff] [blame] | 561 | PacketResult |
| 562 | SendPacketAndWaitForResponseNoLock (const char *payload, |
| 563 | size_t payload_length, |
| 564 | StringExtractorGDBRemote &response); |
| 565 | |
Jason Molenda | f17b5ac | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 566 | bool |
Oleksiy Vyalov | 1ef7b2c | 2015-02-04 23:19:15 +0000 | [diff] [blame] | 567 | GetCurrentProcessInfo (bool allow_lazy_pid = true); |
Jason Molenda | f17b5ac | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 568 | |
Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 569 | bool |
| 570 | GetGDBServerVersion(); |
| 571 | |
Jason Molenda | 91ffe0a | 2015-06-18 21:46:06 +0000 | [diff] [blame] | 572 | // Given the list of compression types that the remote debug stub can support, |
| 573 | // possibly enable compression if we find an encoding we can handle. |
| 574 | void |
| 575 | MaybeEnableCompression (std::vector<std::string> supported_compressions); |
| 576 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 577 | //------------------------------------------------------------------ |
| 578 | // Classes that inherit from GDBRemoteCommunicationClient can see and modify these |
| 579 | //------------------------------------------------------------------ |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 580 | LazyBool m_supports_not_sending_acks; |
| 581 | LazyBool m_supports_thread_suffix; |
| 582 | LazyBool m_supports_threads_in_stop_reply; |
| 583 | LazyBool m_supports_vCont_all; |
| 584 | LazyBool m_supports_vCont_any; |
| 585 | LazyBool m_supports_vCont_c; |
| 586 | LazyBool m_supports_vCont_C; |
| 587 | LazyBool m_supports_vCont_s; |
| 588 | LazyBool m_supports_vCont_S; |
| 589 | LazyBool m_qHostInfo_is_valid; |
| 590 | LazyBool m_curr_pid_is_valid; |
| 591 | LazyBool m_qProcessInfo_is_valid; |
| 592 | LazyBool m_qGDBServerVersion_is_valid; |
| 593 | LazyBool m_supports_alloc_dealloc_memory; |
| 594 | LazyBool m_supports_memory_region_info; |
| 595 | LazyBool m_supports_watchpoint_support_info; |
| 596 | LazyBool m_supports_detach_stay_stopped; |
| 597 | LazyBool m_watchpoints_trigger_after_instruction; |
| 598 | LazyBool m_attach_or_wait_reply; |
| 599 | LazyBool m_prepare_for_reg_writing_reply; |
| 600 | LazyBool m_supports_p; |
| 601 | LazyBool m_supports_x; |
| 602 | LazyBool m_avoid_g_packets; |
| 603 | LazyBool m_supports_QSaveRegisterState; |
| 604 | LazyBool m_supports_qXfer_auxv_read; |
| 605 | LazyBool m_supports_qXfer_libraries_read; |
| 606 | LazyBool m_supports_qXfer_libraries_svr4_read; |
Colin Riley | c3c95b2 | 2015-04-16 15:51:33 +0000 | [diff] [blame] | 607 | LazyBool m_supports_qXfer_features_read; |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 608 | LazyBool m_supports_augmented_libraries_svr4_read; |
| 609 | LazyBool m_supports_jThreadExtendedInfo; |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 610 | |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 611 | bool |
| 612 | m_supports_qProcessInfoPID:1, |
| 613 | m_supports_qfProcessInfo:1, |
| 614 | m_supports_qUserName:1, |
| 615 | m_supports_qGroupName:1, |
| 616 | m_supports_qThreadStopInfo:1, |
| 617 | m_supports_z0:1, |
| 618 | m_supports_z1:1, |
| 619 | m_supports_z2:1, |
| 620 | m_supports_z3:1, |
Greg Clayton | 8960058 | 2013-10-10 17:53:50 +0000 | [diff] [blame] | 621 | m_supports_z4:1, |
| 622 | m_supports_QEnvironment:1, |
Chaoren Lin | 7a30608 | 2015-06-23 03:17:01 +0000 | [diff] [blame] | 623 | m_supports_QEnvironmentHexEncoded:1; |
Greg Clayton | 2a48f52 | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 624 | |
Todd Fiala | 9f72b3a | 2014-05-07 19:28:21 +0000 | [diff] [blame] | 625 | lldb::pid_t m_curr_pid; |
Greg Clayton | 8b82f08 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 626 | lldb::tid_t m_curr_tid; // Current gdb remote protocol thread index for all other operations |
| 627 | lldb::tid_t m_curr_tid_run; // Current gdb remote protocol thread index for continue, step, etc |
| 628 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 629 | |
Johnny Chen | 6463720 | 2012-05-23 21:09:52 +0000 | [diff] [blame] | 630 | uint32_t m_num_supported_hardware_watchpoints; |
| 631 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 632 | // If we need to send a packet while the target is running, the m_async_XXX |
| 633 | // member variables take care of making this happen. |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 634 | Mutex m_async_mutex; |
| 635 | Predicate<bool> m_async_packet_predicate; |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 636 | std::string m_async_packet; |
Jim Ingham | a6195b7 | 2013-12-18 01:24:33 +0000 | [diff] [blame] | 637 | PacketResult m_async_result; |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 638 | StringExtractorGDBRemote m_async_response; |
| 639 | int m_async_signal; // We were asked to deliver a signal to the inferior process. |
Greg Clayton | 2687cd1 | 2012-03-29 01:55:41 +0000 | [diff] [blame] | 640 | bool m_interrupt_sent; |
Han Ming Ong | 4b6459f | 2013-01-18 23:11:53 +0000 | [diff] [blame] | 641 | std::string m_partial_profile_data; |
| 642 | std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 643 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 644 | ArchSpec m_host_arch; |
| 645 | ArchSpec m_process_arch; |
Greg Clayton | 1cb6496 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 646 | uint32_t m_os_version_major; |
| 647 | uint32_t m_os_version_minor; |
| 648 | uint32_t m_os_version_update; |
| 649 | std::string m_os_build; |
| 650 | std::string m_os_kernel; |
| 651 | std::string m_hostname; |
Jason Molenda | a332978 | 2014-03-29 18:54:20 +0000 | [diff] [blame] | 652 | std::string m_gdb_server_name; // from reply to qGDBServerVersion, empty if qGDBServerVersion is not supported |
| 653 | uint32_t m_gdb_server_version; // from reply to qGDBServerVersion, zero if qGDBServerVersion is not supported |
Greg Clayton | 9ac6d2d | 2013-10-25 18:13:17 +0000 | [diff] [blame] | 654 | uint32_t m_default_packet_timeout; |
Steve Pucci | 5ae54ae | 2014-01-25 05:46:51 +0000 | [diff] [blame] | 655 | uint64_t m_max_packet_size; // as returned by qSupported |
Jason Molenda | 91ffe0a | 2015-06-18 21:46:06 +0000 | [diff] [blame] | 656 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 657 | |
Greg Clayton | 32e0a75 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 658 | bool |
| 659 | DecodeProcessInfoResponse (StringExtractorGDBRemote &response, |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 660 | ProcessInstanceInfo &process_info); |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 661 | private: |
| 662 | //------------------------------------------------------------------ |
| 663 | // For GDBRemoteCommunicationClient only |
| 664 | //------------------------------------------------------------------ |
| 665 | DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationClient); |
| 666 | }; |
| 667 | |
Tamas Berghammer | db264a6 | 2015-03-31 09:52:22 +0000 | [diff] [blame] | 668 | } // namespace process_gdb_remote |
| 669 | } // namespace lldb_private |
| 670 | |
Greg Clayton | 576d883 | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 671 | #endif // liblldb_GDBRemoteCommunicationClient_h_ |