38#include "lldb/Host/Config.h"
41#include "llvm/ADT/STLExtras.h"
42#include "llvm/ADT/StringSwitch.h"
43#include "llvm/Config/llvm-config.h"
44#include "llvm/Support/ErrorExtras.h"
45#include "llvm/Support/JSON.h"
46#include "llvm/TargetParser/Triple.h"
48#if HAVE_LIBCOMPRESSION
49#include <compression.h>
55using namespace std::chrono;
59 return os << llvm::formatv(
60 "QOffsets({0}, [{1:@[x]}])", offsets.
segments,
95 std::chrono::steady_clock::time_point start_of_handshake =
96 std::chrono::steady_clock::now();
105 std::chrono::steady_clock::time_point end_of_handshake =
106 std::chrono::steady_clock::now();
107 auto handshake_timeout =
108 std::chrono::duration<double>(end_of_handshake - start_of_handshake)
114 "while waiting for reply to initial "
118 "failed to get reply to handshake packet within timeout of "
242llvm::Expected<std::vector<AcceleratorActions>>
250 return std::vector<AcceleratorActions>();
256 return llvm::createStringError(
257 "failed to send jAcceleratorPluginInitialize packet");
260 return std::vector<AcceleratorActions>();
265 llvm::Expected<std::vector<AcceleratorActions>> actions =
266 llvm::json::parse<std::vector<AcceleratorActions>>(response.
Peek(),
267 "AcceleratorActions");
274 return llvm::createStringErrorV(
275 "malformed jAcceleratorPluginInitialize response '{0}': {1}",
276 response.
GetStringRef(), llvm::toString(actions.takeError()));
300 llvm::Expected<LLDBSettings> settings =
301 llvm::json::parse<LLDBSettings>(response.
Peek(),
"LLDBSettings");
305 "malformed jLLDBSettings response '{1}': {0}",
314llvm::Expected<AcceleratorBreakpointHitResponse>
318 packet.
PutCString(
"jAcceleratorPluginBreakpointHit:");
324 return llvm::createStringError(
325 "failed to send jAcceleratorPluginBreakpointHit packet");
330 llvm::Expected<AcceleratorBreakpointHitResponse> hit_response =
331 llvm::json::parse<AcceleratorBreakpointHitResponse>(
332 response.
Peek(),
"AcceleratorBreakpointHitResponse");
339 return llvm::createStringErrorV(
340 "malformed jAcceleratorPluginBreakpointHit response '{0}': {1}",
341 response.
GetStringRef(), llvm::toString(hit_response.takeError()));
344std::optional<AcceleratorDynamicLoaderResponse>
348 packet.
PutCString(
"jAcceleratorPluginGetDynamicLoaderLibraryInfo:");
358 llvm::Expected<AcceleratorDynamicLoaderResponse> parsed =
359 llvm::json::parse<AcceleratorDynamicLoaderResponse>(
360 response.
Peek(),
"AcceleratorDynamicLoaderResponse");
362 llvm::consumeError(parsed.takeError());
540 std::vector<std::string> features = {
"xmlRegisters=i386,arm,mips,arc",
546 "qXfer:libraries:read+",
547 "qXfer:libraries-svr4:read+"};
550 for (uint32_t i = 0; i < features.size(); ++i) {
562 for (llvm::StringRef x : llvm::split(response.
GetStringRef(),
';')) {
563 if (x ==
"qXfer:auxv:read+")
565 else if (x ==
"qXfer:libraries-svr4:read+")
567 else if (x ==
"augmented-libraries-svr4-read") {
570 }
else if (x ==
"qXfer:libraries:read+")
572 else if (x ==
"qXfer:features:read+")
574 else if (x ==
"qXfer:memory-map:read+")
576 else if (x ==
"qXfer:siginfo:read+")
578 else if (x ==
"qEcho+")
580 else if (x ==
"QPassSignals+")
582 else if (x ==
"multiprocess+")
584 else if (x ==
"memory-tagging+")
586 else if (x ==
"qSaveCore+")
588 else if (x ==
"address-spaces+")
590 else if (x ==
"native-signals+")
592 else if (x ==
"binary-upload+")
594 else if (x ==
"ReverseContinue+")
596 else if (x ==
"ReverseStep+")
598 else if (x ==
"MultiMemRead+")
600 else if (x ==
"jMultiBreakpoint+")
602 else if (x ==
"accelerator-plugins+")
604 else if (x ==
"lldb-settings+")
606 else if (x ==
"qWasmInstance+")
611 else if (x.consume_front(
"SupportedCompressions=")) {
612 llvm::SmallVector<llvm::StringRef, 4> compressions;
613 x.split(compressions,
',');
614 if (!compressions.empty())
616 }
else if (x.consume_front(
"SupportedWatchpointTypes=")) {
617 llvm::SmallVector<llvm::StringRef, 4> watchpoint_types;
618 x.split(watchpoint_types,
',');
620 for (
auto wp_type : watchpoint_types) {
621 if (wp_type ==
"x86_64")
623 if (wp_type ==
"aarch64-mask")
625 if (wp_type ==
"aarch64-bas")
628 }
else if (x.consume_front(
"PacketSize=")) {
635 LLDB_LOGF(log,
"Garbled PacketSize spec in qSupported response");
656 assert(!flavor.empty());
667 for (llvm::StringRef token : llvm::split(response.
GetStringRef(),
';')) {
694 return llvm::StringSwitch<bool>(flavor)
712 "GDBRemoteCommunicationClient::%s: Didn't get sequence mutex "
714 __FUNCTION__, payload.GetData());
719 payload.Printf(
";thread:%4.4" PRIx64
";", tid);
766 }
else if (!response.
Empty()) {
855 packet.
Printf(
"qMemTags:%" PRIx64
",%zx:%" PRIx32, addr, len, type);
863 LLDB_LOGF(log,
"GDBRemoteCommunicationClient::%s: qMemTags packet failed",
871 if (response.
GetChar() !=
'm') {
873 "GDBRemoteCommunicationClient::%s: qMemTags response did not "
884 if (response.
GetBytesLeft() || (expected_bytes != got_bytes)) {
887 "GDBRemoteCommunicationClient::%s: Invalid data in qMemTags response",
897 const std::vector<uint8_t> &tags) {
900 packet.
Printf(
"QMemTags:%" PRIx64
",%zx:%" PRIx32
":", addr, len, type);
946 if (response.
GetChar() ==
'Q') {
947 if (response.
GetChar() ==
'C') {
961 bool sequence_mutex_unavailable;
963 if (!ids.empty() && !sequence_mutex_unavailable) {
978llvm::Expected<StringExtractorGDBRemote>
981 return llvm::createStringError(llvm::inconvertibleErrorCode(),
982 "Nothing to launch");
997 return llvm::createStringError(llvm::inconvertibleErrorCode(),
998 "Sending vRun packet failed");
1012 llvm::ListSeparator LS(
",");
1013 for (
const auto &arg : llvm::enumerate(args)) {
1015 packet.
Format(
"{0},{1},", arg.value().ref().size() * 2, arg.index());
1021 return llvm::createStringError(llvm::inconvertibleErrorCode(),
1022 "Sending A packet failed");
1029 return llvm::createStringError(llvm::inconvertibleErrorCode(),
1030 "Sending qLaunchSuccess packet failed");
1034 if (response.
GetChar() ==
'E') {
1035 return llvm::createStringError(llvm::inconvertibleErrorCode(),
1038 return llvm::createStringError(llvm::inconvertibleErrorCode(),
1039 "unknown error occurred launching process");
1043 llvm::SmallVector<std::pair<llvm::StringRef, llvm::StringRef>, 0> vec;
1044 for (
const auto &kv : env)
1045 vec.emplace_back(kv.first(), kv.second);
1046 llvm::sort(vec, llvm::less_first());
1047 for (
const auto &[k, v] : vec) {
1056 char const *name_equal_value) {
1057 if (name_equal_value && name_equal_value[0]) {
1058 bool send_hex_encoding =
false;
1059 for (
const char *p = name_equal_value; *p !=
'\0' && !send_hex_encoding;
1061 if (llvm::isPrint(*p)) {
1067 send_hex_encoding =
true;
1074 send_hex_encoding =
true;
1082 packet.
Printf(
"QEnvironment:%s", name_equal_value);
1101 packet.
PutCString(
"QEnvironmentHexEncoded:");
1123 if (arch && arch[0]) {
1125 packet.
Printf(
"QLaunchArch:%s", arch);
1140 char const *data,
bool *was_supported) {
1141 if (data && *data !=
'\0') {
1143 packet.
Printf(
"QSetProcessEvent:%s", data);
1149 *was_supported =
true;
1153 *was_supported =
false;
1158 *was_supported =
true;
1182 return std::nullopt;
1185std::optional<std::string>
1191 return std::nullopt;
1219 UUID &uuid,
addr_t &value,
bool &value_is_offset) {
1257 llvm::Expected<std::vector<AddressSpaceInfo>> info =
1258 llvm::json::parse<std::vector<AddressSpaceInfo>>(response.
Peek(),
1259 "AddressSpaceInfo");
1261 return std::move(*info);
1265 "malformed jAddressSpacesInfo response '{1}': {0}",
1280 llvm::StringRef name, value;
1281 bool success =
false;
1283 if (name ==
"name") {
1286 }
else if (name ==
"version") {
1287 llvm::StringRef major, minor;
1288 std::tie(major, minor) = value.split(
'.');
1302 llvm::ArrayRef<llvm::StringRef> supported_compressions) {
1304 llvm::StringRef avail_name;
1306#if HAVE_LIBCOMPRESSION
1308 for (
auto compression : supported_compressions) {
1309 if (compression ==
"lzfse") {
1311 avail_name = compression;
1317 for (
auto compression : supported_compressions) {
1318 if (compression ==
"zlib-deflate") {
1320 avail_name = compression;
1329 for (
auto compression : supported_compressions) {
1330 if (compression ==
"zlib-deflate") {
1332 avail_name = compression;
1339#if HAVE_LIBCOMPRESSION
1341 for (
auto compression : supported_compressions) {
1342 if (compression ==
"lz4") {
1344 avail_name = compression;
1350 for (
auto compression : supported_compressions) {
1351 if (compression ==
"lzma") {
1353 avail_name = compression;
1362 std::string packet =
"QEnableCompression:type:" + avail_name.str() +
";";
1409 tid = pid_tid->second;
1416 std::string &environment) {
1417 if (value ==
"iossimulator" || value ==
"tvossimulator" ||
1418 value ==
"watchossimulator" || value ==
"xrossimulator" ||
1419 value ==
"visionossimulator") {
1420 environment =
"simulator";
1421 os_name = value.drop_back(environment.size()).str();
1422 }
else if (value ==
"maccatalyst") {
1424 environment =
"macabi";
1426 os_name = value.str();
1442 llvm::StringRef name;
1443 llvm::StringRef value;
1446 std::string arch_name;
1447 std::string os_name;
1448 std::string environment;
1449 std::string vendor_name;
1451 uint32_t pointer_byte_size = 0;
1453 uint32_t num_keys_decoded = 0;
1455 if (name ==
"cputype") {
1457 if (!value.getAsInteger(
BASE_10, cpu))
1459 }
else if (name ==
"cpusubtype") {
1461 if (!value.getAsInteger(
BASE_10, sub))
1463 }
else if (name ==
"arch") {
1464 arch_name = std::string(value);
1466 }
else if (name ==
"triple") {
1470 }
else if (name ==
"distribution_id") {
1474 }
else if (name ==
"os_build") {
1478 }
else if (name ==
"hostname") {
1482 }
else if (name ==
"os_kernel") {
1486 }
else if (name ==
"ostype") {
1489 }
else if (name ==
"vendor") {
1490 vendor_name = std::string(value);
1492 }
else if (name ==
"endian") {
1493 byte_order = llvm::StringSwitch<lldb::ByteOrder>(value)
1500 }
else if (name ==
"ptrsize") {
1501 if (!value.getAsInteger(
BASE_10, pointer_byte_size))
1503 }
else if (name ==
"addressing_bits") {
1507 }
else if (name ==
"high_mem_addressing_bits") {
1510 }
else if (name ==
"low_mem_addressing_bits") {
1513 }
else if (name ==
"os_version" ||
1520 }
else if (name ==
"maccatalyst_version") {
1523 }
else if (name ==
"watchpoint_exceptions_received") {
1525 llvm::StringSwitch<LazyBool>(value)
1531 }
else if (name ==
"default_packet_timeout") {
1532 uint32_t timeout_seconds;
1533 if (!value.getAsInteger(
BASE_10, timeout_seconds)) {
1538 }
else if (name ==
"vm-page-size") {
1540 if (!value.getAsInteger(
BASE_10, page_size)) {
1547 if (num_keys_decoded > 0)
1550 if (triple.empty()) {
1551 if (arch_name.empty()) {
1554 if (pointer_byte_size) {
1555 assert(pointer_byte_size ==
m_host_arch.GetAddressByteSize());
1561 if (!vendor_name.empty())
1563 llvm::StringRef(vendor_name));
1564 if (!os_name.empty())
1565 m_host_arch.GetTriple().setOSName(llvm::StringRef(os_name));
1566 if (!environment.empty())
1567 m_host_arch.GetTriple().setEnvironmentName(environment);
1571 triple += arch_name;
1572 if (!vendor_name.empty() || !os_name.empty()) {
1574 if (vendor_name.empty())
1575 triple +=
"unknown";
1577 triple += vendor_name;
1579 if (os_name.empty())
1580 triple +=
"unknown";
1586 llvm::Triple &host_triple =
m_host_arch.GetTriple();
1587 if (host_triple.getVendor() == llvm::Triple::Apple &&
1588 host_triple.getOS() == llvm::Triple::Darwin) {
1590 case llvm::Triple::aarch64:
1591 case llvm::Triple::aarch64_32:
1592 case llvm::Triple::arm:
1593 case llvm::Triple::thumb:
1594 host_triple.setOS(llvm::Triple::IOS);
1597 host_triple.setOS(llvm::Triple::MacOSX);
1601 if (pointer_byte_size) {
1602 assert(pointer_byte_size ==
m_host_arch.GetAddressByteSize());
1610 if (pointer_byte_size) {
1611 assert(pointer_byte_size ==
m_host_arch.GetAddressByteSize());
1618 "GDBRemoteCommunicationClient::%s parsed host "
1619 "architecture as %s, triple as %s from triple text %s",
1623 :
"<null-arch-name>",
1634 const char *data,
size_t data_len, std::chrono::seconds interrupt_timeout) {
1640 interrupt_timeout) ==
1664 return addressable_bits;
1674 uint32_t permissions) {
1678 const int packet_len = ::snprintf(
1679 packet,
sizeof(packet),
"_M%" PRIx64
",%s%s%s", (uint64_t)size,
1680 permissions & lldb::ePermissionsReadable ?
"r" :
"",
1681 permissions & lldb::ePermissionsWritable ?
"w" :
"",
1682 permissions & lldb::ePermissionsExecutable ?
"x" :
"");
1683 assert(packet_len < (
int)
sizeof(packet));
1703 const int packet_len =
1704 ::snprintf(packet,
sizeof(packet),
"_m%" PRIx64, (uint64_t)addr);
1705 assert(packet_len < (
int)
sizeof(packet));
1730 const int packet_len =
1731 ::snprintf(packet,
sizeof(packet),
"qSupportsDetachAndStayStopped:");
1732 assert(packet_len < (
int)
sizeof(packet));
1746 "Stays stopped not supported by this target.");
1762 "Multiprocess extension not supported by the server.");
1777 region_info.
Clear();
1782 const int packet_len = ::snprintf(
1783 packet,
sizeof(packet),
"qMemoryRegionInfo:%" PRIx64, (uint64_t)addr);
1784 assert(packet_len < (
int)
sizeof(packet));
1790 llvm::StringRef name;
1791 llvm::StringRef value;
1793 bool success =
true;
1794 bool saw_permissions =
false;
1796 if (name ==
"start") {
1797 if (!value.getAsInteger(
BASE_16, addr_value))
1799 }
else if (name ==
"size") {
1800 if (!value.getAsInteger(
BASE_16, addr_value)) {
1808 }
else if (name ==
"permissions" && region_info.
GetRange().
IsValid()) {
1809 saw_permissions =
true;
1811 if (value.contains(
'r'))
1816 if (value.contains(
'w'))
1821 if (value.contains(
'x'))
1835 }
else if (name ==
"name") {
1839 region_info.
SetName(name.c_str());
1840 }
else if (name ==
"flags") {
1844 llvm::StringRef flags = value;
1845 llvm::StringRef flag;
1846 while (flags.size()) {
1847 flags = flags.ltrim();
1848 std::tie(flag, flags) = flags.split(
' ');
1853 else if (flag ==
"ss")
1857 }
else if (name ==
"type") {
1858 for (llvm::StringRef entry : llvm::split(value,
',')) {
1859 if (entry ==
"stack")
1861 else if (entry ==
"heap")
1864 }
else if (name ==
"error") {
1866 std::string error_string;
1870 }
else if (name ==
"dirty-pages") {
1871 std::vector<addr_t> dirty_page_list;
1872 for (llvm::StringRef x : llvm::split(value,
',')) {
1874 x.consume_front(
"0x");
1875 if (llvm::to_integer(x, page, 16))
1876 dirty_page_list.push_back(page);
1879 }
else if (name ==
"protection-key") {
1880 unsigned protection_key = 0;
1881 if (!value.getAsInteger(
BASE_10, protection_key))
1892 if (!saw_permissions) {
1920 region_info = qXfer_region_info;
1923 region_info.
Clear();
1925 }
else if (qXfer_error.
Success()) {
1940 if (!
error.Success())
1943 if (map_region.GetRange().Contains(addr)) {
1944 region = map_region;
1970 llvm::Expected<std::string> xml =
ReadExtFeature(
"memory-map",
"");
1976 if (!xml_document.
ParseMemory(xml->c_str(), xml->size())) {
1992 if (memory_node.
GetName() !=
"memory")
2004 if (type ==
"rom") {
2007 }
else if (type ==
"ram") {
2011 }
else if (type ==
"flash") {
2014 [®ion](
const XMLNode &prop_node) ->
bool {
2017 if (prop_node.
GetName() !=
"property")
2020 if (propname ==
"blocksize") {
2042 std::optional<uint32_t> num;
2048 llvm::StringRef name;
2049 llvm::StringRef value;
2051 if (name ==
"num") {
2067WatchpointHardwareFeature
2086 return std::nullopt;
2091 std::string path{file_spec.
GetPath(
false)};
2111 std::string path{file_spec.
GetPath(
false)};
2131 std::string path{file_spec.
GetPath(
false)};
2152 if ((cols == 0) != (rows == 0))
2155 packet.
Printf(
"QSetSTDIOWindowSize:cols=%u;rows=%u",
2156 static_cast<unsigned>(cols),
static_cast<unsigned>(rows));
2180 return !cwd.empty();
2187 std::string path{working_dir.
GetPath(
false)};
2207 const int packet_len =
2208 ::snprintf(packet,
sizeof(packet),
"QSetDisableASLR:%i", enable ? 1 : 0);
2209 assert(packet_len < (
int)
sizeof(packet));
2224 const int packet_len = ::snprintf(packet,
sizeof(packet),
2225 "QSetDetachOnError:%i", enable ? 1 : 0);
2226 assert(packet_len < (
int)
sizeof(packet));
2242 llvm::StringRef name;
2243 llvm::StringRef value;
2249 std::string os_type;
2252 if (name ==
"pid") {
2254 value.getAsInteger(
BASE_10, pid);
2256 }
else if (name ==
"ppid") {
2258 value.getAsInteger(
BASE_10, pid);
2260 }
else if (name ==
"uid") {
2262 value.getAsInteger(
BASE_10, uid);
2264 }
else if (name ==
"euid") {
2266 value.getAsInteger(
BASE_10, uid);
2268 }
else if (name ==
"gid") {
2270 value.getAsInteger(
BASE_10, gid);
2272 }
else if (name ==
"egid") {
2274 value.getAsInteger(
BASE_10, gid);
2276 }
else if (name ==
"triple") {
2281 }
else if (name ==
"name") {
2288 }
else if (name ==
"args") {
2289 llvm::StringRef encoded_args(value), hex_arg;
2291 bool is_arg0 =
true;
2292 while (!encoded_args.empty()) {
2293 std::tie(hex_arg, encoded_args) = encoded_args.split(
'-');
2308 }
else if (name ==
"cputype") {
2309 value.getAsInteger(
BASE_10, cpu);
2310 }
else if (name ==
"cpusubtype") {
2311 value.getAsInteger(
BASE_10, sub);
2312 }
else if (name ==
"vendor") {
2313 vendor = std::string(value);
2314 }
else if (name ==
"ostype") {
2315 os_type = std::string(value);
2320 if (vendor ==
"apple") {
2324 llvm::StringRef(vendor));
2326 llvm::StringRef(os_type));
2338 process_info.
Clear();
2342 const int packet_len =
2343 ::snprintf(packet,
sizeof(packet),
"qProcessInfoPID:%" PRIu64, pid);
2344 assert(packet_len < (
int)
sizeof(packet));
2374 llvm::StringRef name;
2375 llvm::StringRef value;
2378 std::string os_name;
2379 std::string environment;
2380 std::string vendor_name;
2382 std::string elf_abi;
2383 uint32_t pointer_byte_size = 0;
2386 uint32_t num_keys_decoded = 0;
2389 if (name ==
"cputype") {
2390 if (!value.getAsInteger(
BASE_16, cpu))
2392 }
else if (name ==
"cpusubtype") {
2393 if (!value.getAsInteger(
BASE_16, sub)) {
2399 if (cpu == llvm::MachO::CPU_TYPE_ARM64 &&
2400 sub == llvm::MachO::CPU_SUBTYPE_ARM64E) {
2407 }
else if (name ==
"triple") {
2411 }
else if (name ==
"ostype") {
2414 }
else if (name ==
"vendor") {
2415 vendor_name = std::string(value);
2417 }
else if (name ==
"endian") {
2418 byte_order = llvm::StringSwitch<lldb::ByteOrder>(value)
2425 }
else if (name ==
"ptrsize") {
2426 if (!value.getAsInteger(
BASE_16, pointer_byte_size))
2428 }
else if (name ==
"pid") {
2429 if (!value.getAsInteger(
BASE_16, pid))
2431 }
else if (name ==
"elf_abi") {
2432 elf_abi = std::string(value);
2434 }
else if (name ==
"main-binary-uuid") {
2437 }
else if (name ==
"main-binary-slide") {
2445 }
else if (name ==
"main-binary-address") {
2453 }
else if (name ==
"binary-addresses") {
2456 for (llvm::StringRef x : llvm::split(value,
',')) {
2458 x.consume_front(
"0x");
2459 if (llvm::to_integer(x, vmaddr, 16))
2464 if (num_keys_decoded > 0)
2472 if (!triple.empty()) {
2475 if (pointer_byte_size) {
2476 assert(pointer_byte_size ==
m_process_arch.GetAddressByteSize());
2479 !vendor_name.empty()) {
2480 llvm::Triple triple(llvm::Twine(
"-") + vendor_name +
"-" + os_name);
2481 if (!environment.empty())
2482 triple.setEnvironmentName(environment);
2484 assert(triple.getObjectFormat() != llvm::Triple::UnknownObjectFormat);
2485 assert(triple.getObjectFormat() != llvm::Triple::Wasm);
2486 assert(triple.getObjectFormat() != llvm::Triple::XCOFF);
2487 switch (triple.getObjectFormat()) {
2488 case llvm::Triple::MachO:
2491 case llvm::Triple::ELF:
2494 case llvm::Triple::COFF:
2497 case llvm::Triple::GOFF:
2498 case llvm::Triple::SPIRV:
2499 case llvm::Triple::Wasm:
2500 case llvm::Triple::XCOFF:
2501 case llvm::Triple::DXContainer:
2502 LLDB_LOGF(log,
"error: not supported target architecture");
2504 case llvm::Triple::UnknownObjectFormat:
2505 LLDB_LOGF(log,
"error: failed to determine target architecture");
2509 if (pointer_byte_size) {
2510 assert(pointer_byte_size ==
m_process_arch.GetAddressByteSize());
2515 m_process_arch.GetTriple().setVendorName(llvm::StringRef(vendor_name));
2517 m_process_arch.GetTriple().setEnvironmentName(llvm::StringRef(environment));
2531 process_infos.clear();
2539 bool has_name_match =
false;
2540 if (!name.empty()) {
2541 has_name_match =
true;
2543 switch (name_match_type) {
2545 has_name_match =
false;
2557 packet.
PutCString(
"name_match:starts_with;");
2568 if (has_name_match) {
2576 packet.
Printf(
"pid:%" PRIu64
";",
2579 packet.
Printf(
"parent_pid:%" PRIu64
";",
2586 packet.
Printf(
"euid:%u;",
2589 packet.
Printf(
"egid:%u;",
2595 const llvm::Triple &triple = match_arch.
GetTriple();
2611 process_infos.push_back(process_info);
2620 return process_infos.size();
2624 std::string &name) {
2627 const int packet_len =
2628 ::snprintf(packet,
sizeof(packet),
"qUserName:%i", uid);
2629 assert(packet_len < (
int)
sizeof(packet));
2651 std::string &name) {
2654 const int packet_len =
2655 ::snprintf(packet,
sizeof(packet),
"qGroupName:%i", gid);
2656 assert(packet_len < (
int)
sizeof(packet));
2678 uint32_t recv_size) {
2680 packet.
Printf(
"qSpeedTest:response_size:%x;data:", recv_size);
2681 uint32_t bytes_left = send_size;
2682 while (bytes_left > 0) {
2683 if (bytes_left >= 26) {
2684 packet.
PutCString(
"abcdefghijklmnopqrstuvwxyz");
2687 packet.
Printf(
"%*.*s;", bytes_left, bytes_left,
2688 "abcdefghijklmnopqrstuvwxyz");
2697 return duration<float>::zero();
2698 using Dur = duration<float>;
2699 Dur sum = std::accumulate(std::begin(v), std::end(v), Dur());
2700 Dur mean = sum / v.size();
2703 float delta = (d - mean).count();
2704 accum += delta * delta;
2707 return Dur(sqrtf(accum / (v.size() - 1)));
2713 uint64_t recv_amount,
2714 bool json,
Stream &strm) {
2719 strm.
Printf(
"{ \"packet_speeds\" : {\n \"num_packets\" : %u,\n "
2723 strm.
Printf(
"Testing sending %u packets of various sizes:\n",
2727 uint32_t result_idx = 0;
2729 std::vector<duration<float>> packet_times;
2731 for (send_size = 0; send_size <= max_send;
2732 send_size ? send_size *= 2 : send_size = 4) {
2733 for (uint32_t recv_size = 0; recv_size <= max_recv;
2734 recv_size ? recv_size *= 2 : recv_size = 4) {
2737 packet_times.clear();
2739 const auto start_time = steady_clock::now();
2740 for (uint32_t i = 0; i < num_packets; ++i) {
2741 const auto packet_start_time = steady_clock::now();
2744 const auto packet_end_time = steady_clock::now();
2745 packet_times.push_back(packet_end_time - packet_start_time);
2747 const auto end_time = steady_clock::now();
2748 const auto total_time = end_time - start_time;
2750 float packets_per_second =
2751 ((float)num_packets) / duration<float>(total_time).count();
2752 auto average_per_packet = num_packets > 0 ? total_time / num_packets
2753 : duration<float>::zero();
2754 const duration<float> standard_deviation =
2757 strm.
Format(
"{0}\n {{\"send_size\" : {1,6}, \"recv_size\" : "
2758 "{2,6}, \"total_time_nsec\" : {3,12:ns-}, "
2759 "\"standard_deviation_nsec\" : {4,9:ns-f0}}",
2760 result_idx > 0 ?
"," :
"", send_size, recv_size,
2761 total_time, standard_deviation);
2764 strm.
Format(
"qSpeedTest(send={0,7}, recv={1,7}) in {2:s+f9} for "
2765 "{3,9:f2} packets/s ({4,10:ms+f6} per packet) with "
2766 "standard deviation of {5,10:ms+f6}\n",
2767 send_size, recv_size, duration<float>(total_time),
2768 packets_per_second, duration<float>(average_per_packet),
2769 standard_deviation);
2775 const float k_recv_amount_mb = (float)recv_amount / (1024.0f * 1024.0f);
2777 strm.
Printf(
"\n ]\n },\n \"download_speed\" : {\n \"byte_size\" "
2778 ": %" PRIu64
",\n \"results\" : [",
2781 strm.
Printf(
"Testing receiving %2.1fMB of data using varying receive "
2787 for (uint32_t recv_size = 32; recv_size <= max_recv; recv_size *= 2) {
2792 if (recv_size > 0) {
2793 const auto start_time = steady_clock::now();
2794 uint32_t bytes_read = 0;
2795 uint32_t packet_count = 0;
2796 while (bytes_read < recv_amount) {
2799 bytes_read += recv_size;
2802 const auto end_time = steady_clock::now();
2803 const auto total_time = end_time - start_time;
2804 float mb_second = ((float)recv_amount) /
2805 duration<float>(total_time).count() /
2807 float packets_per_second =
2808 ((float)packet_count) / duration<float>(total_time).count();
2809 const auto average_per_packet = packet_count > 0
2810 ? total_time / packet_count
2811 : duration<float>::zero();
2814 strm.
Format(
"{0}\n {{\"send_size\" : {1,6}, \"recv_size\" : "
2815 "{2,6}, \"total_time_nsec\" : {3,12:ns-}}",
2816 result_idx > 0 ?
"," :
"", send_size, recv_size,
2820 strm.
Format(
"qSpeedTest(send={0,7}, recv={1,7}) {2,6} packets needed "
2821 "to receive {3:f1}MB in {4:s+f9} for {5} MB/sec for "
2822 "{6,9:f2} packets/sec ({7,10:ms+f6} per packet)\n",
2823 send_size, recv_size, packet_count, k_recv_amount_mb,
2824 duration<float>(total_time), mb_second,
2825 packets_per_second, duration<float>(average_per_packet));
2831 strm.
Printf(
"\n ]\n }\n}\n");
2838 uint32_t recv_size) {
2848 const char *remote_accept_hostname,
lldb::pid_t &pid, uint16_t &port,
2849 std::string &socket_name) {
2852 socket_name.clear();
2857 std::string hostname;
2858 if (remote_accept_hostname && remote_accept_hostname[0])
2859 hostname = remote_accept_hostname;
2861 if (HostInfo::GetHostname(hostname)) {
2863 stream.
Printf(
"host:%s;", hostname.c_str());
2867 stream.
Printf(
"host:*;");
2878 llvm::StringRef name;
2879 llvm::StringRef value;
2882 value.getAsInteger(
BASE_10, port);
2883 else if (name ==
"pid")
2884 value.getAsInteger(
BASE_10, pid);
2885 else if (name.compare(
"socket_name") == 0) {
2896 std::vector<std::pair<uint16_t, std::string>> &connection_urls) {
2897 connection_urls.clear();
2913 for (
size_t i = 0, count = array->
GetSize(); i < count; ++i) {
2914 std::optional<StructuredData::Dictionary *> maybe_element =
2923 port = port_osp->GetUnsignedIntegerValue(0);
2925 std::string socket_name;
2928 socket_name = std::string(socket_name_osp->GetStringValue());
2930 if (port != 0 || !socket_name.empty())
2931 connection_urls.emplace_back(port, socket_name);
2933 return connection_urls.size();
2938 stream.
Printf(
"qKillSpawnedProcess:%" PRId64, pid);
2950 uint64_t tid, uint64_t pid,
char op) {
2956 packet.
Printf(
"p%" PRIx64
".", pid);
2961 packet.
Printf(
"%" PRIx64, tid);
2967 return {{pid, tid}};
2979 return std::nullopt;
2994 return ret.has_value();
3009 return ret.has_value();
3024 ::snprintf(packet,
sizeof(packet),
"qThreadStopInfo%" PRIx64, tid);
3025 assert(packet_len < (
int)
sizeof(packet));
3044 std::chrono::seconds timeout) {
3046 LLDB_LOGF(log,
"GDBRemoteCommunicationClient::%s() %s at addr = 0x%" PRIx64,
3047 __FUNCTION__, insert ?
"add" :
"remove", addr);
3054 const int packet_len =
3055 ::snprintf(packet,
sizeof(packet),
"%c%i,%" PRIx64
",%x",
3056 insert ?
'Z' :
'z', type, addr, length);
3058 assert(packet_len + 1 < (
int)
sizeof(packet));
3103std::vector<std::pair<lldb::pid_t, lldb::tid_t>>
3105 bool &sequence_mutex_unavailable) {
3106 std::vector<std::pair<lldb::pid_t, lldb::tid_t>> ids;
3110 sequence_mutex_unavailable =
false;
3114 for (packet_result =
3132 ids.push_back(*pid_tid);
3134 }
while (ch ==
',');
3148 ids.emplace_back(1, 1);
3152 LLDB_LOG(log,
"error: failed to get packet sequence mutex, not sending "
3153 "packet 'qfThreadInfo'");
3154 sequence_mutex_unavailable =
true;
3161 std::vector<lldb::tid_t> &thread_ids,
bool &sequence_mutex_unavailable) {
3166 if (ids.empty() || sequence_mutex_unavailable)
3169 for (
auto id : ids) {
3175 thread_ids.push_back(
id.second);
3178 return thread_ids.size();
3191 llvm::StringRef command,
3199 std::string *separated_error_output,
3209 timeout_sec = std::ceil(std::chrono::duration<double>(*timeout).count());
3213 std::string path{working_dir.
GetPath(
false)};
3220 if (response.
GetChar() !=
'F')
3222 if (response.
GetChar() !=
',')
3227 else if (status_ptr)
3228 *status_ptr = exitcode;
3229 if (response.
GetChar() !=
',')
3234 if (response.
GetChar() !=
',')
3239 command_output->assign(output);
3246 uint32_t file_permissions) {
3247 std::string path{file_spec.
GetPath(
false)};
3253 llvm::StringRef packet = stream.
GetString();
3258 packet.str().c_str());
3260 if (response.
GetChar() !=
'F')
3262 packet.str().c_str());
3269 uint32_t file_permissions) {
3270 std::string path{file_spec.
GetPath(
false)};
3276 llvm::StringRef packet = stream.
GetString();
3283 if (response.
GetChar() !=
'F')
3292#define HANDLE_ERRNO(name, value) \
3295#include "Plugins/Process/gdb-remote/GDBRemoteErrno.def"
3304 if (response.
GetChar() !=
'F')
3306 int32_t result = response.
GetS32(-2, 16);
3309 if (response.
GetChar() ==
',') {
3311 if (result_errno != -1)
3323 std::string path(file_spec.
GetPath(
false));
3344 stream.
Printf(
"vFile:close:%x", (
int)fd);
3353std::optional<GDBRemoteFStatData>
3356 stream.
Printf(
"vFile:fstat:%" PRIx64, fd);
3360 if (response.
GetChar() !=
'F')
3361 return std::nullopt;
3362 int64_t size = response.
GetS64(-1, 16);
3363 if (size > 0 && response.
GetChar() ==
';') {
3367 if (buffer.size() !=
sizeof(out))
3368 return std::nullopt;
3369 memcpy(&out, buffer.data(),
sizeof(out));
3374 return std::nullopt;
3377std::optional<GDBRemoteFStatData>
3382 return std::nullopt;
3383 std::optional<GDBRemoteFStatData> st =
FStat(fd);
3392 std::string path(file_spec.
GetPath(
false));
3402 if (response.
GetChar() !=
'F')
3411 std::optional<GDBRemoteFStatData> st =
Stat(file_spec);
3429 while (response.
Peek()) {
3431 while ((ch = response.
GetHexU8(0,
false)) !=
'\0')
3434 if (response.
GetChar() !=
',')
3442 uint32_t &file_permissions) {
3444 std::string path{file_spec.
GetPath(
false)};
3457 if (response.
GetChar() !=
'F') {
3459 "invalid response to '%s' packet", stream.
GetData());
3461 const uint32_t mode = response.
GetS32(-1, 16);
3462 if (
static_cast<int32_t
>(mode) == -1) {
3463 if (response.
GetChar() ==
',') {
3465 if (response_errno > 0)
3482 if (std::optional<GDBRemoteFStatData> st =
Stat(file_spec)) {
3490 uint64_t offset,
void *dst,
3494 stream.
Printf(
"vFile:pread:%x,%" PRIx64
",%" PRIx64, (
int)fd, dst_len,
3499 if (response.
GetChar() !=
'F')
3501 int64_t retcode = response.
GetS64(-1, 16);
3502 if (retcode == -1) {
3504 if (response.
GetChar() ==
',') {
3506 if (response_errno > 0)
3511 const char next = (response.
Peek() ? *response.
Peek() : 0);
3518 const uint64_t data_to_write =
3519 std::min<uint64_t>(dst_len, buffer.size());
3520 if (data_to_write > 0)
3521 memcpy(dst, &buffer[0], data_to_write);
3522 return data_to_write;
3535 stream.
Printf(
"vFile:pwrite:%x,%" PRIx64
",", (
int)fd, offset);
3540 if (response.
GetChar() !=
'F') {
3544 int64_t bytes_written = response.
GetS64(-1, 16);
3545 if (bytes_written == -1) {
3547 if (response.
GetChar() ==
',') {
3549 if (response_errno > 0)
3554 return bytes_written;
3563 std::string src_path{src.
GetPath(
false)}, dst_path{dst.
GetPath(
false)};
3575 if (response.
GetChar() ==
'F') {
3579 if (response.
GetChar() ==
',') {
3581 if (response_errno > 0)
3596 std::string path{file_spec.
GetPath(
false)};
3606 if (response.
GetChar() ==
'F') {
3610 if (response.
GetChar() ==
',') {
3612 if (response_errno > 0)
3630 std::string path(file_spec.
GetPath(
false));
3639 if (response.
GetChar() !=
'F')
3641 if (response.
GetChar() !=
',')
3643 bool retcode = (response.
GetChar() !=
'0');
3660 std::string path(file_spec.
GetPath(
false));
3667 if (response.
GetChar() !=
'F')
3668 return std::make_error_code(std::errc::illegal_byte_sequence);
3669 if (response.
GetChar() !=
',')
3670 return std::make_error_code(std::errc::illegal_byte_sequence);
3671 if (response.
Peek() && *response.
Peek() ==
'x')
3672 return std::make_error_code(std::errc::no_such_file_or_directory);
3689 const size_t MD5_HALF_LENGTH =
sizeof(uint64_t) * 2;
3694 if (part.size() != MD5_HALF_LENGTH)
3695 return std::make_error_code(std::errc::illegal_byte_sequence);
3699 if (part.getAsInteger(
BASE_16, low))
3700 return std::make_error_code(std::errc::illegal_byte_sequence);
3705 if (part.size() != MD5_HALF_LENGTH)
3706 return std::make_error_code(std::errc::illegal_byte_sequence);
3710 if (part.getAsInteger(
BASE_16, high))
3711 return std::make_error_code(std::errc::illegal_byte_sequence);
3713 llvm::MD5::MD5Result result;
3714 llvm::support::endian::write<uint64_t, llvm::endianness::little>(
3715 result.data(), low);
3716 llvm::support::endian::write<uint64_t, llvm::endianness::little>(
3717 result.data() + 8, high);
3721 return std::make_error_code(std::errc::operation_canceled);
3731 arch.
GetTriple().getVendor() == llvm::Triple::Apple &&
3732 arch.
GetTriple().getOS() == llvm::Triple::IOS &&
3733 (arch.
GetTriple().getArch() == llvm::Triple::aarch64 ||
3734 arch.
GetTriple().getArch() == llvm::Triple::aarch64_32)) {
3737 if (gdb_server_version != 0) {
3739 if (gdb_server_name && strcmp(gdb_server_name,
"debugserver") == 0) {
3740 if (gdb_server_version >= 310)
3753 payload.
Printf(
"p%x", reg);
3762 response.
GetHexBytes(buffer_sp->GetData(),
'\xcc');
3777 response.
GetHexBytes(buffer_sp->GetData(),
'\xcc');
3783 llvm::ArrayRef<uint8_t> data) {
3785 payload.
Printf(
"P%x=", reg_num);
3809 uint32_t &save_id) {
3825 const uint32_t response_save_id = response.
GetU32(0);
3826 if (response_save_id == 0)
3829 save_id = response_save_id;
3842 payload.
Printf(
"QRestoreRegisterState:%u", save_id);
3862 packet.
Printf(
"QSyncThreadState:%4.4" PRIx64
";", tid);
3868llvm::Expected<TraceSupportedResponse>
3873 escaped_packet.
PutCString(
"jLLDBTraceSupported");
3882 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3883 "jLLDBTraceSupported is unsupported");
3885 return llvm::json::parse<TraceSupportedResponse>(response.
Peek(),
3886 "TraceSupportedResponse");
3888 LLDB_LOG(log,
"failed to send packet: jLLDBTraceSupported");
3889 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3890 "failed to send packet: jLLDBTraceSupported");
3895 std::chrono::seconds timeout) {
3899 escaped_packet.
PutCString(
"jLLDBTraceStop:");
3901 std::string json_string;
3902 llvm::raw_string_ostream os(json_string);
3905 escaped_packet.
PutEscapedBytes(json_string.c_str(), json_string.size());
3914 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3915 "jLLDBTraceStop is unsupported");
3917 return llvm::Error::success();
3918 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3919 "Invalid jLLDBTraceStart response");
3921 LLDB_LOG(log,
"failed to send packet: jLLDBTraceStop");
3922 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3923 "failed to send packet: jLLDBTraceStop '%s'",
3929 std::chrono::seconds timeout) {
3933 escaped_packet.
PutCString(
"jLLDBTraceStart:");
3935 std::string json_string;
3936 llvm::raw_string_ostream os(json_string);
3939 escaped_packet.
PutEscapedBytes(json_string.c_str(), json_string.size());
3948 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3949 "jLLDBTraceStart is unsupported");
3951 return llvm::Error::success();
3952 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3953 "Invalid jLLDBTraceStart response");
3955 LLDB_LOG(log,
"failed to send packet: jLLDBTraceStart");
3956 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3957 "failed to send packet: jLLDBTraceStart '%s'",
3961llvm::Expected<std::string>
3963 std::chrono::seconds timeout) {
3967 escaped_packet.
PutCString(
"jLLDBTraceGetState:");
3969 std::string json_string;
3970 llvm::raw_string_ostream os(json_string);
3973 escaped_packet.
PutEscapedBytes(json_string.c_str(), json_string.size());
3982 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3983 "jLLDBTraceGetState is unsupported");
3984 return std::string(response.
Peek());
3987 LLDB_LOG(log,
"failed to send packet: jLLDBTraceGetState");
3988 return llvm::createStringError(
3989 llvm::inconvertibleErrorCode(),
3990 "failed to send packet: jLLDBTraceGetState '%s'",
3994llvm::Expected<std::vector<uint8_t>>
4000 escaped_packet.
PutCString(
"jLLDBTraceGetBinaryData:");
4002 std::string json_string;
4003 llvm::raw_string_ostream os(json_string);
4006 escaped_packet.
PutEscapedBytes(json_string.c_str(), json_string.size());
4016 return std::vector<uint8_t>(data.begin(), data.end());
4018 LLDB_LOG(log,
"failed to send packet: jLLDBTraceGetBinaryData");
4019 return llvm::createStringError(
4020 llvm::inconvertibleErrorCode(),
4021 "failed to send packet: jLLDBTraceGetBinaryData '%s'",
4029 return std::nullopt;
4031 return std::nullopt;
4035 const auto &GetOffset = [&] {
4037 if (ref.consumeInteger(16, offset))
4039 result.
offsets.push_back(offset);
4043 if (ref.consume_front(
"Text=")) {
4046 return std::nullopt;
4047 if (!ref.consume_front(
";Data=") || !GetOffset())
4048 return std::nullopt;
4051 if (ref.consume_front(
";Bss=") && GetOffset() && ref.empty())
4053 }
else if (ref.consume_front(
"TextSeg=")) {
4056 return std::nullopt;
4059 if (ref.consume_front(
";DataSeg=") && GetOffset() && ref.empty())
4062 return std::nullopt;
4071 std::string module_path = module_file_spec.
GetPath(
false);
4072 if (module_path.empty())
4079 const auto &triple = arch_spec.
GetTriple().getTriple();
4095 llvm::StringRef name;
4096 llvm::StringRef value;
4098 module_spec.
Clear();
4102 if (name ==
"uuid" || name ==
"md5") {
4107 }
else if (name ==
"triple") {
4112 }
else if (name ==
"file_offset") {
4114 if (!value.getAsInteger(
BASE_16, ival))
4116 }
else if (name ==
"file_size") {
4118 if (!value.getAsInteger(
BASE_16, ival))
4120 }
else if (name ==
"file_path") {
4131static std::optional<ModuleSpec>
4135 return std::nullopt;
4137 llvm::StringRef string;
4141 return std::nullopt;
4143 return std::nullopt;
4146 return std::nullopt;
4150 return std::nullopt;
4154 return std::nullopt;
4158 return std::nullopt;
4164std::optional<std::vector<ModuleSpec>>
4166 llvm::ArrayRef<FileSpec> module_file_specs,
const llvm::Triple &triple) {
4170 return std::nullopt;
4172 json::Array module_array;
4173 for (
const FileSpec &module_file_spec : module_file_specs) {
4174 module_array.push_back(
4175 json::Object{{
"file", module_file_spec.GetPath(
false)},
4176 {
"triple", triple.getTriple()}});
4179 unescaped_payload.
PutCString(
"jModulesInfo:");
4180 unescaped_payload.
AsRawOstream() << std::move(module_array);
4193 return std::nullopt;
4197 return std::nullopt;
4202 if (!response_object_sp)
4203 return std::nullopt;
4206 if (!response_array)
4207 return std::nullopt;
4209 std::vector<ModuleSpec> result;
4210 for (
size_t i = 0; i < response_array->
GetSize(); ++i) {
4213 result.push_back(*module_spec);
4223llvm::Expected<std::string>
4225 llvm::StringRef annex) {
4228 llvm::raw_string_ostream output_stream(output);
4242 std::string packet =
4243 (
"qXfer:" +
object +
":read:" + annex +
":" +
4244 llvm::Twine::utohexstr(offset) +
"," + llvm::Twine::utohexstr(size))
4252 return llvm::createStringError(llvm::inconvertibleErrorCode(),
4253 "Error sending $qXfer packet");
4271 return llvm::createStringError(
4272 llvm::inconvertibleErrorCode(),
4273 "Invalid continuation code from $qXfer packet");
4280llvm::Expected<std::string>
4287 return llvm::createStringError(
"failed to get the sequence mutex");
4289 return llvm::createStringError(
"failed to select thread");
4336 bool symbol_response_provided =
false;
4339 bool first_qsymbol_query =
true;
4350 if (symbol_response_provided || first_qsymbol_query) {
4357 first_qsymbol_query =
false;
4366 if (response_str.starts_with(
"qSymbol:")) {
4368 std::string symbol_name;
4370 if (symbol_name.empty())
4381 switch (sc.symbol->GetType()) {
4403 if (sc.module_sp->GetArchitecture()
4405 .getObjectFormat() !=
4406 llvm::Triple::ObjectFormatType::MachO) {
4411 sc.symbol->GetLoadAddress(&process->
GetTarget());
4413 symbol_load_addr = sc.symbol->GetRawValue();
4428 sc.symbol->GetLoadAddress(&process->
GetTarget());
4441 packet.
Printf(
"%" PRIx64, symbol_load_addr);
4442 symbol_response_provided =
true;
4444 symbol_response_provided =
false;
4460 "GDBRemoteCommunicationClient::%s: Didn't get sequence mutex.",
4485 "GDBRemoteCommunicationClient::%s(): "
4486 "QSupportedAsyncJSONPackets returned invalid "
4493 "GDBRemoteCommunicationClient::%s(): "
4494 "QSupportedAsyncJSONPackets unsupported",
4502 "GDBRemoteCommunicationClient::%s(): supported async "
4504 __FUNCTION__, stream.
GetData());
4514 llvm::ArrayRef<int32_t> signals) {
4517 auto range = llvm::make_range(signals.begin(), signals.end());
4518 std::string packet = formatv(
"QPassSignals:{0:$[;]@(x-2)}", range).str();
4530 "Unknown error happened during sending QPassSignals packet.");
4538 if (type_name.empty()) {
4551 config_sp->Dump(unescaped_stream);
4552 unescaped_stream.
Flush();
4570 "configuring StructuredData feature {0} failed with error {1}",
4576 "configuring StructuredData feature {0} failed when sending packet: "
4578 type_name, (
int)result);
4607 return llvm::createStringError(llvm::inconvertibleErrorCode(),
4608 "failed to send k packet");
4610 char packet_cmd = response.
GetChar(0);
4611 if (packet_cmd ==
'W' || packet_cmd ==
'X')
4614 return llvm::createStringError(llvm::inconvertibleErrorCode(),
4615 "unexpected response to k packet: %s",
static llvm::raw_ostream & error(Stream &strm)
duration< float > calculate_standard_deviation(const std::vector< duration< float > > &v)
static std::optional< ModuleSpec > ParseModuleSpec(StructuredData::Dictionary *dict)
static int gdb_errno_to_system(int err)
static void ParseOSType(llvm::StringRef value, std::string &os_name, std::string &environment)
static void MakeSpeedTestPacket(StreamString &packet, uint32_t send_size, uint32_t recv_size)
static uint64_t ParseHostIOPacketResponse(StringExtractorGDBRemote &response, uint64_t fail_result, Status &error)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
#define LLDB_LOG_ERROR(log, error,...)
A class which holds the metadata from a remote stub/corefile note about how many bits are used for ad...
void SetAddressableBits(uint32_t addressing_bits)
When a single value is available for the number of bits.
An architecture specification class.
bool IsValid() const
Tests if this ArchSpec is valid.
llvm::Triple & GetTriple()
Architecture triple accessor.
bool SetTriple(const llvm::Triple &triple)
Architecture triple setter.
bool SetArchitecture(ArchitectureType arch_type, uint32_t cpu, uint32_t sub, uint32_t os=0)
Change the architecture object type, CPU type and OS type.
A command line argument class.
void AppendArgument(llvm::StringRef arg_str, char quote_char='\0')
Appends a new argument to the end of the list argument list.
const char * GetArgumentAtIndex(size_t idx) const
Gets the null-terminated C string argument pointer for the argument at index idx.
void Clear()
Clear the arguments.
bool IsConnected() const
Check if the connection is valid.
virtual lldb::ConnectionStatus Disconnect(Status *error_ptr=nullptr)
Disconnect the communications connection if one is currently connected.
"lldb/Utility/ArgCompletionRequest.h"
void AddCompletion(llvm::StringRef completion, llvm::StringRef description="", CompletionMode mode=CompletionMode::Normal)
Adds a possible completion string.
llvm::StringRef GetCursorArgumentPrefix() const
A subclass of DataBuffer that stores a data buffer on the heap.
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void SetReadable(LazyBool val)
LazyBool GetFlash() const
MemoryRegionInfo & SetMemoryTagged(LazyBool val)
void SetBlocksize(lldb::offset_t blocksize)
void SetFlash(LazyBool val)
void SetPageSize(int pagesize)
void SetName(const char *name)
MemoryRegionInfo & SetIsShadowStack(LazyBool val)
lldb::offset_t GetBlocksize() const
MemoryRegionInfo & SetIsStackMemory(LazyBool val)
void SetDirtyPageList(std::vector< lldb::addr_t > pagelist)
MemoryRegionInfo & SetProtectionKey(std::optional< unsigned > key)
void SetMapped(LazyBool val)
void SetExecutable(LazyBool val)
void SetWritable(LazyBool val)
void FindSymbolsWithNameAndType(llvm::StringRef name, lldb::SymbolType symbol_type, SymbolContextList &sc_list) const
void SetObjectSize(uint64_t object_size)
ArchSpec & GetArchitecture()
void SetObjectOffset(uint64_t object_offset)
void SetGroupID(uint32_t gid)
bool ProcessIDIsValid() const
void SetArg0(llvm::StringRef arg)
lldb::pid_t GetProcessID() const
void SetProcessID(lldb::pid_t pid)
FileSpec & GetExecutableFile()
llvm::StringRef GetName() const
bool UserIDIsValid() const
uint32_t GetUserID() const
uint32_t GetGroupID() const
void SetUserID(uint32_t uid)
bool GroupIDIsValid() const
ArchSpec & GetArchitecture()
bool MatchAllProcesses() const
NameMatch GetNameMatchType() const
bool GetMatchAllUsers() const
ProcessInstanceInfo & GetProcessInfo()
uint32_t GetEffectiveUserID() const
void SetEffectiveGroupID(uint32_t gid)
lldb::pid_t GetParentProcessID() const
bool ParentProcessIDIsValid() const
uint32_t GetEffectiveGroupID() const
bool EffectiveUserIDIsValid() const
bool EffectiveGroupIDIsValid() const
void SetParentProcessID(lldb::pid_t pid)
void SetEffectiveUserID(uint32_t uid)
A plug-in interface definition class for debugging a process.
Target & GetTarget()
Get the target object pointer for this module.
llvm::Error ToError() const
FIXME: Replace all uses with takeError() instead.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
bool Success() const
Test for success condition.
int PutAsJSON(const T &obj, bool hex_ascii)
int PutEscapedBytes(const void *s, size_t src_len)
Output a block of data to the stream performing GDB-remote escaping.
const char * GetData() const
void Flush() override
Flush the stream.
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
Forwards the arguments to llvm::formatv and writes to the stream.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t PutStringAsRawHex8(llvm::StringRef s)
size_t PutHex64(uint64_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
size_t PutHex32(uint32_t uvalue, lldb::ByteOrder byte_order=lldb::eByteOrderInvalid)
virtual void Flush()=0
Flush the stream.
size_t EOL()
Output and End of Line character to the stream.
size_t PutBytesAsRawHex8(const void *src, size_t src_len, lldb::ByteOrder src_byte_order=lldb::eByteOrderInvalid, lldb::ByteOrder dst_byte_order=lldb::eByteOrderInvalid)
ObjectSP GetItemAtIndex(size_t idx) const
std::optional< Dictionary * > GetItemAtIndexAsDictionary(size_t idx) const
Retrieves the element at index idx from a StructuredData::Array if it is a Dictionary.
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
ObjectSP GetValueForKey(llvm::StringRef key) const
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
Defines a list of symbol context objects.
Defines a symbol context baton that can be handed other debug core functions.
const ModuleList & GetImages() const
Get accessor for the images for this process.
const ArchSpec & GetArchitecture() const
Represents UUID's of various sizes.
bool SetFromStringRef(llvm::StringRef str)
XMLNode GetRootElement(const char *required_name=nullptr)
bool ParseMemory(const char *xml, size_t xml_length, const char *url="untitled.xml")
void ForEachChildElement(NodeCallback const &callback) const
llvm::StringRef GetName() const
std::string GetAttributeValue(const char *name, const char *fail_value=nullptr) const
bool GetElementTextAsUnsigned(uint64_t &value, uint64_t fail_value=0, int base=0) const
bool GetAttributeValueAsUnsigned(const char *name, uint64_t &value, uint64_t fail_value=0, int base=0) const
GDBRemoteClientBase(const char *comm_name)
PacketResult SendPacketAndWaitForResponse(llvm::StringRef payload, StringExtractorGDBRemote &response, std::chrono::seconds interrupt_timeout=std::chrono::seconds(0), bool sync_on_timeout=true)
PacketResult SendPacketAndWaitForResponseNoLock(llvm::StringRef payload, StringExtractorGDBRemote &response, bool sync_on_timeout=true)
virtual void OnRunPacketSent(bool first)
lldb::DataBufferSP ReadRegister(lldb::tid_t tid, uint32_t reg_num)
std::chrono::seconds m_default_packet_timeout
LazyBool m_supports_vCont_S
LazyBool m_supports_detach_stay_stopped
LazyBool m_supports_alloc_dealloc_memory
bool SupportsGDBStoppointPacket(GDBStoppointType type)
ArchSpec GetSystemArchitecture()
bool RestoreRegisterState(lldb::tid_t tid, uint32_t save_id)
const ArchSpec & GetHostArchitecture()
int SendLaunchArchPacket(const char *arch)
lldb::pid_t GetCurrentProcessID(bool allow_lazy=true)
bool AvoidGPackets(ProcessGDBRemote *process)
llvm::VersionTuple GetMacCatalystVersion()
Status CreateSymlink(const FileSpec &src, const FileSpec &dst)
PacketResult SendThreadSpecificPacketAndWaitForResponse(lldb::tid_t tid, StreamString &&payload, StringExtractorGDBRemote &response)
LazyBool m_qGDBServerVersion_is_valid
bool GetLoadedDynamicLibrariesInfosSupported()
bool GetHostInfo(bool force=false)
LazyBool m_supports_memory_region_info
llvm::Expected< StringExtractorGDBRemote > LaunchProcess(const Args &args)
Launch the process using the provided arguments.
LazyBool m_qHostInfo_is_valid
bool KillSpawnedProcess(lldb::pid_t pid)
bool m_supports_jModulesInfo
lldb_private::AddressableBits GetAddressableBits()
LazyBool m_supports_jGetSharedCacheInfo
bool GetReverseContinueSupported()
bool GetGroupName(uint32_t gid, std::string &name)
bool DecodeProcessInfoResponse(StringExtractorGDBRemote &response, ProcessInstanceInfo &process_info)
std::optional< std::string > GetOSKernelDescription()
int SendEnvironment(const Environment &env)
LazyBool m_supports_augmented_libraries_svr4_read
uint32_t m_high_mem_addressing_bits
llvm::VersionTuple GetOSVersion()
llvm::Expected< std::string > ReadSiginfo(lldb::tid_t tid)
Read the siginfo of the given thread using the qXfer:siginfo:read packet.
std::optional< uint32_t > GetWatchpointSlotCount()
bool HandshakeWithServer(Status *error_ptr)
bool GetAugmentedLibrariesSVR4ReadSupported()
lldb_private::StructuredData::Array * GetSupportedStructuredDataPlugins()
Return the array of async JSON packet types supported by the remote.
bool m_supports_vFileSize
uint64_t GetRemoteMaxPacketSize()
bool QueryNoAckModeSupported()
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)
bool m_qSymbol_requests_done
bool GetCurrentProcessInfo(bool allow_lazy_pid=true)
Status Unlink(const FileSpec &file_spec)
bool GetVAttachOrWaitSupported()
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)
LazyBool m_supports_qXfer_features_read
bool GetAcceleratorPluginsSupported()
bool m_supports_vFileMode
bool GetMultiprocessSupported()
LazyBool m_qProcessInfo_is_valid
LazyBool m_supports_vCont_c
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)
int m_target_vm_page_size
llvm::Error SendTraceStop(const TraceStopRequest &request, std::chrono::seconds interrupt_timeout)
uint32_t m_num_supported_hardware_watchpoints
std::optional< xPacketState > m_x_packet_state
void TestPacketSpeed(const uint32_t num_packets, uint32_t max_send, uint32_t max_recv, uint64_t recv_amount, bool json, Stream &strm)
lldb::addr_t AllocateMemory(size_t size, uint32_t permissions)
LazyBool m_supports_wasm_instance
std::string m_host_distribution_id
std::optional< LLDBSettings > GetLLDBSettings()
Return LLDB-specific settings for this GDB-remote process.
GDBRemoteCommunicationClient()
std::optional< std::string > GetOSBuildString()
bool LaunchGDBServer(const char *remote_accept_hostname, lldb::pid_t &pid, uint16_t &port, std::string &socket_name)
int SetSTDOUT(const FileSpec &file_spec)
LazyBool m_prepare_for_reg_writing_reply
bool m_supports_qThreadStopInfo
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)
bool GetpPacketSupported(lldb::tid_t tid)
Status MakeDirectory(const FileSpec &file_spec, uint32_t mode)
uint64_t ReadFile(lldb::user_id_t fd, uint64_t offset, void *dst, uint64_t dst_len, Status &error)
LazyBool m_supports_vCont_any
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)
LazyBool m_supports_error_string_reply
LazyBool m_supports_qXfer_siginfo_read
WatchpointHardwareFeature GetSupportedWatchpointTypes()
std::optional< GDBRemoteFStatData > FStat(lldb::user_id_t fd)
int SetSTDERR(const FileSpec &file_spec)
bool GetThreadSuffixSupported()
lldb::addr_t m_process_standalone_value
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)
LazyBool m_supports_memory_tagging
llvm::Expected< std::string > SendTraceGetState(llvm::StringRef type, std::chrono::seconds interrupt_timeout)
void ResetDiscoverableSettings(bool did_exec)
LazyBool m_supports_qXfer_libraries_svr4_read
bool m_process_standalone_value_is_offset
lldb_private::StructuredData::ObjectSP m_supported_async_json_packets_sp
LazyBool m_attach_or_wait_reply
bool m_supports_jThreadsInfo
bool GetGDBServerVersion()
lldb::user_id_t GetFileSize(const FileSpec &file_spec)
bool GetQXferFeaturesReadSupported()
LazyBool m_watchpoints_trigger_after_instruction
LazyBool m_supports_threads_in_stop_reply
std::vector< lldb::addr_t > m_binary_addresses
void GetRemoteQSupported()
bool GetQPassSignalsSupported()
Status ConfigureRemoteStructuredData(llvm::StringRef type_name, const StructuredData::ObjectSP &config_sp)
Configure a StructuredData feature on the remote end.
bool CloseFile(lldb::user_id_t fd, Status &error)
~GDBRemoteCommunicationClient() override
bool GetReverseStepSupported()
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...
LazyBool m_supports_vCont_s
bool m_supports_qGroupName
bool SetCurrentThread(uint64_t tid, lldb::pid_t pid=LLDB_INVALID_PROCESS_ID)
bool m_supports_vFileExists
bool GetDefaultThreadId(lldb::tid_t &tid)
void ServeSymbolLookups(lldb_private::Process *process)
LazyBool m_uses_native_signals
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.
uint32_t m_low_mem_addressing_bits
lldb::tid_t m_curr_tid
Current gdb remote protocol thread identifier for all other operations.
LazyBool m_supports_multi_breakpoint
LazyBool m_supports_qXfer_memory_map_read
bool GetHostname(std::string &s)
llvm::Expected< int > KillProcess(lldb::pid_t pid)
bool m_supported_async_json_packets_is_valid
bool GetSyncThreadStateSupported()
bool WriteAllRegisters(lldb::tid_t tid, llvm::ArrayRef< uint8_t > data)
bool m_supports_QEnvironmentHexEncoded
bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info)
Status SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions)
LazyBool m_curr_pid_is_valid
Status GetQXferMemoryMapRegionInfo(lldb::addr_t addr, MemoryRegionInfo ®ion)
std::vector< AddressSpaceInfo > GetAddressSpaces()
Empty if the server does not support "jAddressSpacesInfo".
int SetDetachOnError(bool enable)
Sets the DetachOnError flag to enable for the process controlled by the stub.
void OnRunPacketSent(bool first) override
bool m_supports_QEnvironment
lldb::addr_t GetShlibInfoAddr()
Status SendSignalsToIgnore(llvm::ArrayRef< int32_t > signals)
LazyBool m_supports_jThreadExtendedInfo
LazyBool GetThreadPacketSupported(lldb::tid_t tid, llvm::StringRef packetStr)
UUID m_process_standalone_uuid
LazyBool m_supports_not_sending_acks
LazyBool m_supports_watchpoint_support_info
bool WriteRegister(lldb::tid_t tid, uint32_t reg_num, llvm::ArrayRef< uint8_t > data)
uint64_t m_max_packet_size
void EnableErrorStringInPacket()
LazyBool m_supports_accelerator_plugins
llvm::Expected< std::vector< uint8_t > > SendTraceGetBinaryData(const TraceGetBinaryDataRequest &request, std::chrono::seconds interrupt_timeout)
LazyBool m_supports_qXfer_libraries_read
bool GetSaveCoreSupported() const
LazyBool m_supports_jLoadedDynamicLibrariesInfos
Status LoadQXferMemoryMap()
LazyBool m_supports_thread_suffix
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.
bool m_supports_address_spaces
LazyBool m_supports_vCont_C
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)
LazyBool m_supports_qSaveCore
LazyBool m_supports_reverse_step
bool GetQXferLibrariesSVR4ReadSupported()
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)
std::optional< bool > GetWatchpointReportedAfter()
std::string m_gdb_server_name
std::vector< lldb::addr_t > GetProcessStandaloneBinaries()
bool m_supports_qProcessInfoPID
llvm::VersionTuple m_os_version
bool GetQXferLibrariesReadSupported()
llvm::VersionTuple m_maccatalyst_version
int SetDisableASLR(bool enable)
Sets the disable ASLR flag to enable for a process that will be launched with the 'A' packet.
bool GetUserName(uint32_t uid, std::string &name)
Status GetMemoryRegionInfo(lldb::addr_t addr, MemoryRegionInfo &range_info)
std::vector< MemoryRegionInfo > m_qXfer_memory_map
bool SyncThreadState(lldb::tid_t tid)
bool m_supports_qfProcessInfo
std::chrono::seconds GetHostDefaultPacketTimeout()
bool GetWasmInstanceSupported()
Whether the WebAssembly stub can be told which module instance to read from, which it advertises with...
bool GetThreadExtendedInfoSupported()
lldb::DataBufferSP ReadAllRegisters(lldb::tid_t tid)
std::optional< AcceleratorDynamicLoaderResponse > GetAcceleratorDynamicLoaderLibraryInfos(const AcceleratorDynamicLoaderArgs &args)
Returns std::nullopt if the packet failed or the response did not parse.
bool GetMemoryTaggingSupported()
void AutoCompleteDiskFileOrDirectory(CompletionRequest &request, bool only_dir)
lldb::pid_t m_curr_pid_run
Current gdb remote protocol process identifier for continue, step, etc.
LazyBool m_supports_multiprocess
void MaybeEnableCompression(llvm::ArrayRef< llvm::StringRef > supported_compressions)
bool GetDynamicLoaderProcessStateSupported()
const ArchSpec & GetProcessArchitecture()
bool DeallocateMemory(lldb::addr_t addr)
llvm::Expected< TraceSupportedResponse > SendTraceSupported(std::chrono::seconds interrupt_timeout)
bool GetQXferAuxvReadSupported()
bool GetMultiBreakpointSupported()
xPacketState GetxPacketState()
llvm::ErrorOr< llvm::MD5::MD5Result > CalculateMD5(const FileSpec &file_spec)
bool GetVContSupported(llvm::StringRef flavor)
uint32_t GetGDBServerProgramVersion()
LazyBool m_supports_reverse_continue
llvm::Error SendTraceStart(const llvm::json::Value &request, std::chrono::seconds interrupt_timeout)
bool GetStopReply(StringExtractorGDBRemote &response)
bool m_supports_qUserName
bool GetQXferMemoryMapReadSupported()
bool m_qXfer_memory_map_loaded
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)
LazyBool m_supports_vCont_all
std::optional< PidTid > SendSetCurrentThreadPacket(uint64_t tid, uint64_t pid, char op)
bool SendSpeedTestPacket(uint32_t send_size, uint32_t recv_size)
LazyBool m_supports_multi_mem_read
LazyBool m_supports_QPassSignals
bool GetFileExists(const FileSpec &file_spec)
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)
bool GetMultiMemReadSupported()
bool GetQXferSigInfoReadSupported()
uint32_t m_gdb_server_version
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...
LazyBool m_avoid_g_packets
std::vector< std::pair< lldb::pid_t, lldb::tid_t > > GetCurrentProcessAndThreadIDs(bool &sequence_mutex_unavailable)
bool GetThreadStopInfo(lldb::tid_t tid, StringExtractorGDBRemote &response)
bool SaveRegisterState(lldb::tid_t tid, uint32_t &save_id)
bool GetProcessStandaloneBinary(UUID &uuid, lldb::addr_t &value, bool &value_is_offset)
LazyBool m_supports_lldb_settings
LazyBool m_supports_QSaveRegisterState
WatchpointHardwareFeature m_watchpoint_types
void GetListThreadsInStopReplySupported()
StructuredData::ObjectSP GetThreadsInfo()
std::string m_qSupported_response
bool GetSharedCacheInfoSupported()
LazyBool m_supports_qXfer_auxv_read
bool m_supports_qModuleInfo
const char * GetGDBServerProgramName()
LazyBool m_supports_jGetDyldProcessState
std::optional< LLDBSettings > m_lldb_settings
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...
std::chrono::seconds SetPacketTimeout(std::chrono::seconds packet_timeout)
LazyBool m_supports_qEcho
CompressionType m_compression_type
std::chrono::seconds GetPacketTimeout() const
#define LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_CPUTYPE
#define UNUSED_IF_ASSERT_DISABLED(x)
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_PROCESS_ID
lldb::ByteOrder InlHostByteOrder()
llvm::raw_ostream & operator<<(llvm::raw_ostream &os, const QOffsets &offsets)
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
llvm::json::Value toJSON(const Diagnostics::Report &report)
Render a diagnostics report as JSON, for diagnostics dump's terminal output.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
@ eErrorTypeGeneric
Generic errors that can be any value.
@ eErrorTypePOSIX
POSIX error codes.
@ eSymbolTypeVariableType
@ eSymbolTypeObjCMetaClass
@ eSymbolTypeASTFile
The symbol's name is the path to a compiler AST file.
@ eSymbolTypeAdditional
When symbols take more than one entry, the extra entries get this type.
@ eSymbolTypeInstrumentation
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
Sent by the client when a plugin-requested breakpoint is hit.
Arguments for the jAcceleratorPluginGetDynamicLoaderLibraryInfo packet.
bool Contains(BaseType r) const
BaseType GetRangeBase() const
void SetRangeEnd(BaseType end)
void SetRangeBase(BaseType b)
Set the start value for the range, and keep the same size.
BaseType GetRangeEnd() const
void SetByteSize(SizeType s)
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.