1 //===-- GDBRemoteCommunicationClient.h --------------------------*- 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 #ifndef LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONCLIENT_H
10 #define LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONCLIENT_H
11 
12 #include "GDBRemoteClientBase.h"
13 
14 #include <chrono>
15 #include <map>
16 #include <mutex>
17 #include <string>
18 #include <vector>
19 
20 #include "lldb/Host/File.h"
21 #include "lldb/Utility/ArchSpec.h"
22 #include "lldb/Utility/GDBRemote.h"
23 #include "lldb/Utility/ProcessInfo.h"
24 #include "lldb/Utility/StructuredData.h"
25 #include "lldb/Utility/TraceGDBRemotePackets.h"
26 #if defined(_WIN32)
27 #include "lldb/Host/windows/PosixApi.h"
28 #endif
29 
30 #include "llvm/ADT/Optional.h"
31 #include "llvm/Support/VersionTuple.h"
32 
33 namespace lldb_private {
34 namespace process_gdb_remote {
35 
36 /// The offsets used by the target when relocating the executable. Decoded from
37 /// qOffsets packet response.
38 struct QOffsets {
39   /// If true, the offsets field describes segments. Otherwise, it describes
40   /// sections.
41   bool segments;
42 
43   /// The individual offsets. Section offsets have two or three members.
44   /// Segment offsets have either one of two.
45   std::vector<uint64_t> offsets;
46 };
47 inline bool operator==(const QOffsets &a, const QOffsets &b) {
48   return a.segments == b.segments && a.offsets == b.offsets;
49 }
50 llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const QOffsets &offsets);
51 
52 class GDBRemoteCommunicationClient : public GDBRemoteClientBase {
53 public:
54   GDBRemoteCommunicationClient();
55 
56   ~GDBRemoteCommunicationClient() override;
57 
58   // After connecting, send the handshake to the server to make sure
59   // we are communicating with it.
60   bool HandshakeWithServer(Status *error_ptr);
61 
62   // For packets which specify a range of output to be returned,
63   // return all of the output via a series of request packets of the form
64   // <prefix>0,<size>
65   // <prefix><size>,<size>
66   // <prefix><size>*2,<size>
67   // <prefix><size>*3,<size>
68   // ...
69   // until a "$l..." packet is received, indicating the end.
70   // (size is in hex; this format is used by a standard gdbserver to
71   // return the given portion of the output specified by <prefix>;
72   // for example, "qXfer:libraries-svr4:read::fff,1000" means
73   // "return a chunk of the xml description file for shared
74   // library load addresses, where the chunk starts at offset 0xfff
75   // and continues for 0x1000 bytes").
76   // Concatenate the resulting server response packets together and
77   // return in response_string.  If any packet fails, the return value
78   // indicates that failure and the returned string value is undefined.
79   PacketResult
80   SendPacketsAndConcatenateResponses(const char *send_payload_prefix,
81                                      std::string &response_string);
82 
83   bool GetThreadSuffixSupported();
84 
85   // This packet is usually sent first and the boolean return value
86   // indicates if the packet was send and any response was received
87   // even in the response is UNIMPLEMENTED. If the packet failed to
88   // get a response, then false is returned. This quickly tells us
89   // if we were able to connect and communicate with the remote GDB
90   // server
91   bool QueryNoAckModeSupported();
92 
93   void GetListThreadsInStopReplySupported();
94 
95   lldb::pid_t GetCurrentProcessID(bool allow_lazy = true);
96 
97   bool GetLaunchSuccess(std::string &error_str);
98 
99   bool LaunchGDBServer(const char *remote_accept_hostname, lldb::pid_t &pid,
100                        uint16_t &port, std::string &socket_name);
101 
102   size_t QueryGDBServer(
103       std::vector<std::pair<uint16_t, std::string>> &connection_urls);
104 
105   bool KillSpawnedProcess(lldb::pid_t pid);
106 
107   /// Sends a GDB remote protocol 'A' packet that delivers program
108   /// arguments to the remote server.
109   ///
110   /// \param[in] launch_info
111   ///     A NULL terminated array of const C strings to use as the
112   ///     arguments.
113   ///
114   /// \return
115   ///     Zero if the response was "OK", a positive value if the
116   ///     the response was "Exx" where xx are two hex digits, or
117   ///     -1 if the call is unsupported or any other unexpected
118   ///     response was received.
119   int SendArgumentsPacket(const ProcessLaunchInfo &launch_info);
120 
121   /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the
122   /// environment that will get used when launching an application
123   /// in conjunction with the 'A' packet. This function can be called
124   /// multiple times in a row in order to pass on the desired
125   /// environment that the inferior should be launched with.
126   ///
127   /// \param[in] name_equal_value
128   ///     A NULL terminated C string that contains a single environment
129   ///     in the format "NAME=VALUE".
130   ///
131   /// \return
132   ///     Zero if the response was "OK", a positive value if the
133   ///     the response was "Exx" where xx are two hex digits, or
134   ///     -1 if the call is unsupported or any other unexpected
135   ///     response was received.
136   int SendEnvironmentPacket(char const *name_equal_value);
137   int SendEnvironment(const Environment &env);
138 
139   int SendLaunchArchPacket(const char *arch);
140 
141   int SendLaunchEventDataPacket(const char *data,
142                                 bool *was_supported = nullptr);
143 
144   /// Sends a "vAttach:PID" where PID is in hex.
145   ///
146   /// \param[in] pid
147   ///     A process ID for the remote gdb server to attach to.
148   ///
149   /// \param[out] response
150   ///     The response received from the gdb server. If the return
151   ///     value is zero, \a response will contain a stop reply
152   ///     packet.
153   ///
154   /// \return
155   ///     Zero if the attach was successful, or an error indicating
156   ///     an error code.
157   int SendAttach(lldb::pid_t pid, StringExtractorGDBRemote &response);
158 
159   /// Sends a GDB remote protocol 'I' packet that delivers stdin
160   /// data to the remote process.
161   ///
162   /// \param[in] data
163   ///     A pointer to stdin data.
164   ///
165   /// \param[in] data_len
166   ///     The number of bytes available at \a data.
167   ///
168   /// \return
169   ///     Zero if the attach was successful, or an error indicating
170   ///     an error code.
171   int SendStdinNotification(const char *data, size_t data_len);
172 
173   /// Sets the path to use for stdin/out/err for a process
174   /// that will be launched with the 'A' packet.
175   ///
176   /// \param[in] file_spec
177   ///     The path to use for stdin/out/err
178   ///
179   /// \return
180   ///     Zero if the for success, or an error code for failure.
181   int SetSTDIN(const FileSpec &file_spec);
182   int SetSTDOUT(const FileSpec &file_spec);
183   int SetSTDERR(const FileSpec &file_spec);
184 
185   /// Sets the disable ASLR flag to \a enable for a process that will
186   /// be launched with the 'A' packet.
187   ///
188   /// \param[in] enable
189   ///     A boolean value indicating whether to disable ASLR or not.
190   ///
191   /// \return
192   ///     Zero if the for success, or an error code for failure.
193   int SetDisableASLR(bool enable);
194 
195   /// Sets the DetachOnError flag to \a enable for the process controlled by the
196   /// stub.
197   ///
198   /// \param[in] enable
199   ///     A boolean value indicating whether to detach on error or not.
200   ///
201   /// \return
202   ///     Zero if the for success, or an error code for failure.
203   int SetDetachOnError(bool enable);
204 
205   /// Sets the working directory to \a path for a process that will
206   /// be launched with the 'A' packet for non platform based
207   /// connections. If this packet is sent to a GDB server that
208   /// implements the platform, it will change the current working
209   /// directory for the platform process.
210   ///
211   /// \param[in] working_dir
212   ///     The path to a directory to use when launching our process
213   ///
214   /// \return
215   ///     Zero if the for success, or an error code for failure.
216   int SetWorkingDir(const FileSpec &working_dir);
217 
218   /// Gets the current working directory of a remote platform GDB
219   /// server.
220   ///
221   /// \param[out] working_dir
222   ///     The current working directory on the remote platform.
223   ///
224   /// \return
225   ///     Boolean for success
226   bool GetWorkingDir(FileSpec &working_dir);
227 
228   lldb::addr_t AllocateMemory(size_t size, uint32_t permissions);
229 
230   bool DeallocateMemory(lldb::addr_t addr);
231 
232   Status Detach(bool keep_stopped);
233 
234   Status GetMemoryRegionInfo(lldb::addr_t addr, MemoryRegionInfo &range_info);
235 
236   Status GetWatchpointSupportInfo(uint32_t &num);
237 
238   Status GetWatchpointSupportInfo(uint32_t &num, bool &after,
239                                   const ArchSpec &arch);
240 
241   Status GetWatchpointsTriggerAfterInstruction(bool &after,
242                                                const ArchSpec &arch);
243 
244   const ArchSpec &GetHostArchitecture();
245 
246   std::chrono::seconds GetHostDefaultPacketTimeout();
247 
248   const ArchSpec &GetProcessArchitecture();
249 
250   void GetRemoteQSupported();
251 
252   bool GetVContSupported(char flavor);
253 
254   bool GetpPacketSupported(lldb::tid_t tid);
255 
256   bool GetxPacketSupported();
257 
258   bool GetVAttachOrWaitSupported();
259 
260   bool GetSyncThreadStateSupported();
261 
262   void ResetDiscoverableSettings(bool did_exec);
263 
264   bool GetHostInfo(bool force = false);
265 
266   bool GetDefaultThreadId(lldb::tid_t &tid);
267 
268   llvm::VersionTuple GetOSVersion();
269 
270   llvm::VersionTuple GetMacCatalystVersion();
271 
272   bool GetOSBuildString(std::string &s);
273 
274   bool GetOSKernelDescription(std::string &s);
275 
276   ArchSpec GetSystemArchitecture();
277 
278   uint32_t GetAddressingBits();
279 
280   bool GetHostname(std::string &s);
281 
282   lldb::addr_t GetShlibInfoAddr();
283 
284   bool GetSupportsThreadSuffix();
285 
286   bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info);
287 
288   uint32_t FindProcesses(const ProcessInstanceInfoMatch &process_match_info,
289                          ProcessInstanceInfoList &process_infos);
290 
291   bool GetUserName(uint32_t uid, std::string &name);
292 
293   bool GetGroupName(uint32_t gid, std::string &name);
294 
295   bool HasFullVContSupport() { return GetVContSupported('A'); }
296 
297   bool HasAnyVContSupport() { return GetVContSupported('a'); }
298 
299   bool GetStopReply(StringExtractorGDBRemote &response);
300 
301   bool GetThreadStopInfo(lldb::tid_t tid, StringExtractorGDBRemote &response);
302 
303   bool SupportsGDBStoppointPacket(GDBStoppointType type) {
304     switch (type) {
305     case eBreakpointSoftware:
306       return m_supports_z0;
307     case eBreakpointHardware:
308       return m_supports_z1;
309     case eWatchpointWrite:
310       return m_supports_z2;
311     case eWatchpointRead:
312       return m_supports_z3;
313     case eWatchpointReadWrite:
314       return m_supports_z4;
315     default:
316       return false;
317     }
318   }
319 
320   uint8_t SendGDBStoppointTypePacket(
321       GDBStoppointType type, // Type of breakpoint or watchpoint
322       bool insert,           // Insert or remove?
323       lldb::addr_t addr,     // Address of breakpoint or watchpoint
324       uint32_t length);      // Byte Size of breakpoint or watchpoint
325 
326   bool SetNonStopMode(const bool enable);
327 
328   void TestPacketSpeed(const uint32_t num_packets, uint32_t max_send,
329                        uint32_t max_recv, uint64_t recv_amount, bool json,
330                        Stream &strm);
331 
332   // This packet is for testing the speed of the interface only. Both
333   // the client and server need to support it, but this allows us to
334   // measure the packet speed without any other work being done on the
335   // other end and avoids any of that work affecting the packet send
336   // and response times.
337   bool SendSpeedTestPacket(uint32_t send_size, uint32_t recv_size);
338 
339   bool SetCurrentThread(uint64_t tid);
340 
341   bool SetCurrentThreadForRun(uint64_t tid);
342 
343   bool GetQXferAuxvReadSupported();
344 
345   void EnableErrorStringInPacket();
346 
347   bool GetQXferLibrariesReadSupported();
348 
349   bool GetQXferLibrariesSVR4ReadSupported();
350 
351   uint64_t GetRemoteMaxPacketSize();
352 
353   bool GetEchoSupported();
354 
355   bool GetQPassSignalsSupported();
356 
357   bool GetAugmentedLibrariesSVR4ReadSupported();
358 
359   bool GetQXferFeaturesReadSupported();
360 
361   bool GetQXferMemoryMapReadSupported();
362 
363   LazyBool SupportsAllocDeallocMemory() // const
364   {
365     // Uncomment this to have lldb pretend the debug server doesn't respond to
366     // alloc/dealloc memory packets.
367     // m_supports_alloc_dealloc_memory = lldb_private::eLazyBoolNo;
368     return m_supports_alloc_dealloc_memory;
369   }
370 
371   std::vector<std::pair<lldb::pid_t, lldb::tid_t>>
372   GetCurrentProcessAndThreadIDs(bool &sequence_mutex_unavailable);
373 
374   size_t GetCurrentThreadIDs(std::vector<lldb::tid_t> &thread_ids,
375                              bool &sequence_mutex_unavailable);
376 
377   lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags,
378                            mode_t mode, Status &error);
379 
380   bool CloseFile(lldb::user_id_t fd, Status &error);
381 
382   lldb::user_id_t GetFileSize(const FileSpec &file_spec);
383 
384   void AutoCompleteDiskFileOrDirectory(CompletionRequest &request,
385                                        bool only_dir);
386 
387   Status GetFilePermissions(const FileSpec &file_spec,
388                             uint32_t &file_permissions);
389 
390   Status SetFilePermissions(const FileSpec &file_spec,
391                             uint32_t file_permissions);
392 
393   uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst,
394                     uint64_t dst_len, Status &error);
395 
396   uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src,
397                      uint64_t src_len, Status &error);
398 
399   Status CreateSymlink(const FileSpec &src, const FileSpec &dst);
400 
401   Status Unlink(const FileSpec &file_spec);
402 
403   Status MakeDirectory(const FileSpec &file_spec, uint32_t mode);
404 
405   bool GetFileExists(const FileSpec &file_spec);
406 
407   Status RunShellCommand(
408       llvm::StringRef command,
409       const FileSpec &working_dir, // Pass empty FileSpec to use the current
410                                    // working directory
411       int *status_ptr, // Pass nullptr if you don't want the process exit status
412       int *signo_ptr,  // Pass nullptr if you don't want the signal that caused
413                        // the process to exit
414       std::string
415           *command_output, // Pass nullptr if you don't want the command output
416       const Timeout<std::micro> &timeout);
417 
418   bool CalculateMD5(const FileSpec &file_spec, uint64_t &high, uint64_t &low);
419 
420   lldb::DataBufferSP ReadRegister(
421       lldb::tid_t tid,
422       uint32_t
423           reg_num); // Must be the eRegisterKindProcessPlugin register number
424 
425   lldb::DataBufferSP ReadAllRegisters(lldb::tid_t tid);
426 
427   bool
428   WriteRegister(lldb::tid_t tid,
429                 uint32_t reg_num, // eRegisterKindProcessPlugin register number
430                 llvm::ArrayRef<uint8_t> data);
431 
432   bool WriteAllRegisters(lldb::tid_t tid, llvm::ArrayRef<uint8_t> data);
433 
434   bool SaveRegisterState(lldb::tid_t tid, uint32_t &save_id);
435 
436   bool RestoreRegisterState(lldb::tid_t tid, uint32_t save_id);
437 
438   bool SyncThreadState(lldb::tid_t tid);
439 
440   const char *GetGDBServerProgramName();
441 
442   uint32_t GetGDBServerProgramVersion();
443 
444   bool AvoidGPackets(ProcessGDBRemote *process);
445 
446   StructuredData::ObjectSP GetThreadsInfo();
447 
448   bool GetThreadExtendedInfoSupported();
449 
450   bool GetLoadedDynamicLibrariesInfosSupported();
451 
452   bool GetSharedCacheInfoSupported();
453 
454   /// Use qOffsets to query the offset used when relocating the target
455   /// executable. If successful, the returned structure will contain at least
456   /// one value in the offsets field.
457   llvm::Optional<QOffsets> GetQOffsets();
458 
459   bool GetModuleInfo(const FileSpec &module_file_spec,
460                      const ArchSpec &arch_spec, ModuleSpec &module_spec);
461 
462   llvm::Optional<std::vector<ModuleSpec>>
463   GetModulesInfo(llvm::ArrayRef<FileSpec> module_file_specs,
464                  const llvm::Triple &triple);
465 
466   bool ReadExtFeature(const lldb_private::ConstString object,
467                       const lldb_private::ConstString annex, std::string &out,
468                       lldb_private::Status &err);
469 
470   void ServeSymbolLookups(lldb_private::Process *process);
471 
472   // Sends QPassSignals packet to the server with given signals to ignore.
473   Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals);
474 
475   /// Return the feature set supported by the gdb-remote server.
476   ///
477   /// This method returns the remote side's response to the qSupported
478   /// packet.  The response is the complete string payload returned
479   /// to the client.
480   ///
481   /// \return
482   ///     The string returned by the server to the qSupported query.
483   const std::string &GetServerSupportedFeatures() const {
484     return m_qSupported_response;
485   }
486 
487   /// Return the array of async JSON packet types supported by the remote.
488   ///
489   /// This method returns the remote side's array of supported JSON
490   /// packet types as a list of type names.  Each of the results are
491   /// expected to have an Enable{type_name} command to enable and configure
492   /// the related feature.  Each type_name for an enabled feature will
493   /// possibly send async-style packets that contain a payload of a
494   /// binhex-encoded JSON dictionary.  The dictionary will have a
495   /// string field named 'type', that contains the type_name of the
496   /// supported packet type.
497   ///
498   /// There is a Plugin category called structured-data plugins.
499   /// A plugin indicates whether it knows how to handle a type_name.
500   /// If so, it can be used to process the async JSON packet.
501   ///
502   /// \return
503   ///     The string returned by the server to the qSupported query.
504   lldb_private::StructuredData::Array *GetSupportedStructuredDataPlugins();
505 
506   /// Configure a StructuredData feature on the remote end.
507   ///
508   /// \see \b Process::ConfigureStructuredData(...) for details.
509   Status
510   ConfigureRemoteStructuredData(ConstString type_name,
511                                 const StructuredData::ObjectSP &config_sp);
512 
513   llvm::Expected<TraceSupportedResponse> SendTraceSupported();
514 
515   llvm::Error SendTraceStart(const llvm::json::Value &request);
516 
517   llvm::Error SendTraceStop(const TraceStopRequest &request);
518 
519   llvm::Expected<std::string> SendTraceGetState(llvm::StringRef type);
520 
521   llvm::Expected<std::vector<uint8_t>>
522   SendTraceGetBinaryData(const TraceGetBinaryDataRequest &request);
523 
524 protected:
525   LazyBool m_supports_not_sending_acks;
526   LazyBool m_supports_thread_suffix;
527   LazyBool m_supports_threads_in_stop_reply;
528   LazyBool m_supports_vCont_all;
529   LazyBool m_supports_vCont_any;
530   LazyBool m_supports_vCont_c;
531   LazyBool m_supports_vCont_C;
532   LazyBool m_supports_vCont_s;
533   LazyBool m_supports_vCont_S;
534   LazyBool m_qHostInfo_is_valid;
535   LazyBool m_curr_pid_is_valid;
536   LazyBool m_qProcessInfo_is_valid;
537   LazyBool m_qGDBServerVersion_is_valid;
538   LazyBool m_supports_alloc_dealloc_memory;
539   LazyBool m_supports_memory_region_info;
540   LazyBool m_supports_watchpoint_support_info;
541   LazyBool m_supports_detach_stay_stopped;
542   LazyBool m_watchpoints_trigger_after_instruction;
543   LazyBool m_attach_or_wait_reply;
544   LazyBool m_prepare_for_reg_writing_reply;
545   LazyBool m_supports_p;
546   LazyBool m_supports_x;
547   LazyBool m_avoid_g_packets;
548   LazyBool m_supports_QSaveRegisterState;
549   LazyBool m_supports_qXfer_auxv_read;
550   LazyBool m_supports_qXfer_libraries_read;
551   LazyBool m_supports_qXfer_libraries_svr4_read;
552   LazyBool m_supports_qXfer_features_read;
553   LazyBool m_supports_qXfer_memory_map_read;
554   LazyBool m_supports_augmented_libraries_svr4_read;
555   LazyBool m_supports_jThreadExtendedInfo;
556   LazyBool m_supports_jLoadedDynamicLibrariesInfos;
557   LazyBool m_supports_jGetSharedCacheInfo;
558   LazyBool m_supports_QPassSignals;
559   LazyBool m_supports_error_string_reply;
560   LazyBool m_supports_multiprocess;
561 
562   bool m_supports_qProcessInfoPID : 1, m_supports_qfProcessInfo : 1,
563       m_supports_qUserName : 1, m_supports_qGroupName : 1,
564       m_supports_qThreadStopInfo : 1, m_supports_z0 : 1, m_supports_z1 : 1,
565       m_supports_z2 : 1, m_supports_z3 : 1, m_supports_z4 : 1,
566       m_supports_QEnvironment : 1, m_supports_QEnvironmentHexEncoded : 1,
567       m_supports_qSymbol : 1, m_qSymbol_requests_done : 1,
568       m_supports_qModuleInfo : 1, m_supports_jThreadsInfo : 1,
569       m_supports_jModulesInfo : 1;
570 
571   lldb::pid_t m_curr_pid;
572   lldb::tid_t m_curr_tid; // Current gdb remote protocol thread index for all
573                           // other operations
574   lldb::tid_t m_curr_tid_run; // Current gdb remote protocol thread index for
575                               // continue, step, etc
576 
577   uint32_t m_num_supported_hardware_watchpoints;
578   uint32_t m_addressing_bits;
579 
580   ArchSpec m_host_arch;
581   ArchSpec m_process_arch;
582   llvm::VersionTuple m_os_version;
583   llvm::VersionTuple m_maccatalyst_version;
584   std::string m_os_build;
585   std::string m_os_kernel;
586   std::string m_hostname;
587   std::string m_gdb_server_name; // from reply to qGDBServerVersion, empty if
588                                  // qGDBServerVersion is not supported
589   uint32_t m_gdb_server_version; // from reply to qGDBServerVersion, zero if
590                                  // qGDBServerVersion is not supported
591   std::chrono::seconds m_default_packet_timeout;
592   uint64_t m_max_packet_size;        // as returned by qSupported
593   std::string m_qSupported_response; // the complete response to qSupported
594 
595   bool m_supported_async_json_packets_is_valid;
596   lldb_private::StructuredData::ObjectSP m_supported_async_json_packets_sp;
597 
598   std::vector<MemoryRegionInfo> m_qXfer_memory_map;
599   bool m_qXfer_memory_map_loaded;
600 
601   bool GetCurrentProcessInfo(bool allow_lazy_pid = true);
602 
603   bool GetGDBServerVersion();
604 
605   // Given the list of compression types that the remote debug stub can support,
606   // possibly enable compression if we find an encoding we can handle.
607   void MaybeEnableCompression(
608       llvm::ArrayRef<llvm::StringRef> supported_compressions);
609 
610   bool DecodeProcessInfoResponse(StringExtractorGDBRemote &response,
611                                  ProcessInstanceInfo &process_info);
612 
613   void OnRunPacketSent(bool first) override;
614 
615   PacketResult SendThreadSpecificPacketAndWaitForResponse(
616       lldb::tid_t tid, StreamString &&payload,
617       StringExtractorGDBRemote &response, bool send_async);
618 
619   Status SendGetTraceDataPacket(StreamGDBRemote &packet, lldb::user_id_t uid,
620                                 lldb::tid_t thread_id,
621                                 llvm::MutableArrayRef<uint8_t> &buffer,
622                                 size_t offset);
623 
624   Status LoadQXferMemoryMap();
625 
626   Status GetQXferMemoryMapRegionInfo(lldb::addr_t addr,
627                                      MemoryRegionInfo &region);
628 
629   LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr);
630 
631 private:
632   GDBRemoteCommunicationClient(const GDBRemoteCommunicationClient &) = delete;
633   const GDBRemoteCommunicationClient &
634   operator=(const GDBRemoteCommunicationClient &) = delete;
635 };
636 
637 } // namespace process_gdb_remote
638 } // namespace lldb_private
639 
640 #endif // LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONCLIENT_H
641