Greg Clayton | 61d043b | 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 | 4a60f9e | 2011-05-20 23:38:13 +0000 | [diff] [blame] | 15 | #include <vector> |
| 16 | |
Greg Clayton | 61d043b | 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 | a938553 | 2011-11-18 07:03:08 +0000 | [diff] [blame] | 20 | #include "lldb/Target/Process.h" |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 21 | |
| 22 | #include "GDBRemoteCommunication.h" |
| 23 | |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 24 | typedef enum |
| 25 | { |
| 26 | eBreakpointSoftware = 0, |
| 27 | eBreakpointHardware, |
| 28 | eWatchpointWrite, |
| 29 | eWatchpointRead, |
| 30 | eWatchpointReadWrite |
| 31 | } GDBStoppointType; |
| 32 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 33 | class GDBRemoteCommunicationClient : public GDBRemoteCommunication |
| 34 | { |
| 35 | public: |
| 36 | //------------------------------------------------------------------ |
| 37 | // Constructors and Destructors |
| 38 | //------------------------------------------------------------------ |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 39 | GDBRemoteCommunicationClient(bool is_platform); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 40 | |
| 41 | virtual |
| 42 | ~GDBRemoteCommunicationClient(); |
| 43 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 44 | //------------------------------------------------------------------ |
| 45 | // After connecting, send the handshake to the server to make sure |
| 46 | // we are communicating with it. |
| 47 | //------------------------------------------------------------------ |
| 48 | bool |
| 49 | HandshakeWithServer (lldb_private::Error *error_ptr); |
| 50 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 51 | size_t |
| 52 | SendPacketAndWaitForResponse (const char *send_payload, |
| 53 | StringExtractorGDBRemote &response, |
| 54 | bool send_async); |
| 55 | |
| 56 | size_t |
| 57 | SendPacketAndWaitForResponse (const char *send_payload, |
| 58 | size_t send_length, |
| 59 | StringExtractorGDBRemote &response, |
| 60 | bool send_async); |
| 61 | |
| 62 | lldb::StateType |
| 63 | SendContinuePacketAndWaitForResponse (ProcessGDBRemote *process, |
| 64 | const char *packet_payload, |
| 65 | size_t packet_length, |
| 66 | StringExtractorGDBRemote &response); |
| 67 | |
| 68 | virtual bool |
| 69 | GetThreadSuffixSupported (); |
| 70 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 71 | void |
| 72 | QueryNoAckModeSupported (); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 73 | |
Greg Clayton | a1f645e | 2012-04-10 03:22:03 +0000 | [diff] [blame] | 74 | void |
| 75 | GetListThreadsInStopReplySupported (); |
| 76 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 77 | bool |
| 78 | SendAsyncSignal (int signo); |
| 79 | |
| 80 | bool |
| 81 | SendInterrupt (lldb_private::Mutex::Locker &locker, |
| 82 | uint32_t seconds_to_wait_for_stop, |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 83 | bool &timed_out); |
| 84 | |
| 85 | lldb::pid_t |
| 86 | GetCurrentProcessID (); |
| 87 | |
| 88 | bool |
| 89 | GetLaunchSuccess (std::string &error_str); |
| 90 | |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 91 | uint16_t |
| 92 | LaunchGDBserverAndGetPort (); |
| 93 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 94 | //------------------------------------------------------------------ |
| 95 | /// Sends a GDB remote protocol 'A' packet that delivers program |
| 96 | /// arguments to the remote server. |
| 97 | /// |
| 98 | /// @param[in] argv |
| 99 | /// A NULL terminated array of const C strings to use as the |
| 100 | /// arguments. |
| 101 | /// |
| 102 | /// @return |
| 103 | /// Zero if the response was "OK", a positive value if the |
| 104 | /// the response was "Exx" where xx are two hex digits, or |
| 105 | /// -1 if the call is unsupported or any other unexpected |
| 106 | /// response was received. |
| 107 | //------------------------------------------------------------------ |
| 108 | int |
| 109 | SendArgumentsPacket (char const *argv[]); |
| 110 | |
| 111 | //------------------------------------------------------------------ |
| 112 | /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the |
| 113 | /// environment that will get used when launching an application |
| 114 | /// in conjunction with the 'A' packet. This function can be called |
| 115 | /// multiple times in a row in order to pass on the desired |
| 116 | /// environment that the inferior should be launched with. |
| 117 | /// |
| 118 | /// @param[in] name_equal_value |
| 119 | /// A NULL terminated C string that contains a single environment |
| 120 | /// in the format "NAME=VALUE". |
| 121 | /// |
| 122 | /// @return |
| 123 | /// Zero if the response was "OK", a positive value if the |
| 124 | /// the response was "Exx" where xx are two hex digits, or |
| 125 | /// -1 if the call is unsupported or any other unexpected |
| 126 | /// response was received. |
| 127 | //------------------------------------------------------------------ |
| 128 | int |
| 129 | SendEnvironmentPacket (char const *name_equal_value); |
| 130 | |
Greg Clayton | a458240 | 2011-05-08 04:53:50 +0000 | [diff] [blame] | 131 | int |
| 132 | SendLaunchArchPacket (const char *arch); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 133 | //------------------------------------------------------------------ |
| 134 | /// Sends a "vAttach:PID" where PID is in hex. |
| 135 | /// |
| 136 | /// @param[in] pid |
| 137 | /// A process ID for the remote gdb server to attach to. |
| 138 | /// |
| 139 | /// @param[out] response |
| 140 | /// The response received from the gdb server. If the return |
| 141 | /// value is zero, \a response will contain a stop reply |
| 142 | /// packet. |
| 143 | /// |
| 144 | /// @return |
| 145 | /// Zero if the attach was successful, or an error indicating |
| 146 | /// an error code. |
| 147 | //------------------------------------------------------------------ |
| 148 | int |
| 149 | SendAttach (lldb::pid_t pid, |
| 150 | StringExtractorGDBRemote& response); |
| 151 | |
| 152 | |
| 153 | //------------------------------------------------------------------ |
| 154 | /// Sets the path to use for stdin/out/err for a process |
| 155 | /// that will be launched with the 'A' packet. |
| 156 | /// |
| 157 | /// @param[in] path |
| 158 | /// The path to use for stdin/out/err |
| 159 | /// |
| 160 | /// @return |
| 161 | /// Zero if the for success, or an error code for failure. |
| 162 | //------------------------------------------------------------------ |
| 163 | int |
| 164 | SetSTDIN (char const *path); |
| 165 | int |
| 166 | SetSTDOUT (char const *path); |
| 167 | int |
| 168 | SetSTDERR (char const *path); |
| 169 | |
| 170 | //------------------------------------------------------------------ |
| 171 | /// Sets the disable ASLR flag to \a enable for a process that will |
| 172 | /// be launched with the 'A' packet. |
| 173 | /// |
| 174 | /// @param[in] enable |
| 175 | /// A boolean value indicating wether to disable ASLR or not. |
| 176 | /// |
| 177 | /// @return |
| 178 | /// Zero if the for success, or an error code for failure. |
| 179 | //------------------------------------------------------------------ |
| 180 | int |
| 181 | SetDisableASLR (bool enable); |
| 182 | |
| 183 | //------------------------------------------------------------------ |
| 184 | /// Sets the working directory to \a path for a process that will |
| 185 | /// be launched with the 'A' packet. |
| 186 | /// |
| 187 | /// @param[in] path |
| 188 | /// The path to a directory to use when launching our processs |
| 189 | /// |
| 190 | /// @return |
| 191 | /// Zero if the for success, or an error code for failure. |
| 192 | //------------------------------------------------------------------ |
| 193 | int |
| 194 | SetWorkingDir (char const *path); |
| 195 | |
| 196 | lldb::addr_t |
| 197 | AllocateMemory (size_t size, uint32_t permissions); |
| 198 | |
| 199 | bool |
| 200 | DeallocateMemory (lldb::addr_t addr); |
| 201 | |
Jim Ingham | 761afb8 | 2013-05-02 00:27:30 +0000 | [diff] [blame^] | 202 | lldb_private::Error |
| 203 | Detach (bool keep_stopped); |
Greg Clayton | 516f084 | 2012-04-11 00:24:49 +0000 | [diff] [blame] | 204 | |
Greg Clayton | a938553 | 2011-11-18 07:03:08 +0000 | [diff] [blame] | 205 | lldb_private::Error |
| 206 | GetMemoryRegionInfo (lldb::addr_t addr, |
| 207 | lldb_private::MemoryRegionInfo &range_info); |
| 208 | |
Johnny Chen | 7cbdcfb | 2012-05-23 21:09:52 +0000 | [diff] [blame] | 209 | lldb_private::Error |
| 210 | GetWatchpointSupportInfo (uint32_t &num); |
| 211 | |
Enrico Granata | 7de2a3b | 2012-07-13 23:18:48 +0000 | [diff] [blame] | 212 | lldb_private::Error |
| 213 | GetWatchpointSupportInfo (uint32_t &num, bool& after); |
| 214 | |
| 215 | lldb_private::Error |
| 216 | GetWatchpointsTriggerAfterInstruction (bool &after); |
| 217 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 218 | const lldb_private::ArchSpec & |
| 219 | GetHostArchitecture (); |
Jason Molenda | fe55567 | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 220 | |
| 221 | const lldb_private::ArchSpec & |
| 222 | GetProcessArchitecture (); |
| 223 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 224 | bool |
| 225 | GetVContSupported (char flavor); |
| 226 | |
Jim Ingham | 3a458eb | 2012-07-20 21:37:13 +0000 | [diff] [blame] | 227 | bool |
| 228 | GetVAttachOrWaitSupported (); |
| 229 | |
Jim Ingham | 73f6b49 | 2012-07-25 21:12:43 +0000 | [diff] [blame] | 230 | bool |
| 231 | GetSyncThreadStateSupported(); |
| 232 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 233 | void |
| 234 | ResetDiscoverableSettings(); |
| 235 | |
| 236 | bool |
Greg Clayton | 06d7cc8 | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 237 | GetHostInfo (bool force = false); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 238 | |
| 239 | bool |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 240 | GetOSVersion (uint32_t &major, |
| 241 | uint32_t &minor, |
| 242 | uint32_t &update); |
| 243 | |
| 244 | bool |
| 245 | GetOSBuildString (std::string &s); |
| 246 | |
| 247 | bool |
| 248 | GetOSKernelDescription (std::string &s); |
| 249 | |
| 250 | lldb_private::ArchSpec |
| 251 | GetSystemArchitecture (); |
| 252 | |
| 253 | bool |
| 254 | GetHostname (std::string &s); |
| 255 | |
Greg Clayton | 516f084 | 2012-04-11 00:24:49 +0000 | [diff] [blame] | 256 | lldb::addr_t |
| 257 | GetShlibInfoAddr(); |
| 258 | |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 259 | bool |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 260 | GetSupportsThreadSuffix (); |
| 261 | |
| 262 | bool |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 263 | GetProcessInfo (lldb::pid_t pid, |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 264 | lldb_private::ProcessInstanceInfo &process_info); |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 265 | |
| 266 | uint32_t |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 267 | FindProcesses (const lldb_private::ProcessInstanceInfoMatch &process_match_info, |
| 268 | lldb_private::ProcessInstanceInfoList &process_infos); |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 269 | |
| 270 | bool |
| 271 | GetUserName (uint32_t uid, std::string &name); |
| 272 | |
| 273 | bool |
| 274 | GetGroupName (uint32_t gid, std::string &name); |
| 275 | |
| 276 | bool |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 277 | HasFullVContSupport () |
| 278 | { |
| 279 | return GetVContSupported ('A'); |
| 280 | } |
| 281 | |
| 282 | bool |
| 283 | HasAnyVContSupport () |
| 284 | { |
| 285 | return GetVContSupported ('a'); |
| 286 | } |
| 287 | |
| 288 | uint32_t |
| 289 | SetPacketTimeout (uint32_t packet_timeout) |
| 290 | { |
| 291 | const uint32_t old_packet_timeout = m_packet_timeout; |
| 292 | m_packet_timeout = packet_timeout; |
| 293 | return old_packet_timeout; |
| 294 | } |
| 295 | |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 296 | bool |
| 297 | GetStopReply (StringExtractorGDBRemote &response); |
| 298 | |
| 299 | bool |
Greg Clayton | 37d3fce | 2012-10-13 02:11:55 +0000 | [diff] [blame] | 300 | GetThreadStopInfo (lldb::tid_t tid, |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 301 | StringExtractorGDBRemote &response); |
| 302 | |
| 303 | bool |
| 304 | SupportsGDBStoppointPacket (GDBStoppointType type) |
| 305 | { |
| 306 | switch (type) |
| 307 | { |
| 308 | case eBreakpointSoftware: return m_supports_z0; |
| 309 | case eBreakpointHardware: return m_supports_z1; |
| 310 | case eWatchpointWrite: return m_supports_z2; |
| 311 | case eWatchpointRead: return m_supports_z3; |
| 312 | case eWatchpointReadWrite: return m_supports_z4; |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 313 | } |
| 314 | return false; |
| 315 | } |
| 316 | uint8_t |
| 317 | SendGDBStoppointTypePacket (GDBStoppointType type, // Type of breakpoint or watchpoint |
| 318 | bool insert, // Insert or remove? |
| 319 | lldb::addr_t addr, // Address of breakpoint or watchpoint |
| 320 | uint32_t length); // Byte Size of breakpoint or watchpoint |
| 321 | |
Greg Clayton | 06d7cc8 | 2011-04-04 18:18:57 +0000 | [diff] [blame] | 322 | void |
| 323 | TestPacketSpeed (const uint32_t num_packets); |
| 324 | |
| 325 | // This packet is for testing the speed of the interface only. Both |
| 326 | // the client and server need to support it, but this allows us to |
| 327 | // measure the packet speed without any other work being done on the |
| 328 | // other end and avoids any of that work affecting the packet send |
| 329 | // and response times. |
| 330 | bool |
| 331 | SendSpeedTestPacket (uint32_t send_size, |
| 332 | uint32_t recv_size); |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 333 | |
| 334 | bool |
Jason Molenda | 4a5dfcf | 2013-02-23 02:04:45 +0000 | [diff] [blame] | 335 | SetCurrentThread (uint64_t tid); |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 336 | |
| 337 | bool |
Jason Molenda | 4a5dfcf | 2013-02-23 02:04:45 +0000 | [diff] [blame] | 338 | SetCurrentThreadForRun (uint64_t tid); |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 339 | |
Greg Clayton | 989816b | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 340 | lldb_private::LazyBool |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 341 | SupportsAllocDeallocMemory () // const |
Greg Clayton | 989816b | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 342 | { |
Jim Ingham | 1831e78 | 2012-04-07 00:00:41 +0000 | [diff] [blame] | 343 | // Uncomment this to have lldb pretend the debug server doesn't respond to alloc/dealloc memory packets. |
| 344 | // m_supports_alloc_dealloc_memory = lldb_private::eLazyBoolNo; |
Greg Clayton | 2f085c6 | 2011-05-15 01:25:55 +0000 | [diff] [blame] | 345 | return m_supports_alloc_dealloc_memory; |
Greg Clayton | 989816b | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 346 | } |
| 347 | |
Greg Clayton | 4a60f9e | 2011-05-20 23:38:13 +0000 | [diff] [blame] | 348 | size_t |
| 349 | GetCurrentThreadIDs (std::vector<lldb::tid_t> &thread_ids, |
| 350 | bool &sequence_mutex_unavailable); |
| 351 | |
Greg Clayton | 05e4d97 | 2012-03-29 01:55:41 +0000 | [diff] [blame] | 352 | bool |
| 353 | GetInterruptWasSent () const |
| 354 | { |
| 355 | return m_interrupt_sent; |
| 356 | } |
Han Ming Ong | 0df19cc | 2013-01-18 23:11:53 +0000 | [diff] [blame] | 357 | |
| 358 | std::string |
| 359 | HarmonizeThreadIdsForProfileData (ProcessGDBRemote *process, |
| 360 | StringExtractorGDBRemote &inputStringExtractor); |
| 361 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 362 | protected: |
| 363 | |
Jason Molenda | fe55567 | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 364 | bool |
| 365 | GetCurrentProcessInfo (); |
| 366 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 367 | //------------------------------------------------------------------ |
| 368 | // Classes that inherit from GDBRemoteCommunicationClient can see and modify these |
| 369 | //------------------------------------------------------------------ |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 370 | lldb_private::LazyBool m_supports_not_sending_acks; |
| 371 | lldb_private::LazyBool m_supports_thread_suffix; |
Greg Clayton | a1f645e | 2012-04-10 03:22:03 +0000 | [diff] [blame] | 372 | lldb_private::LazyBool m_supports_threads_in_stop_reply; |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 373 | lldb_private::LazyBool m_supports_vCont_all; |
| 374 | lldb_private::LazyBool m_supports_vCont_any; |
| 375 | lldb_private::LazyBool m_supports_vCont_c; |
| 376 | lldb_private::LazyBool m_supports_vCont_C; |
| 377 | lldb_private::LazyBool m_supports_vCont_s; |
| 378 | lldb_private::LazyBool m_supports_vCont_S; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 379 | lldb_private::LazyBool m_qHostInfo_is_valid; |
Jason Molenda | fe55567 | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 380 | lldb_private::LazyBool m_qProcessInfo_is_valid; |
Greg Clayton | 2f085c6 | 2011-05-15 01:25:55 +0000 | [diff] [blame] | 381 | lldb_private::LazyBool m_supports_alloc_dealloc_memory; |
Greg Clayton | a938553 | 2011-11-18 07:03:08 +0000 | [diff] [blame] | 382 | lldb_private::LazyBool m_supports_memory_region_info; |
Johnny Chen | 7cbdcfb | 2012-05-23 21:09:52 +0000 | [diff] [blame] | 383 | lldb_private::LazyBool m_supports_watchpoint_support_info; |
Jim Ingham | 761afb8 | 2013-05-02 00:27:30 +0000 | [diff] [blame^] | 384 | lldb_private::LazyBool m_supports_detach_stay_stopped; |
Enrico Granata | 7de2a3b | 2012-07-13 23:18:48 +0000 | [diff] [blame] | 385 | lldb_private::LazyBool m_watchpoints_trigger_after_instruction; |
Jim Ingham | 3a458eb | 2012-07-20 21:37:13 +0000 | [diff] [blame] | 386 | lldb_private::LazyBool m_attach_or_wait_reply; |
Jim Ingham | 73f6b49 | 2012-07-25 21:12:43 +0000 | [diff] [blame] | 387 | lldb_private::LazyBool m_prepare_for_reg_writing_reply; |
Jim Ingham | 3a458eb | 2012-07-20 21:37:13 +0000 | [diff] [blame] | 388 | |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 389 | bool |
| 390 | m_supports_qProcessInfoPID:1, |
| 391 | m_supports_qfProcessInfo:1, |
| 392 | m_supports_qUserName:1, |
| 393 | m_supports_qGroupName:1, |
| 394 | m_supports_qThreadStopInfo:1, |
| 395 | m_supports_z0:1, |
| 396 | m_supports_z1:1, |
| 397 | m_supports_z2:1, |
| 398 | m_supports_z3:1, |
| 399 | m_supports_z4:1; |
Greg Clayton | 989816b | 2011-05-14 01:50:35 +0000 | [diff] [blame] | 400 | |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 401 | |
| 402 | lldb::tid_t m_curr_tid; // Current gdb remote protocol thread index for all other operations |
| 403 | lldb::tid_t m_curr_tid_run; // Current gdb remote protocol thread index for continue, step, etc |
| 404 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 405 | |
Johnny Chen | 7cbdcfb | 2012-05-23 21:09:52 +0000 | [diff] [blame] | 406 | uint32_t m_num_supported_hardware_watchpoints; |
| 407 | |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 408 | // If we need to send a packet while the target is running, the m_async_XXX |
| 409 | // member variables take care of making this happen. |
| 410 | lldb_private::Mutex m_async_mutex; |
| 411 | lldb_private::Predicate<bool> m_async_packet_predicate; |
| 412 | std::string m_async_packet; |
| 413 | StringExtractorGDBRemote m_async_response; |
| 414 | int m_async_signal; // We were asked to deliver a signal to the inferior process. |
Greg Clayton | 05e4d97 | 2012-03-29 01:55:41 +0000 | [diff] [blame] | 415 | bool m_interrupt_sent; |
Han Ming Ong | 0df19cc | 2013-01-18 23:11:53 +0000 | [diff] [blame] | 416 | std::string m_partial_profile_data; |
| 417 | std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 418 | |
Greg Clayton | cb8977d | 2011-03-23 00:09:55 +0000 | [diff] [blame] | 419 | lldb_private::ArchSpec m_host_arch; |
Jason Molenda | fe55567 | 2012-12-19 02:54:03 +0000 | [diff] [blame] | 420 | lldb_private::ArchSpec m_process_arch; |
Greg Clayton | 58e26e0 | 2011-03-24 04:28:38 +0000 | [diff] [blame] | 421 | uint32_t m_os_version_major; |
| 422 | uint32_t m_os_version_minor; |
| 423 | uint32_t m_os_version_update; |
| 424 | std::string m_os_build; |
| 425 | std::string m_os_kernel; |
| 426 | std::string m_hostname; |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 427 | |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 428 | bool |
| 429 | DecodeProcessInfoResponse (StringExtractorGDBRemote &response, |
Greg Clayton | b72d0f0 | 2011-04-12 05:54:46 +0000 | [diff] [blame] | 430 | lldb_private::ProcessInstanceInfo &process_info); |
Greg Clayton | 61d043b | 2011-03-22 04:00:09 +0000 | [diff] [blame] | 431 | private: |
| 432 | //------------------------------------------------------------------ |
| 433 | // For GDBRemoteCommunicationClient only |
| 434 | //------------------------------------------------------------------ |
| 435 | DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationClient); |
| 436 | }; |
| 437 | |
| 438 | #endif // liblldb_GDBRemoteCommunicationClient_h_ |