LLDB mainline
GDBRemoteCommunicationClient.h
Go to the documentation of this file.
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 <optional>
18#include <string>
19#include <vector>
20
21#include "lldb/Host/File.h"
29#include "lldb/Utility/UUID.h"
30#if defined(_WIN32)
32#endif
33
34#include "llvm/Support/VersionTuple.h"
35
36namespace lldb_private {
37namespace process_gdb_remote {
38
39/// The offsets used by the target when relocating the executable. Decoded from
40/// qOffsets packet response.
41struct QOffsets {
42 /// If true, the offsets field describes segments. Otherwise, it describes
43 /// sections.
45
46 /// The individual offsets. Section offsets have two or three members.
47 /// Segment offsets have either one of two.
48 std::vector<uint64_t> offsets;
49};
50inline bool operator==(const QOffsets &a, const QOffsets &b) {
51 return a.segments == b.segments && a.offsets == b.offsets;
52}
53llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const QOffsets &offsets);
54
55// A trivial struct used to return a pair of PID and TID.
56struct PidTid {
57 uint64_t pid;
58 uint64_t tid;
59};
60
62public:
64
66
67 // After connecting, send the handshake to the server to make sure
68 // we are communicating with it.
69 bool HandshakeWithServer(Status *error_ptr);
70
72
73 // This packet is usually sent first and the boolean return value
74 // indicates if the packet was send and any response was received
75 // even in the response is UNIMPLEMENTED. If the packet failed to
76 // get a response, then false is returned. This quickly tells us
77 // if we were able to connect and communicate with the remote GDB
78 // server
80
82
83 lldb::pid_t GetCurrentProcessID(bool allow_lazy = true);
84
85 bool LaunchGDBServer(const char *remote_accept_hostname, lldb::pid_t &pid,
86 uint16_t &port, std::string &socket_name);
87
88 size_t QueryGDBServer(
89 std::vector<std::pair<uint16_t, std::string>> &connection_urls);
90
92
93 /// Launch the process using the provided arguments.
94 ///
95 /// \param[in] args
96 /// A list of program arguments. The first entry is the program being run.
97 llvm::Error LaunchProcess(const Args &args);
98
99 /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the
100 /// environment that will get used when launching an application
101 /// in conjunction with the 'A' packet. This function can be called
102 /// multiple times in a row in order to pass on the desired
103 /// environment that the inferior should be launched with.
104 ///
105 /// \param[in] name_equal_value
106 /// A NULL terminated C string that contains a single environment
107 /// in the format "NAME=VALUE".
108 ///
109 /// \return
110 /// Zero if the response was "OK", a positive value if the
111 /// the response was "Exx" where xx are two hex digits, or
112 /// -1 if the call is unsupported or any other unexpected
113 /// response was received.
114 int SendEnvironmentPacket(char const *name_equal_value);
115 int SendEnvironment(const Environment &env);
116
117 int SendLaunchArchPacket(const char *arch);
118
119 int SendLaunchEventDataPacket(const char *data,
120 bool *was_supported = nullptr);
121
122 /// Sends a GDB remote protocol 'I' packet that delivers stdin
123 /// data to the remote process.
124 ///
125 /// \param[in] data
126 /// A pointer to stdin data.
127 ///
128 /// \param[in] data_len
129 /// The number of bytes available at \a data.
130 ///
131 /// \param[in] interrupt_timeout
132 /// If the inferior is running, how long to wait for a `\x03` BREAK
133 /// to interrupt it before giving up. Pass zero only when the caller knows
134 /// the inferior is stopped.
135 ///
136 /// \return
137 /// Zero if the attach was successful, or an error indicating
138 /// an error code.
140 const char *data, size_t data_len,
141 std::chrono::seconds interrupt_timeout = std::chrono::seconds(0));
142
143 /// Sets the path to use for stdin/out/err for a process
144 /// that will be launched with the 'A' packet.
145 ///
146 /// \param[in] file_spec
147 /// The path to use for stdin/out/err
148 ///
149 /// \return
150 /// Zero if the for success, or an error code for failure.
151 int SetSTDIN(const FileSpec &file_spec);
152 int SetSTDOUT(const FileSpec &file_spec);
153 int SetSTDERR(const FileSpec &file_spec);
154
155 /// Send the dimensions of the user's stdio terminal window to the server.
156 int SetSTDIOWindowSize(uint16_t cols, uint16_t rows);
157
158 /// Sets the disable ASLR flag to \a enable for a process that will
159 /// be launched with the 'A' packet.
160 ///
161 /// \param[in] enable
162 /// A boolean value indicating whether to disable ASLR or not.
163 ///
164 /// \return
165 /// Zero if the for success, or an error code for failure.
166 int SetDisableASLR(bool enable);
167
168 /// Sets the DetachOnError flag to \a enable for the process controlled by the
169 /// stub.
170 ///
171 /// \param[in] enable
172 /// A boolean value indicating whether to detach on error or not.
173 ///
174 /// \return
175 /// Zero if the for success, or an error code for failure.
176 int SetDetachOnError(bool enable);
177
178 /// Sets the working directory to \a path for a process that will
179 /// be launched with the 'A' packet for non platform based
180 /// connections. If this packet is sent to a GDB server that
181 /// implements the platform, it will change the current working
182 /// directory for the platform process.
183 ///
184 /// \param[in] working_dir
185 /// The path to a directory to use when launching our process
186 ///
187 /// \return
188 /// Zero if the for success, or an error code for failure.
189 int SetWorkingDir(const FileSpec &working_dir);
190
191 /// Gets the current working directory of a remote platform GDB
192 /// server.
193 ///
194 /// \param[out] working_dir
195 /// The current working directory on the remote platform.
196 ///
197 /// \return
198 /// Boolean for success
199 bool GetWorkingDir(FileSpec &working_dir);
200
201 lldb::addr_t AllocateMemory(size_t size, uint32_t permissions);
202
204
205 Status Detach(bool keep_stopped, lldb::pid_t pid = LLDB_INVALID_PROCESS_ID);
206
208
209 std::optional<uint32_t> GetWatchpointSlotCount();
210
211 std::optional<bool> GetWatchpointReportedAfter();
212
213 WatchpointHardwareFeature GetSupportedWatchpointTypes();
214
216
217 std::chrono::seconds GetHostDefaultPacketTimeout();
218
220
222 bool &value_is_offset);
223
224 std::vector<lldb::addr_t> GetProcessStandaloneBinaries();
225
226 void GetRemoteQSupported();
227
228 bool GetVContSupported(llvm::StringRef flavor);
229
231
232 enum class xPacketState {
234 Prefixed, // Successful responses start with a 'b' character. This is the
235 // style used by GDB.
236 Bare, // No prefix, packets starts with the memory being read. This is
237 // LLDB's original style.
238 };
240
242
244
245 void ResetDiscoverableSettings(bool did_exec);
246
247 bool GetHostInfo(bool force = false);
248
250
251 llvm::VersionTuple GetOSVersion();
252
253 llvm::VersionTuple GetMacCatalystVersion();
254
255 std::optional<std::string> GetOSBuildString();
256
257 std::optional<std::string> GetOSKernelDescription();
258
260
262
263 bool GetHostname(std::string &s);
264
266
267 bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info);
268
269 uint32_t FindProcesses(const ProcessInstanceInfoMatch &process_match_info,
270 ProcessInstanceInfoList &process_infos);
271
272 bool GetUserName(uint32_t uid, std::string &name);
273
274 bool GetGroupName(uint32_t gid, std::string &name);
275
277
278 bool HasAnyVContSupport() { return GetVContSupported("a"); }
279
281
283
285 switch (type) {
287 return m_supports_z0;
289 return m_supports_z1;
290 case eWatchpointWrite:
291 return m_supports_z2;
292 case eWatchpointRead:
293 return m_supports_z3;
295 return m_supports_z4;
296 default:
297 return false;
298 }
299 }
300
302 GDBStoppointType type, // Type of breakpoint or watchpoint
303 bool insert, // Insert or remove?
304 lldb::addr_t addr, // Address of breakpoint or watchpoint
305 uint32_t length, // Byte Size of breakpoint or watchpoint
306 std::chrono::seconds interrupt_timeout); // Time to wait for an interrupt
307
308 void TestPacketSpeed(const uint32_t num_packets, uint32_t max_send,
309 uint32_t max_recv, uint64_t recv_amount, bool json,
310 Stream &strm);
311
312 // This packet is for testing the speed of the interface only. Both
313 // the client and server need to support it, but this allows us to
314 // measure the packet speed without any other work being done on the
315 // other end and avoids any of that work affecting the packet send
316 // and response times.
317 bool SendSpeedTestPacket(uint32_t send_size, uint32_t recv_size);
318
319 std::optional<PidTid> SendSetCurrentThreadPacket(uint64_t tid, uint64_t pid,
320 char op);
321
322 bool SetCurrentThread(uint64_t tid,
324
325 bool SetCurrentThreadForRun(uint64_t tid,
327
329
331
333
335
336 uint64_t GetRemoteMaxPacketSize();
337
338 bool GetEchoSupported();
339
341
343
345
347
349
351
353
355
357
359
361
362 /// Whether the WebAssembly stub can be told which module instance to read
363 /// from, which it advertises with "qWasmInstance+" in its qSupported
364 /// response.
366
367 /// Send the "jAcceleratorPluginInitialize" packet and return the actions
368 /// requested by each accelerator plugin installed in lldb-server. The packet
369 /// is only sent if the lldb-server advertised accelerator plugin support via
370 /// "accelerator-plugins+" in its qSupported response; otherwise (and when no
371 /// plugin returns actions) this returns an empty vector. Errors are returned
372 /// for the caller to report.
373 llvm::Expected<std::vector<AcceleratorActions>>
375
376 /// Send the "jAcceleratorPluginBreakpointHit" packet to notify the
377 /// accelerator plugin that one of its requested breakpoints was hit, and
378 /// return the plugin's response. This is only used when the lldb-server
379 /// advertised accelerator plugin support via "accelerator-plugins+" in its
380 /// qSupported response, since the breakpoints that trigger it are only set in
381 /// that case. Errors are returned for the caller to report.
382 llvm::Expected<AcceleratorBreakpointHitResponse>
384
386 {
387 // Uncomment this to have lldb pretend the debug server doesn't respond to
388 // alloc/dealloc memory packets.
389 // m_supports_alloc_dealloc_memory = lldb_private::eLazyBoolNo;
391 }
392
393 std::vector<std::pair<lldb::pid_t, lldb::tid_t>>
394 GetCurrentProcessAndThreadIDs(bool &sequence_mutex_unavailable);
395
396 size_t GetCurrentThreadIDs(std::vector<lldb::tid_t> &thread_ids,
397 bool &sequence_mutex_unavailable);
398
399 lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags,
400 mode_t mode, Status &error);
401
403
404 std::optional<GDBRemoteFStatData> FStat(lldb::user_id_t fd);
405
406 // NB: this is just a convenience wrapper over open() + fstat(). It does not
407 // work if the file cannot be opened.
408 std::optional<GDBRemoteFStatData> Stat(const FileSpec &file_spec);
409
410 lldb::user_id_t GetFileSize(const FileSpec &file_spec);
411
413 bool only_dir);
414
415 Status GetFilePermissions(const FileSpec &file_spec,
416 uint32_t &file_permissions);
417
418 Status SetFilePermissions(const FileSpec &file_spec,
419 uint32_t file_permissions);
420
421 uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst,
422 uint64_t dst_len, Status &error);
423
424 uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src,
425 uint64_t src_len, Status &error);
426
427 Status CreateSymlink(const FileSpec &src, const FileSpec &dst);
428
429 Status Unlink(const FileSpec &file_spec);
430
431 Status MakeDirectory(const FileSpec &file_spec, uint32_t mode);
432
433 bool GetFileExists(const FileSpec &file_spec);
434
436 llvm::StringRef command,
437 const FileSpec &working_dir, // Pass empty FileSpec to use the current
438 // working directory
439 int *status_ptr, // Pass nullptr if you don't want the process exit status
440 int *signo_ptr, // Pass nullptr if you don't want the signal that caused
441 // the process to exit
442 std::string
443 *command_output, // Pass nullptr if you don't want the command output
444 std::string *separated_error_output, // Pass nullptr if you don't want the
445 // command error output
446 const Timeout<std::micro> &timeout);
447
448 llvm::ErrorOr<llvm::MD5::MD5Result> CalculateMD5(const FileSpec &file_spec);
449
451 lldb::tid_t tid,
452 uint32_t
453 reg_num); // Must be the eRegisterKindProcessPlugin register number
454
456
457 bool
459 uint32_t reg_num, // eRegisterKindProcessPlugin register number
460 llvm::ArrayRef<uint8_t> data);
461
462 bool WriteAllRegisters(lldb::tid_t tid, llvm::ArrayRef<uint8_t> data);
463
464 bool SaveRegisterState(lldb::tid_t tid, uint32_t &save_id);
465
466 bool RestoreRegisterState(lldb::tid_t tid, uint32_t save_id);
467
469
470 const char *GetGDBServerProgramName();
471
473
474 bool AvoidGPackets(ProcessGDBRemote *process);
475
477
479
481
483
485
487
488 bool UsesNativeSignals();
489
491 int32_t type);
492
493 Status WriteMemoryTags(lldb::addr_t addr, size_t len, int32_t type,
494 const std::vector<uint8_t> &tags);
495
496 /// Use qOffsets to query the offset used when relocating the target
497 /// executable. If successful, the returned structure will contain at least
498 /// one value in the offsets field.
499 std::optional<QOffsets> GetQOffsets();
500
501 bool GetModuleInfo(const FileSpec &module_file_spec,
502 const ArchSpec &arch_spec, ModuleSpec &module_spec);
503
504 std::optional<std::vector<ModuleSpec>>
505 GetModulesInfo(llvm::ArrayRef<FileSpec> module_file_specs,
506 const llvm::Triple &triple);
507
508 llvm::Expected<std::string> ReadExtFeature(llvm::StringRef object,
509 llvm::StringRef annex);
510
512
513 // Sends QPassSignals packet to the server with given signals to ignore.
514 Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals);
515
516 /// Return the feature set supported by the gdb-remote server.
517 ///
518 /// This method returns the remote side's response to the qSupported
519 /// packet. The response is the complete string payload returned
520 /// to the client.
521 ///
522 /// \return
523 /// The string returned by the server to the qSupported query.
524 const std::string &GetServerSupportedFeatures() const {
526 }
527
528 /// Return the array of async JSON packet types supported by the remote.
529 ///
530 /// This method returns the remote side's array of supported JSON
531 /// packet types as a list of type names. Each of the results are
532 /// expected to have an Enable{type_name} command to enable and configure
533 /// the related feature. Each type_name for an enabled feature will
534 /// possibly send async-style packets that contain a payload of a
535 /// binhex-encoded JSON dictionary. The dictionary will have a
536 /// string field named 'type', that contains the type_name of the
537 /// supported packet type.
538 ///
539 /// There is a Plugin category called structured-data plugins.
540 /// A plugin indicates whether it knows how to handle a type_name.
541 /// If so, it can be used to process the async JSON packet.
542 ///
543 /// \return
544 /// The string returned by the server to the qSupported query.
546
547 /// Configure a StructuredData feature on the remote end.
548 ///
549 /// \see \b Process::ConfigureStructuredData(...) for details.
550 Status
551 ConfigureRemoteStructuredData(llvm::StringRef type_name,
552 const StructuredData::ObjectSP &config_sp);
553
554 llvm::Expected<TraceSupportedResponse>
555 SendTraceSupported(std::chrono::seconds interrupt_timeout);
556
557 llvm::Error SendTraceStart(const llvm::json::Value &request,
558 std::chrono::seconds interrupt_timeout);
559
560 llvm::Error SendTraceStop(const TraceStopRequest &request,
561 std::chrono::seconds interrupt_timeout);
562
563 llvm::Expected<std::string>
564 SendTraceGetState(llvm::StringRef type,
565 std::chrono::seconds interrupt_timeout);
566
567 llvm::Expected<std::vector<uint8_t>>
569 std::chrono::seconds interrupt_timeout);
570
571 bool GetSaveCoreSupported() const;
572
573 llvm::Expected<int> KillProcess(lldb::pid_t pid);
574
575protected:
616 std::optional<xPacketState> m_x_packet_state;
623
634
635 /// Current gdb remote protocol process identifier for all other operations
637 /// Current gdb remote protocol process identifier for continue, step, etc
639 /// Current gdb remote protocol thread identifier for all other operations
641 /// Current gdb remote protocol thread identifier for continue, step, etc
643
645 WatchpointHardwareFeature m_watchpoint_types =
646 eWatchpointHardwareFeatureUnknown;
649
656 std::vector<lldb::addr_t> m_binary_addresses;
657 llvm::VersionTuple m_os_version;
658 llvm::VersionTuple m_maccatalyst_version;
659 std::string m_os_build;
660 std::string m_os_kernel;
661 std::string m_hostname;
662 std::string m_gdb_server_name; // from reply to qGDBServerVersion, empty if
663 // qGDBServerVersion is not supported
665 UINT32_MAX; // from reply to qGDBServerVersion, zero if
666 // qGDBServerVersion is not supported
667 std::chrono::seconds m_default_packet_timeout;
668 int m_target_vm_page_size = 0; // target system VM page size; 0 unspecified
669 uint64_t m_max_packet_size = 0; // as returned by qSupported
670 std::string m_qSupported_response; // the complete response to qSupported
671
674
675 std::vector<MemoryRegionInfo> m_qXfer_memory_map;
677
678 bool GetCurrentProcessInfo(bool allow_lazy_pid = true);
679
680 bool GetGDBServerVersion();
681
682 // Given the list of compression types that the remote debug stub can support,
683 // possibly enable compression if we find an encoding we can handle.
685 llvm::ArrayRef<llvm::StringRef> supported_compressions);
686
688 ProcessInstanceInfo &process_info);
689
690 void OnRunPacketSent(bool first) override;
691
693 lldb::tid_t tid, StreamString &&payload,
694 StringExtractorGDBRemote &response);
695
697 lldb::tid_t thread_id,
698 llvm::MutableArrayRef<uint8_t> &buffer,
699 size_t offset);
700
702
704 MemoryRegionInfo &region);
705
706 LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr);
707
708private:
712};
713
714} // namespace process_gdb_remote
715} // namespace lldb_private
716
717#endif // LLDB_SOURCE_PLUGINS_PROCESS_GDB_REMOTE_GDBREMOTECOMMUNICATIONCLIENT_H
static llvm::raw_ostream & error(Stream &strm)
A class which holds the metadata from a remote stub/corefile note about how many bits are used for ad...
An architecture specification class.
Definition ArchSpec.h:32
A command line argument class.
Definition Args.h:33
"lldb/Utility/ArgCompletionRequest.h"
A file utility class.
Definition FileSpec.h:56
A plug-in interface definition class for debugging a process.
Definition Process.h:360
An error handling class.
Definition Status.h:118
A stream class that can stream formatted output to a file.
Definition Stream.h:28
std::shared_ptr< Object > ObjectSP
Represents UUID's of various sizes.
Definition UUID.h:27
lldb::DataBufferSP ReadRegister(lldb::tid_t tid, uint32_t reg_num)
PacketResult SendThreadSpecificPacketAndWaitForResponse(lldb::tid_t tid, StreamString &&payload, StringExtractorGDBRemote &response)
bool DecodeProcessInfoResponse(StringExtractorGDBRemote &response, ProcessInstanceInfo &process_info)
lldb_private::StructuredData::Array * GetSupportedStructuredDataPlugins()
Return the array of async JSON packet types supported by the remote.
lldb::tid_t m_curr_tid_run
Current gdb remote protocol thread identifier for continue, step, etc.
int SetSTDIOWindowSize(uint16_t cols, uint16_t rows)
Send the dimensions of the user's stdio terminal window to the server.
int SendLaunchEventDataPacket(const char *data, bool *was_supported=nullptr)
std::optional< std::vector< ModuleSpec > > GetModulesInfo(llvm::ArrayRef< FileSpec > module_file_specs, const llvm::Triple &triple)
llvm::Expected< std::string > ReadExtFeature(llvm::StringRef object, llvm::StringRef annex)
std::optional< GDBRemoteFStatData > Stat(const FileSpec &file_spec)
std::optional< QOffsets > GetQOffsets()
Use qOffsets to query the offset used when relocating the target executable.
size_t QueryGDBServer(std::vector< std::pair< uint16_t, std::string > > &connection_urls)
Status SendGetTraceDataPacket(StreamGDBRemote &packet, lldb::user_id_t uid, lldb::tid_t thread_id, llvm::MutableArrayRef< uint8_t > &buffer, size_t offset)
llvm::Error SendTraceStop(const TraceStopRequest &request, std::chrono::seconds interrupt_timeout)
void TestPacketSpeed(const uint32_t num_packets, uint32_t max_send, uint32_t max_recv, uint64_t recv_amount, bool json, Stream &strm)
bool LaunchGDBServer(const char *remote_accept_hostname, lldb::pid_t &pid, uint16_t &port, std::string &socket_name)
bool SetCurrentThreadForRun(uint64_t tid, lldb::pid_t pid=LLDB_INVALID_PROCESS_ID)
uint8_t SendGDBStoppointTypePacket(GDBStoppointType type, bool insert, lldb::addr_t addr, uint32_t length, std::chrono::seconds interrupt_timeout)
uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, Status &error)
bool GetWorkingDir(FileSpec &working_dir)
Gets the current working directory of a remote platform GDB server.
lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags, mode_t mode, Status &error)
std::optional< GDBRemoteFStatData > FStat(lldb::user_id_t fd)
Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, std::string *separated_error_output, const Timeout< std::micro > &timeout)
llvm::Expected< std::string > SendTraceGetState(llvm::StringRef type, std::chrono::seconds interrupt_timeout)
llvm::Error LaunchProcess(const Args &args)
Launch the process using the provided arguments.
const GDBRemoteCommunicationClient & operator=(const GDBRemoteCommunicationClient &)=delete
Status ConfigureRemoteStructuredData(llvm::StringRef type_name, const StructuredData::ObjectSP &config_sp)
Configure a StructuredData feature on the remote end.
uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src, uint64_t src_len, Status &error)
llvm::Expected< std::vector< AcceleratorActions > > GetAcceleratorInitializeActions()
Send the "jAcceleratorPluginInitialize" packet and return the actions requested by each accelerator p...
bool SetCurrentThread(uint64_t tid, lldb::pid_t pid=LLDB_INVALID_PROCESS_ID)
int SendStdinNotification(const char *data, size_t data_len, std::chrono::seconds interrupt_timeout=std::chrono::seconds(0))
Sends a GDB remote protocol 'I' packet that delivers stdin data to the remote process.
const std::string & GetServerSupportedFeatures() const
Return the feature set supported by the gdb-remote server.
lldb::tid_t m_curr_tid
Current gdb remote protocol thread identifier for all other operations.
bool WriteAllRegisters(lldb::tid_t tid, llvm::ArrayRef< uint8_t > data)
bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info)
Status SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions)
Status GetQXferMemoryMapRegionInfo(lldb::addr_t addr, MemoryRegionInfo &region)
int SetDetachOnError(bool enable)
Sets the DetachOnError flag to enable for the process controlled by the stub.
LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr)
bool WriteRegister(lldb::tid_t tid, uint32_t reg_num, llvm::ArrayRef< uint8_t > data)
llvm::Expected< std::vector< uint8_t > > SendTraceGetBinaryData(const TraceGetBinaryDataRequest &request, std::chrono::seconds interrupt_timeout)
GDBRemoteCommunicationClient(const GDBRemoteCommunicationClient &)=delete
int SetSTDIN(const FileSpec &file_spec)
Sets the path to use for stdin/out/err for a process that will be launched with the 'A' packet.
lldb::pid_t m_curr_pid
Current gdb remote protocol process identifier for all other operations.
Status WriteMemoryTags(lldb::addr_t addr, size_t len, int32_t type, const std::vector< uint8_t > &tags)
size_t GetCurrentThreadIDs(std::vector< lldb::tid_t > &thread_ids, bool &sequence_mutex_unavailable)
Status Detach(bool keep_stopped, lldb::pid_t pid=LLDB_INVALID_PROCESS_ID)
int SetDisableASLR(bool enable)
Sets the disable ASLR flag to enable for a process that will be launched with the 'A' packet.
Status GetMemoryRegionInfo(lldb::addr_t addr, MemoryRegionInfo &range_info)
bool GetWasmInstanceSupported()
Whether the WebAssembly stub can be told which module instance to read from, which it advertises with...
void AutoCompleteDiskFileOrDirectory(CompletionRequest &request, bool only_dir)
lldb::pid_t m_curr_pid_run
Current gdb remote protocol process identifier for continue, step, etc.
void MaybeEnableCompression(llvm::ArrayRef< llvm::StringRef > supported_compressions)
llvm::Expected< TraceSupportedResponse > SendTraceSupported(std::chrono::seconds interrupt_timeout)
llvm::ErrorOr< llvm::MD5::MD5Result > CalculateMD5(const FileSpec &file_spec)
llvm::Error SendTraceStart(const llvm::json::Value &request, std::chrono::seconds interrupt_timeout)
llvm::Expected< AcceleratorBreakpointHitResponse > AcceleratorBreakpointHit(const AcceleratorBreakpointHitArgs &args)
Send the "jAcceleratorPluginBreakpointHit" packet to notify the accelerator plugin that one of its re...
bool GetModuleInfo(const FileSpec &module_file_spec, const ArchSpec &arch_spec, ModuleSpec &module_spec)
std::optional< PidTid > SendSetCurrentThreadPacket(uint64_t tid, uint64_t pid, char op)
Status GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions)
uint32_t FindProcesses(const ProcessInstanceInfoMatch &process_match_info, ProcessInstanceInfoList &process_infos)
lldb::DataBufferSP ReadMemoryTags(lldb::addr_t addr, size_t len, int32_t type)
int SetWorkingDir(const FileSpec &working_dir)
Sets the working directory to path for a process that will be launched with the 'A' packet for non pl...
std::vector< std::pair< lldb::pid_t, lldb::tid_t > > GetCurrentProcessAndThreadIDs(bool &sequence_mutex_unavailable)
bool GetThreadStopInfo(lldb::tid_t tid, StringExtractorGDBRemote &response)
bool GetProcessStandaloneBinary(UUID &uuid, lldb::addr_t &value, bool &value_is_offset)
int SendEnvironmentPacket(char const *name_equal_value)
Sends a "QEnvironment:NAME=VALUE" packet that will build up the environment that will get used when l...
#define LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_ADDRESS
#define UINT32_MAX
#define LLDB_INVALID_PROCESS_ID
llvm::raw_ostream & operator<<(llvm::raw_ostream &os, const QOffsets &offsets)
bool operator==(const QOffsets &a, const QOffsets &b)
A class that represents a running process on the host machine.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
Definition Host.h:32
uint64_t pid_t
Definition lldb-types.h:84
uint64_t user_id_t
Definition lldb-types.h:83
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
uint64_t addr_t
Definition lldb-types.h:80
uint64_t tid_t
Definition lldb-types.h:85
Sent by the client when a plugin-requested breakpoint is hit.
jLLDBTraceGetBinaryData gdb-remote packet
jLLDBTraceStop gdb-remote packet
The offsets used by the target when relocating the executable.
bool segments
If true, the offsets field describes segments.
std::vector< uint64_t > offsets
The individual offsets.