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"
28#include "lldb/Utility/UUID.h"
29#if defined(_WIN32)
31#endif
32
33#include "llvm/Support/VersionTuple.h"
34
35namespace lldb_private {
36namespace process_gdb_remote {
37
38/// The offsets used by the target when relocating the executable. Decoded from
39/// qOffsets packet response.
40struct QOffsets {
41 /// If true, the offsets field describes segments. Otherwise, it describes
42 /// sections.
44
45 /// The individual offsets. Section offsets have two or three members.
46 /// Segment offsets have either one of two.
47 std::vector<uint64_t> offsets;
48};
49inline bool operator==(const QOffsets &a, const QOffsets &b) {
50 return a.segments == b.segments && a.offsets == b.offsets;
51}
52llvm::raw_ostream &operator<<(llvm::raw_ostream &os, const QOffsets &offsets);
53
54// A trivial struct used to return a pair of PID and TID.
55struct PidTid {
56 uint64_t pid;
57 uint64_t tid;
58};
59
61public:
63
65
66 // After connecting, send the handshake to the server to make sure
67 // we are communicating with it.
68 bool HandshakeWithServer(Status *error_ptr);
69
71
72 // This packet is usually sent first and the boolean return value
73 // indicates if the packet was send and any response was received
74 // even in the response is UNIMPLEMENTED. If the packet failed to
75 // get a response, then false is returned. This quickly tells us
76 // if we were able to connect and communicate with the remote GDB
77 // server
79
81
82 lldb::pid_t GetCurrentProcessID(bool allow_lazy = true);
83
84 bool LaunchGDBServer(const char *remote_accept_hostname, lldb::pid_t &pid,
85 uint16_t &port, std::string &socket_name);
86
87 size_t QueryGDBServer(
88 std::vector<std::pair<uint16_t, std::string>> &connection_urls);
89
91
92 /// Launch the process using the provided arguments.
93 ///
94 /// \param[in] args
95 /// A list of program arguments. The first entry is the program being run.
96 llvm::Error LaunchProcess(const Args &args);
97
98 /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the
99 /// environment that will get used when launching an application
100 /// in conjunction with the 'A' packet. This function can be called
101 /// multiple times in a row in order to pass on the desired
102 /// environment that the inferior should be launched with.
103 ///
104 /// \param[in] name_equal_value
105 /// A NULL terminated C string that contains a single environment
106 /// in the format "NAME=VALUE".
107 ///
108 /// \return
109 /// Zero if the response was "OK", a positive value if the
110 /// the response was "Exx" where xx are two hex digits, or
111 /// -1 if the call is unsupported or any other unexpected
112 /// response was received.
113 int SendEnvironmentPacket(char const *name_equal_value);
114 int SendEnvironment(const Environment &env);
115
116 int SendLaunchArchPacket(const char *arch);
117
118 int SendLaunchEventDataPacket(const char *data,
119 bool *was_supported = nullptr);
120
121 /// Sends a GDB remote protocol 'I' packet that delivers stdin
122 /// data to the remote process.
123 ///
124 /// \param[in] data
125 /// A pointer to stdin data.
126 ///
127 /// \param[in] data_len
128 /// The number of bytes available at \a data.
129 ///
130 /// \return
131 /// Zero if the attach was successful, or an error indicating
132 /// an error code.
133 int SendStdinNotification(const char *data, size_t data_len);
134
135 /// Sets the path to use for stdin/out/err for a process
136 /// that will be launched with the 'A' packet.
137 ///
138 /// \param[in] file_spec
139 /// The path to use for stdin/out/err
140 ///
141 /// \return
142 /// Zero if the for success, or an error code for failure.
143 int SetSTDIN(const FileSpec &file_spec);
144 int SetSTDOUT(const FileSpec &file_spec);
145 int SetSTDERR(const FileSpec &file_spec);
146
147 /// Sets the disable ASLR flag to \a enable for a process that will
148 /// be launched with the 'A' packet.
149 ///
150 /// \param[in] enable
151 /// A boolean value indicating whether to disable ASLR or not.
152 ///
153 /// \return
154 /// Zero if the for success, or an error code for failure.
155 int SetDisableASLR(bool enable);
156
157 /// Sets the DetachOnError flag to \a enable for the process controlled by the
158 /// stub.
159 ///
160 /// \param[in] enable
161 /// A boolean value indicating whether to detach on error or not.
162 ///
163 /// \return
164 /// Zero if the for success, or an error code for failure.
165 int SetDetachOnError(bool enable);
166
167 /// Sets the working directory to \a path for a process that will
168 /// be launched with the 'A' packet for non platform based
169 /// connections. If this packet is sent to a GDB server that
170 /// implements the platform, it will change the current working
171 /// directory for the platform process.
172 ///
173 /// \param[in] working_dir
174 /// The path to a directory to use when launching our process
175 ///
176 /// \return
177 /// Zero if the for success, or an error code for failure.
178 int SetWorkingDir(const FileSpec &working_dir);
179
180 /// Gets the current working directory of a remote platform GDB
181 /// server.
182 ///
183 /// \param[out] working_dir
184 /// The current working directory on the remote platform.
185 ///
186 /// \return
187 /// Boolean for success
188 bool GetWorkingDir(FileSpec &working_dir);
189
190 lldb::addr_t AllocateMemory(size_t size, uint32_t permissions);
191
193
194 Status Detach(bool keep_stopped, lldb::pid_t pid = LLDB_INVALID_PROCESS_ID);
195
197
198 std::optional<uint32_t> GetWatchpointSlotCount();
199
200 std::optional<bool> GetWatchpointReportedAfter();
201
202 WatchpointHardwareFeature GetSupportedWatchpointTypes();
203
205
206 std::chrono::seconds GetHostDefaultPacketTimeout();
207
209
211 bool &value_is_offset);
212
213 std::vector<lldb::addr_t> GetProcessStandaloneBinaries();
214
215 void GetRemoteQSupported();
216
217 bool GetVContSupported(char flavor);
218
220
221 enum class xPacketState {
223 Prefixed, // Successful responses start with a 'b' character. This is the
224 // style used by GDB.
225 Bare, // No prefix, packets starts with the memory being read. This is
226 // LLDB's original style.
227 };
229
231
233
234 void ResetDiscoverableSettings(bool did_exec);
235
236 bool GetHostInfo(bool force = false);
237
239
240 llvm::VersionTuple GetOSVersion();
241
242 llvm::VersionTuple GetMacCatalystVersion();
243
244 std::optional<std::string> GetOSBuildString();
245
246 std::optional<std::string> GetOSKernelDescription();
247
249
251
252 bool GetHostname(std::string &s);
253
255
256 bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info);
257
258 uint32_t FindProcesses(const ProcessInstanceInfoMatch &process_match_info,
259 ProcessInstanceInfoList &process_infos);
260
261 bool GetUserName(uint32_t uid, std::string &name);
262
263 bool GetGroupName(uint32_t gid, std::string &name);
264
266
267 bool HasAnyVContSupport() { return GetVContSupported('a'); }
268
270
272
274 switch (type) {
276 return m_supports_z0;
278 return m_supports_z1;
279 case eWatchpointWrite:
280 return m_supports_z2;
281 case eWatchpointRead:
282 return m_supports_z3;
284 return m_supports_z4;
285 default:
286 return false;
287 }
288 }
289
291 GDBStoppointType type, // Type of breakpoint or watchpoint
292 bool insert, // Insert or remove?
293 lldb::addr_t addr, // Address of breakpoint or watchpoint
294 uint32_t length, // Byte Size of breakpoint or watchpoint
295 std::chrono::seconds interrupt_timeout); // Time to wait for an interrupt
296
297 void TestPacketSpeed(const uint32_t num_packets, uint32_t max_send,
298 uint32_t max_recv, uint64_t recv_amount, bool json,
299 Stream &strm);
300
301 // This packet is for testing the speed of the interface only. Both
302 // the client and server need to support it, but this allows us to
303 // measure the packet speed without any other work being done on the
304 // other end and avoids any of that work affecting the packet send
305 // and response times.
306 bool SendSpeedTestPacket(uint32_t send_size, uint32_t recv_size);
307
308 std::optional<PidTid> SendSetCurrentThreadPacket(uint64_t tid, uint64_t pid,
309 char op);
310
311 bool SetCurrentThread(uint64_t tid,
313
314 bool SetCurrentThreadForRun(uint64_t tid,
316
318
320
322
324
325 uint64_t GetRemoteMaxPacketSize();
326
327 bool GetEchoSupported();
328
330
332
334
336
338
340
342
344
346 {
347 // Uncomment this to have lldb pretend the debug server doesn't respond to
348 // alloc/dealloc memory packets.
349 // m_supports_alloc_dealloc_memory = lldb_private::eLazyBoolNo;
351 }
352
353 std::vector<std::pair<lldb::pid_t, lldb::tid_t>>
354 GetCurrentProcessAndThreadIDs(bool &sequence_mutex_unavailable);
355
356 size_t GetCurrentThreadIDs(std::vector<lldb::tid_t> &thread_ids,
357 bool &sequence_mutex_unavailable);
358
359 lldb::user_id_t OpenFile(const FileSpec &file_spec, File::OpenOptions flags,
360 mode_t mode, Status &error);
361
363
364 std::optional<GDBRemoteFStatData> FStat(lldb::user_id_t fd);
365
366 // NB: this is just a convenience wrapper over open() + fstat(). It does not
367 // work if the file cannot be opened.
368 std::optional<GDBRemoteFStatData> Stat(const FileSpec &file_spec);
369
370 lldb::user_id_t GetFileSize(const FileSpec &file_spec);
371
373 bool only_dir);
374
375 Status GetFilePermissions(const FileSpec &file_spec,
376 uint32_t &file_permissions);
377
378 Status SetFilePermissions(const FileSpec &file_spec,
379 uint32_t file_permissions);
380
381 uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst,
382 uint64_t dst_len, Status &error);
383
384 uint64_t WriteFile(lldb::user_id_t fd, uint64_t offset, const void *src,
385 uint64_t src_len, Status &error);
386
387 Status CreateSymlink(const FileSpec &src, const FileSpec &dst);
388
389 Status Unlink(const FileSpec &file_spec);
390
391 Status MakeDirectory(const FileSpec &file_spec, uint32_t mode);
392
393 bool GetFileExists(const FileSpec &file_spec);
394
396 llvm::StringRef command,
397 const FileSpec &working_dir, // Pass empty FileSpec to use the current
398 // working directory
399 int *status_ptr, // Pass nullptr if you don't want the process exit status
400 int *signo_ptr, // Pass nullptr if you don't want the signal that caused
401 // the process to exit
402 std::string
403 *command_output, // Pass nullptr if you don't want the command output
404 const Timeout<std::micro> &timeout);
405
406 llvm::ErrorOr<llvm::MD5::MD5Result> CalculateMD5(const FileSpec &file_spec);
407
409 lldb::tid_t tid,
410 uint32_t
411 reg_num); // Must be the eRegisterKindProcessPlugin register number
412
414
415 bool
417 uint32_t reg_num, // eRegisterKindProcessPlugin register number
418 llvm::ArrayRef<uint8_t> data);
419
420 bool WriteAllRegisters(lldb::tid_t tid, llvm::ArrayRef<uint8_t> data);
421
422 bool SaveRegisterState(lldb::tid_t tid, uint32_t &save_id);
423
424 bool RestoreRegisterState(lldb::tid_t tid, uint32_t save_id);
425
427
428 const char *GetGDBServerProgramName();
429
431
432 bool AvoidGPackets(ProcessGDBRemote *process);
433
435
437
439
441
443
445
446 bool UsesNativeSignals();
447
449 int32_t type);
450
451 Status WriteMemoryTags(lldb::addr_t addr, size_t len, int32_t type,
452 const std::vector<uint8_t> &tags);
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 std::optional<QOffsets> GetQOffsets();
458
459 bool GetModuleInfo(const FileSpec &module_file_spec,
460 const ArchSpec &arch_spec, ModuleSpec &module_spec);
461
462 std::optional<std::vector<ModuleSpec>>
463 GetModulesInfo(llvm::ArrayRef<FileSpec> module_file_specs,
464 const llvm::Triple &triple);
465
466 llvm::Expected<std::string> ReadExtFeature(llvm::StringRef object,
467 llvm::StringRef annex);
468
470
471 // Sends QPassSignals packet to the server with given signals to ignore.
472 Status SendSignalsToIgnore(llvm::ArrayRef<int32_t> signals);
473
474 /// Return the feature set supported by the gdb-remote server.
475 ///
476 /// This method returns the remote side's response to the qSupported
477 /// packet. The response is the complete string payload returned
478 /// to the client.
479 ///
480 /// \return
481 /// The string returned by the server to the qSupported query.
482 const std::string &GetServerSupportedFeatures() const {
484 }
485
486 /// Return the array of async JSON packet types supported by the remote.
487 ///
488 /// This method returns the remote side's array of supported JSON
489 /// packet types as a list of type names. Each of the results are
490 /// expected to have an Enable{type_name} command to enable and configure
491 /// the related feature. Each type_name for an enabled feature will
492 /// possibly send async-style packets that contain a payload of a
493 /// binhex-encoded JSON dictionary. The dictionary will have a
494 /// string field named 'type', that contains the type_name of the
495 /// supported packet type.
496 ///
497 /// There is a Plugin category called structured-data plugins.
498 /// A plugin indicates whether it knows how to handle a type_name.
499 /// If so, it can be used to process the async JSON packet.
500 ///
501 /// \return
502 /// The string returned by the server to the qSupported query.
504
505 /// Configure a StructuredData feature on the remote end.
506 ///
507 /// \see \b Process::ConfigureStructuredData(...) for details.
508 Status
509 ConfigureRemoteStructuredData(llvm::StringRef type_name,
510 const StructuredData::ObjectSP &config_sp);
511
512 llvm::Expected<TraceSupportedResponse>
513 SendTraceSupported(std::chrono::seconds interrupt_timeout);
514
515 llvm::Error SendTraceStart(const llvm::json::Value &request,
516 std::chrono::seconds interrupt_timeout);
517
518 llvm::Error SendTraceStop(const TraceStopRequest &request,
519 std::chrono::seconds interrupt_timeout);
520
521 llvm::Expected<std::string>
522 SendTraceGetState(llvm::StringRef type,
523 std::chrono::seconds interrupt_timeout);
524
525 llvm::Expected<std::vector<uint8_t>>
527 std::chrono::seconds interrupt_timeout);
528
529 bool GetSaveCoreSupported() const;
530
531 llvm::Expected<int> KillProcess(lldb::pid_t pid);
532
533protected:
574 std::optional<xPacketState> m_x_packet_state;
577
588
589 /// Current gdb remote protocol process identifier for all other operations
591 /// Current gdb remote protocol process identifier for continue, step, etc
593 /// Current gdb remote protocol thread identifier for all other operations
595 /// Current gdb remote protocol thread identifier for continue, step, etc
597
599 WatchpointHardwareFeature m_watchpoint_types =
600 eWatchpointHardwareFeatureUnknown;
603
610 std::vector<lldb::addr_t> m_binary_addresses;
611 llvm::VersionTuple m_os_version;
612 llvm::VersionTuple m_maccatalyst_version;
613 std::string m_os_build;
614 std::string m_os_kernel;
615 std::string m_hostname;
616 std::string m_gdb_server_name; // from reply to qGDBServerVersion, empty if
617 // qGDBServerVersion is not supported
619 UINT32_MAX; // from reply to qGDBServerVersion, zero if
620 // qGDBServerVersion is not supported
621 std::chrono::seconds m_default_packet_timeout;
622 int m_target_vm_page_size = 0; // target system VM page size; 0 unspecified
623 uint64_t m_max_packet_size = 0; // as returned by qSupported
624 std::string m_qSupported_response; // the complete response to qSupported
625
628
629 std::vector<MemoryRegionInfo> m_qXfer_memory_map;
631
632 bool GetCurrentProcessInfo(bool allow_lazy_pid = true);
633
634 bool GetGDBServerVersion();
635
636 // Given the list of compression types that the remote debug stub can support,
637 // possibly enable compression if we find an encoding we can handle.
639 llvm::ArrayRef<llvm::StringRef> supported_compressions);
640
642 ProcessInstanceInfo &process_info);
643
644 void OnRunPacketSent(bool first) override;
645
647 lldb::tid_t tid, StreamString &&payload,
648 StringExtractorGDBRemote &response);
649
651 lldb::tid_t thread_id,
652 llvm::MutableArrayRef<uint8_t> &buffer,
653 size_t offset);
654
656
658 MemoryRegionInfo &region);
659
660 LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr);
661
662private:
666};
667
668} // namespace process_gdb_remote
669} // namespace lldb_private
670
671#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:31
A command line argument class.
Definition Args.h:33
"lldb/Utility/ArgCompletionRequest.h"
A file utility class.
Definition FileSpec.h:57
A plug-in interface definition class for debugging a process.
Definition Process.h:357
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 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)
Status RunShellCommand(llvm::StringRef command, const FileSpec &working_dir, int *status_ptr, int *signo_ptr, std::string *command_output, const Timeout< std::micro > &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)
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)
bool SetCurrentThread(uint64_t tid, lldb::pid_t pid=LLDB_INVALID_PROCESS_ID)
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)
int SendStdinNotification(const char *data, size_t data_len)
Sends a GDB remote protocol 'I' packet that delivers stdin data to the remote process.
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)
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:83
uint64_t user_id_t
Definition lldb-types.h:82
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
uint64_t addr_t
Definition lldb-types.h:80
uint64_t tid_t
Definition lldb-types.h:84
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.