11#include "lldb/Host/Config.h"
47#include "llvm/ADT/StringSwitch.h"
48#include "llvm/Support/ErrorExtras.h"
49#include "llvm/Support/ErrorHandling.h"
50#include "llvm/Support/JSON.h"
51#include "llvm/Support/ScopedPrinter.h"
52#include "llvm/TargetParser/Triple.h"
67enum GDBRemoteServerError {
70 eErrorNoProcess = eErrorFirst,
243 eServerPacketType_jAcceleratorPluginBreakpointHit,
248 eServerPacketType_jAcceleratorPluginGetDynamicLoaderLibraryInfo,
265 bool &interrupt,
bool &quit) {
301 "%s: no process command line specified to launch", __FUNCTION__);
303 const bool should_forward_stdio =
310 if (should_forward_stdio) {
315 win_size.
cols == 0 && win_size.
rows == 0) {
331 "process but one already exists");
341 SetEnabledExtensions(*m_current_process);
348 if (should_forward_stdio) {
353 "pid = {0}: setting up stdout/stderr redirection via $O "
354 "gdb-remote commands",
355 m_current_process->GetID());
358 auto terminal_fd = m_current_process->GetTerminalFileDescriptor();
359 if (terminal_fd >= 0) {
361 "ProcessGDBRemoteCommunicationServerLLGS::%s setting "
362 "inferior STDIO fd to %d",
363 __FUNCTION__, terminal_fd);
364 Status status = SetSTDIOFileDescriptor(terminal_fd);
369 "ProcessGDBRemoteCommunicationServerLLGS::%s ignoring "
370 "inferior STDIO since terminal fd reported as %d",
371 __FUNCTION__, terminal_fd);
375 "pid = {0} skipping stdout/stderr redirection via $O: inferior "
376 "will communicate over client-provided file descriptors",
377 m_current_process->GetID());
380 printf(
"Launched '%s' as process %" PRIu64
"...\n",
381 m_process_launch_info.GetArguments().GetArgumentAtIndex(0),
382 m_current_process->GetID());
389 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s pid %" PRIu64,
396 "cannot attach to process %" PRIu64
397 " when another process with pid %" PRIu64
" is being debugged.",
404 llvm::errs() << llvm::formatv(
"failed to attach to process {0}: {1}\n", pid,
412 SetEnabledExtensions(*m_current_process);
415 auto terminal_fd = m_current_process->GetTerminalFileDescriptor();
416 if (terminal_fd >= 0) {
418 "ProcessGDBRemoteCommunicationServerLLGS::%s setting "
419 "inferior STDIO fd to %d",
420 __FUNCTION__, terminal_fd);
421 Status status = SetSTDIOFileDescriptor(terminal_fd);
426 "ProcessGDBRemoteCommunicationServerLLGS::%s ignoring "
427 "inferior STDIO since terminal fd reported as %d",
428 __FUNCTION__, terminal_fd);
431 printf(
"Attached to process %" PRIu64
"...\n", pid);
436 llvm::StringRef process_name,
bool include_existing) {
439 std::chrono::milliseconds polling_interval = std::chrono::milliseconds(1);
445 process_name, llvm::sys::path::Style::native);
448 if (include_existing) {
449 LLDB_LOG(log,
"including existing processes in search");
453 LLDB_LOG(log,
"placed '{0}' processes in the exclusion list.",
454 exclusion_list.size());
457 LLDB_LOG(log,
"waiting for '{0}' to appear", process_name);
459 auto is_in_exclusion_list =
461 for (
auto &excluded : exclusion_list) {
462 if (excluded.GetProcessID() == info.GetProcessID())
470 loop_process_list.clear();
473 llvm::erase_if(loop_process_list, is_in_exclusion_list);
476 if (loop_process_list.size() == 1) {
477 auto matching_process_pid = loop_process_list[0].GetProcessID();
478 LLDB_LOG(log,
"found pid {0}", matching_process_pid);
483 if (loop_process_list.size() > 1) {
486 "Multiple executables with name: '{0}' found. Pids: ",
488 for (
size_t i = 0; i < loop_process_list.size() - 1; ++i) {
489 error_stream.
Format(
"{0}, ", loop_process_list[i].GetProcessID());
491 error_stream.
Format(
"{0}.", loop_process_list.back().GetProcessID());
499 LLDB_LOG(log,
"sleep {0} seconds", polling_interval);
500 std::this_thread::sleep_for(polling_interval);
506 assert(process &&
"process cannot be NULL");
509 "GDBRemoteCommunicationServerLLGS::%s called with "
510 "NativeProcessProtocol pid %" PRIu64
", current state: %s",
511 __FUNCTION__, process->
GetID(),
518 assert(process &&
"process cannot be NULL");
524 LLDB_LOG(log,
"pid = {0}, failed to retrieve process exit status",
529 response.
PutHex8(GDBRemoteServerError::eErrorExitStatus);
533 LLDB_LOG(log,
"pid = {0}, returning exit type {1}", process->
GetID(),
542 response.
Format(
"{0:g}", *wait_status);
545 response.
Format(
";process:{0:x-}", process->
GetID());
553 uint32_t buf_size,
bool swap) {
556 for (i = buf_size - 1; i >= 0; i--)
559 for (i = 0; i < buf_size; i++)
580 switch (reg_info.
format) {
590 return "bytes-with-ascii";
594 return "char-printable";
606 return "hex-uppercase";
622 return "vector-char";
624 return "vector-sint64";
626 return "vector-float16";
628 return "vector-float64";
630 return "vector-sint8";
632 return "vector-uint8";
634 return "vector-sint16";
636 return "vector-uint16";
638 return "vector-sint32";
640 return "vector-uint32";
642 return "vector-float32";
644 return "vector-uint64";
646 return "vector-uint128";
648 return "complex-integer";
652 return "address-info";
656 return "instruction";
664 llvm_unreachable(
"Unknown register format");
709 response.
Printf(
"%" PRIx32, *reg_num);
711 response.
Printf(
"%" PRIu32, *reg_num);
723 reg_value_p = ®_value;
734 std::vector<uint8_t> zeros(reg_info.
byte_size,
'\0');
740static std::optional<json::Object>
746 json::Object register_object;
748#ifdef LLDB_JTHREADSINFO_FULL_REGISTER_SET
749 const auto expedited_regs =
752 const auto expedited_regs =
755 if (expedited_regs.empty())
758 for (
auto ®_num : expedited_regs) {
761 if (reg_info_p ==
nullptr) {
763 "%s failed to get register info for register index %" PRIu32,
764 __FUNCTION__, reg_num);
775 LLDB_LOGF(log,
"%s failed to read register '%s' index %" PRIu32
": %s",
777 reg_info_p->
name ? reg_info_p->
name :
"<unnamed-register>",
778 reg_num,
error.AsCString());
786 register_object.try_emplace(llvm::to_string(reg_num),
790 return register_object;
794 switch (stop_reason) {
808 return "processor trace";
816 return "async interrupt";
830static llvm::Expected<json::Array>
834 json::Array threads_array;
841 std::string description;
842 if (!thread.GetStopReason(tid_stop_info, description))
843 return llvm::createStringError(
"failed to get stop reason");
845 const int signum = tid_stop_info.
signo;
847 "GDBRemoteCommunicationServerLLGS::%s pid %" PRIu64
849 " got signal signo = %d, reason = %d, exc_type = %" PRIu64,
850 __FUNCTION__, process.
GetID(), tid, signum, tid_stop_info.
reason,
853 json::Object thread_obj;
857 thread_obj.try_emplace(
"registers", std::move(*registers));
860 thread_obj.try_emplace(
"tid",
static_cast<int64_t
>(tid));
863 thread_obj.try_emplace(
"signal", signum);
865 const std::string thread_name = thread.GetName();
866 if (!thread_name.empty())
867 thread_obj.try_emplace(
"name", thread_name);
871 thread_obj.try_emplace(
"reason", stop_reason);
873 if (!description.empty())
874 thread_obj.try_emplace(
"description", description);
878 thread_obj.try_emplace(
881 json::Array medata_array;
884 medata_array.push_back(
887 thread_obj.try_emplace(
"medata", std::move(medata_array));
889 threads_array.push_back(std::move(thread_obj));
891 return threads_array;
901 LLDB_LOG(log,
"preparing packet for pid {0} tid {1}", process.
GetID(),
907 std::string description;
908 if (!thread.GetStopReason(tid_stop_info, description))
919 int signum = tid_stop_info.
signo;
922 "pid {0}, tid {1}, got signal signo = {2}, reason = {3}, exc_type = {4}",
923 process.
GetID(), thread.GetID(), signum,
int(tid_stop_info.
reason),
927 response.
PutHex8(signum & 0xff);
935 const std::string thread_name = thread.GetName();
936 if (!thread_name.empty()) {
937 size_t thread_name_len = thread_name.length();
939 if (::strcspn(thread_name.c_str(),
"$#+-;:") == thread_name_len) {
961 uint32_t thread_num = 0;
965 response.
Printf(
"%" PRIx64, listed_thread.GetID());
975 if (thread_num > 1) {
976 const bool threads_with_valid_stop_info_only =
true;
982 unescaped_response.
AsRawOstream() << std::move(*threads_info);
987 "failed to prepare a jstopinfo field for pid {1}: {0}",
993 char delimiter =
':';
1005 LLDB_LOGF(log,
"%s failed to read register '%s' index %" PRIu32
": %s",
1007 reg_info_p->
name ? reg_info_p->
name :
"<unnamed-register>",
1008 reg_to_read,
error.AsCString());
1027 const auto expedited_regs =
1030 for (
auto ®_num : expedited_regs) {
1034 if (reg_info_p !=
nullptr && reg_info_p->
value_regs ==
nullptr) {
1037 if (
error.Success()) {
1038 response.
Printf(
"%.02x:", reg_num);
1044 "GDBRemoteCommunicationServerLLGS::%s failed to read "
1045 "register '%s' index %" PRIu32
": %s",
1047 reg_info_p->
name ? reg_info_p->
name :
"<unnamed-register>",
1048 reg_num,
error.AsCString());
1054 if (reason_str !=
nullptr) {
1055 response.
Printf(
"reason:%s;", reason_str);
1058 if (!description.empty()) {
1089 response.
Printf(
"%s:p%" PRIx64
".%" PRIx64
";", reason_str,
1111 if (response.
Empty())
1131 if (listed_thread.GetID() != thread_to_skip) {
1133 if (!stop_reply.
Empty())
1141 assert(process &&
"process cannot be NULL");
1144 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s called", __FUNCTION__);
1146 if (std::optional<WaitStatus> exit_status = process->
GetExitStatus())
1147 for (
const std::unique_ptr<lldb_server::LLDBServerAcceleratorPlugin>
1149 plugin_up->NativeProcessDidExit(*exit_status);
1155 "GDBRemoteCommunicationServerLLGS::%s failed to send stop "
1156 "notification for PID %" PRIu64
", state: eStateExited",
1157 __FUNCTION__, process->
GetID());
1188 assert(process &&
"process cannot be NULL");
1191 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s called", __FUNCTION__);
1197 "GDBRemoteCommunicationServerLLGS::%s failed to send stop "
1198 "notification for PID %" PRIu64
", state: eStateExited",
1199 __FUNCTION__, process->
GetID());
1205 assert(process &&
"process cannot be NULL");
1208 "GDBRemoteCommunicationServerLLGS::%s called with "
1209 "NativeProcessProtocol pid %" PRIu64
", state: %s",
1237 "GDBRemoteCommunicationServerLLGS::%s didn't handle state "
1238 "change for pid %" PRIu64
", new state: %s",
1250 std::unique_ptr<NativeProcessProtocol> child_process) {
1260 llvm::StringRef data) {
1289 bool interrupt =
false;
1294 std::chrono::microseconds(0),
error, interrupt, done);
1300 "GDBRemoteCommunicationServerLLGS::%s processing a packet "
1302 __FUNCTION__,
error.AsCString());
1310 std::unique_ptr<Connection> connection) {
1311 IOObjectSP read_object_sp = connection->GetReadObject();
1323 const llvm::json::Value &value) {
1324 std::string json_string;
1325 raw_string_ostream os(json_string);
1330 escaped_response.
PutEscapedBytes(json_string.c_str(), json_string.size());
1337 if ((buffer ==
nullptr) || (len == 0)) {
1356 std::unique_ptr<ConnectionFileDescriptor> conn_up(
1368 "failed to set connection for inferior I/O communication");
1390 LLDB_LOG(log,
"Failed to set up stdio forwarding: {0}",
error);
1404 buffer,
sizeof buffer, std::chrono::microseconds(0), status, &
error);
1415 "GDBRemoteCommunicationServerLLGS::%s Stopping stdio "
1416 "forwarding as communication returned status %d (error: "
1418 __FUNCTION__, status,
error.AsCString());
1450 Expected<TraceStopRequest> stop_request =
1451 json::parse<TraceStopRequest>(packet.
Peek(),
"TraceStopRequest");
1471 Expected<TraceStartRequest> request =
1472 json::parse<TraceStartRequest>(packet.
Peek(),
"TraceStartRequest");
1492 Expected<TraceGetStateRequest> request =
1493 json::parse<TraceGetStateRequest>(packet.
Peek(),
"TraceGetStateRequest");
1510 llvm::Expected<TraceGetBinaryDataRequest> request =
1511 llvm::json::parse<TraceGetBinaryDataRequest>(packet.
Peek(),
1512 "TraceGetBinaryDataRequest");
1516 if (Expected<std::vector<uint8_t>> bytes =
1533 std::vector<std::string> structured_data_plugins =
1537 llvm::json::Value(llvm::json::Array(structured_data_plugins)));
1594 LLDB_LOG(log,
"No debugged process found.");
1600 LLDB_LOG(log,
"Killing process {0}", it->first);
1603 LLDB_LOG(log,
"Failed to kill debugged process {0}: {1}", it->first,
1624 "vKill failed to parse the process id");
1642 packet.
SetFilePos(::strlen(
"QSetDisableASLR:"));
1653 packet.
SetFilePos(::strlen(
"QSetWorkingDir:"));
1695 LLDB_LOG(log,
"process {0} cannot be resumed (state={1})", process.
GetID(),
1714 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s called", __FUNCTION__);
1719 "GDBRemoteCommunicationServerLLGS::%s no debugged process "
1731 const uint32_t signo =
1732 packet.
GetHexMaxU32(
false, std::numeric_limits<uint32_t>::max());
1733 if (signo == std::numeric_limits<uint32_t>::max())
1739 if (*packet.
Peek() ==
';')
1743 packet,
"unexpected content after $C{signal-number}");
1749 LLDB_LOG(log,
"process cannot be resumed (state={0})",
1770 static_cast<int>(signo)};
1774 resume_actions.
Append(action);
1780 LLDB_LOG(log,
"failed to send signal for process {0}: {1}",
1801 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s called", __FUNCTION__);
1806 const bool has_continue_address = (packet.
GetBytesLeft() > 0);
1807 if (has_continue_address) {
1808 LLDB_LOG(log,
"not implemented for c[address] variant [{0} remains]",
1816 "GDBRemoteCommunicationServerLLGS::%s no debugged process "
1837 response.
Printf(
"vCont;c;C;s;S;t");
1858 LLDB_LOGF(log,
"GDBRemoteCommunicationServerLLGS::%s handling vCont packet",
1865 "GDBRemoteCommunicationServerLLGS::%s missing action from "
1871 if (::strcmp(packet.
Peek(),
";s") == 0) {
1877 std::unordered_map<lldb::pid_t, ResumeActionList> thread_actions;
1889 const char action = packet.
GetChar();
1893 if (thread_action.
signal == 0)
1895 packet,
"Could not parse signal in vCont packet C action");
1905 if (thread_action.
signal == 0)
1907 packet,
"Could not parse signal in vCont packet S action");
1938 pid = pid_tid->first;
1939 tid = pid_tid->second;
1945 packet,
"'t' action not supported for individual threads");
1951 LLDB_LOG(log,
"no process selected via Hc");
1960 thread_action.
tid = tid;
1965 packet,
"vCont: p-1 is not valid with a specific tid");
1967 thread_actions[process_it.first].Append(thread_action);
1969 thread_actions[pid].Append(thread_action);
1972 assert(thread_actions.size() >= 1);
1973 if (thread_actions.size() > 1 && !
m_non_stop)
1976 "Resuming multiple processes is supported in non-stop mode only");
1978 for (std::pair<lldb::pid_t, ResumeActionList> x : thread_actions) {
1981 LLDB_LOG(log,
"vCont failed for process {0}: process not debugged",
1998 assert(process_it->second.process_up);
2000 if (process_it->second.process_up->IsRunning()) {
2003 Status error = process_it->second.process_up->Interrupt();
2005 LLDB_LOG(log,
"vCont failed to halt process {0}: {1}", x.first,
2010 LLDB_LOG(log,
"halted process {0}", x.first);
2014 assert(thread_actions.size() == 1);
2030 LLDB_LOG(log,
"setting current thread id to {0}", tid);
2039 LLDB_LOG(log,
"setting continue thread id to {0}", tid);
2053 return x.front() !=
'W' && x.front() !=
'X';
2063 if (!stop_reply.
Empty())
2090 bool force_synchronous) {
2107 if (it.second.process_up->IsRunning())
2117 switch (process_state) {
2143 LLDB_LOG(log,
"pid {0}, current state reporting not handled: {1}",
2144 process.
GetID(), process_state);
2169 const uint32_t reg_index =
2170 packet.
GetHexMaxU32(
false, std::numeric_limits<uint32_t>::max());
2171 if (reg_index == std::numeric_limits<uint32_t>::max())
2202 if (!encoding.empty())
2203 response <<
"encoding:" << encoding <<
';';
2206 if (!format.empty())
2207 response <<
"format:" << format <<
';';
2209 const char *
const register_set_name =
2211 if (register_set_name)
2212 response <<
"set:" << register_set_name <<
';';
2214 response <<
"set:general;";
2218 response.
Printf(
"ehframe:%" PRIu32
";",
2222 response.
Printf(
"dwarf:%" PRIu32
";",
2226 if (!kind_generic.empty())
2227 response <<
"generic:" << kind_generic <<
';';
2252 LLDB_LOG(log,
"iterating over threads of process {0}", process.
GetID());
2254 LLDB_LOG(log,
"iterated thread tid={0}", thread.GetID());
2255 response.
PutChar(had_any ?
',' :
'm');
2268 bool had_any =
false;
2297 LLDB_LOG(log,
"failed, no thread available");
2304 std::vector<uint8_t> regs_buffer;
2309 if (reg_info ==
nullptr) {
2310 LLDB_LOG(log,
"failed to get register info for register index {0}",
2321 LLDB_LOG(log,
"failed to read register at index {0}", reg_num);
2348 const uint32_t reg_index =
2349 packet.
GetHexMaxU32(
false, std::numeric_limits<uint32_t>::max());
2350 if (reg_index == std::numeric_limits<uint32_t>::max()) {
2352 "GDBRemoteCommunicationServerLLGS::%s failed, could not "
2353 "parse register number from request \"%s\"",
2361 LLDB_LOG(log,
"failed, no thread available");
2372 "GDBRemoteCommunicationServerLLGS::%s failed, requested "
2373 "register %" PRIu32
" beyond register count %" PRIu32,
2381 "GDBRemoteCommunicationServerLLGS::%s failed, requested "
2382 "register %" PRIu32
" returned NULL",
2383 __FUNCTION__, reg_index);
2395 "GDBRemoteCommunicationServerLLGS::%s failed, read of "
2396 "requested register %" PRIu32
" (%s) failed: %s",
2397 __FUNCTION__, reg_index, reg_info->
name,
error.AsCString());
2401 const uint8_t *
const data =
2402 static_cast<const uint8_t *
>(reg_value.
GetBytes());
2405 "GDBRemoteCommunicationServerLLGS::%s failed to get data "
2406 "bytes from requested register %" PRIu32,
2407 __FUNCTION__, reg_index);
2412 for (uint32_t i = 0; i < reg_value.
GetByteSize(); ++i)
2428 const uint32_t reg_index =
2429 packet.
GetHexMaxU32(
false, std::numeric_limits<uint32_t>::max());
2430 if (reg_index == std::numeric_limits<uint32_t>::max()) {
2432 "GDBRemoteCommunicationServerLLGS::%s failed, could not "
2433 "parse register number from request \"%s\"",
2441 packet,
"P packet missing '=' char after register number");
2450 "GDBRemoteCommunicationServerLLGS::%s failed, no thread "
2451 "available (thread index 0)",
2461 "GDBRemoteCommunicationServerLLGS::%s failed, requested "
2462 "register %" PRIu32
" returned NULL",
2463 __FUNCTION__, reg_index);
2471 "GDBRemoteCommunicationServerLLGS::%s failed, requested "
2472 "register %" PRIu32
" beyond register count %" PRIu32,
2488 "GDBRemoteCommunicationServerLLGS::%s failed, write of "
2489 "requested register %" PRIu32
" (%s) failed: %s",
2490 __FUNCTION__, reg_index, reg_info->
name,
error.AsCString());
2505 "GDBRemoteCommunicationServerLLGS::%s failed, H command "
2506 "missing {g,c} variant",
2511 const char h_variant = packet.
GetChar();
2513 switch (h_variant) {
2525 "GDBRemoteCommunicationServerLLGS::%s failed, invalid $H variant %c",
2526 __FUNCTION__, h_variant);
2528 "H variant unsupported, should be c or g");
2532 auto pid_tid = packet.
GetPidTid(default_process ? default_process->
GetID()
2544 llvm::createStringError(
"no current process and no PID provided"));
2550 llvm::createStringErrorV(
"no process with PID {0} debugged", pid));
2556 new_process_it->second.process_up->GetThreadByID(tid);
2559 "GDBRemoteCommunicationServerLLGS::%s failed, tid %" PRIu64
2567 switch (h_variant) {
2579 assert(
false &&
"unsupported $H variant - shouldn't get here");
2581 "H variant unsupported, should be c or g");
2596 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2639 LLDB_LOG(log,
"failed, no process available");
2666 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2689 const uint64_t byte_count = packet.
GetHexMaxU64(
false, 0);
2690 if (byte_count == 0) {
2692 "GDBRemoteCommunicationServerLLGS::%s nothing to read: "
2693 "zero-length packet",
2701 std::optional<lldb::tid_t> tid;
2704 llvm::StringRef name, value;
2706 if (name ==
"address_space" && value.getAsInteger(16, address_space))
2708 if (name ==
"thread") {
2710 if (value.getAsInteger(16, parsed_tid))
2718 std::string buf(byte_count,
'\0');
2723 size_t bytes_read = 0;
2725 ProcessAddress(read_addr, address_space, tid), &buf[0], byte_count,
2728 "read {2} of {1} requested bytes at {0:x} in address_space {4} "
2729 "thread {5} (error: {3})",
2730 read_addr, byte_count, bytes_read,
error, address_space,
2732 if (bytes_read == 0)
2737 char kind = packet.
GetChar(
'?');
2741 assert(kind ==
'm');
2742 for (
size_t i = 0; i < bytes_read; ++i)
2757 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2772 Permissions perms = {};
2776 perms |= ePermissionsReadable;
2779 perms |= ePermissionsWritable;
2782 perms |= ePermissionsExecutable;
2806 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2834 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2857 const uint64_t byte_count = packet.
GetHexMaxU64(
false, 0);
2858 if (byte_count == 0) {
2859 LLDB_LOG(log,
"nothing to write: zero-length packet");
2866 packet,
"Comma sep missing in M packet after byte length");
2869 std::vector<uint8_t> buf(byte_count, 0);
2875 const uint64_t convert_count = packet.
GetHexBytes(buf, 0);
2876 if (convert_count != byte_count) {
2878 "pid {0} mem {1:x}: asked to write {2} bytes, but only found {3} "
2882 "not match hex-encoded content "
2887 size_t bytes_written = 0;
2891 LLDB_LOG(log,
"pid {0} mem {1:x}: failed to write. Error: {2}",
2896 if (bytes_written == 0) {
2897 LLDB_LOG(log,
"pid {0} mem {1:x}: wrote 0 of {2} requested bytes",
2921 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2948 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
2954 packet.
SetFilePos(strlen(
"qMemoryRegionInfo:"));
2975 response.
Printf(
"start:%" PRIx64
";size:%" PRIx64
";",
3019 if (std::optional<unsigned> protection_key = region_info.
GetProtectionKey())
3020 response.
Printf(
"protection-key:%" PRIu32
";", *protection_key);
3024 response.
Printf(
"type:%s;", is_stack ?
"stack" :
"heap");
3031struct UseBreakpoint {
3032 bool want_hardware =
false;
3034struct UseWatchpoint {
3036 static constexpr bool want_hardware =
true;
3038struct InvalidStoppoint {};
3040std::variant<UseBreakpoint, UseWatchpoint, InvalidStoppoint>
3042 switch (stoppoint_type) {
3044 return UseBreakpoint{
false};
3046 return UseBreakpoint{
true};
3048 return UseWatchpoint{ 1};
3050 return UseWatchpoint{ 2};
3052 return UseWatchpoint{ 3};
3054 return InvalidStoppoint();
3056 llvm_unreachable(
"unhandled GDBStoppointType");
3062 llvm::StringRef packet_str) {
3067 LLDB_LOG(log,
"failed, no process available");
3077 "Too short Z packet, missing software/hardware specifier"};
3081 std::variant<UseBreakpoint, UseWatchpoint, InvalidStoppoint> bp_variant =
3082 getBreakpointKind(stoppoint_type);
3083 if (std::holds_alternative<InvalidStoppoint>(bp_variant))
3085 "Z packet had invalid software/hardware specifier"};
3089 "Malformed Z packet, expecting comma after stoppoint type"};
3098 "Malformed Z packet, expecting comma after address"};
3101 const uint32_t size =
3102 packet.
GetHexMaxU32(
false, std::numeric_limits<uint32_t>::max());
3103 if (size == std::numeric_limits<uint32_t>::max())
3105 "Malformed Z packet, failed to parse size argument"};
3108 if (
auto *bp_kind = std::get_if<UseBreakpoint>(&bp_variant)) {
3111 if (
error.Success())
3114 LLDB_LOG(log,
"pid {0} failed to set breakpoint: {1}",
3120 auto wp_kind = std::get<UseWatchpoint>(bp_variant);
3122 addr, size, wp_kind.flags, wp_kind.want_hardware);
3123 if (
error.Success())
3126 LLDB_LOG(log,
"pid {0} failed to set watchpoint: {1}",
3133 llvm::StringRef packet_str) {
3138 LLDB_LOG(log,
"failed, no process available");
3148 "Too short z packet, missing software/hardware specifier"};
3152 std::variant<UseBreakpoint, UseWatchpoint, InvalidStoppoint> bp_variant =
3153 getBreakpointKind(stoppoint_type);
3154 if (std::holds_alternative<InvalidStoppoint>(bp_variant))
3156 "z packet had invalid software/hardware specifier"};
3160 "Malformed z packet, expecting comma after stoppoint type"};
3169 "Malformed z packet, expecting comma after address"};
3181 if (
auto *bp_kind = std::get_if<UseBreakpoint>(&bp_variant)) {
3184 if (
error.Success())
3187 LLDB_LOG(log,
"pid {0} failed to remove breakpoint: {1}",
3193 if (
error.Success())
3196 LLDB_LOG(log,
"pid {0} failed to remove watchpoint: {1}",
3206 using T = std::decay_t<
decltype(arg)>;
3207 static_assert(std::is_same_v<T, BreakpointOK> ||
3208 std::is_same_v<T, BreakpointError> ||
3209 std::is_same_v<T, BreakpointIllFormed>,
3210 "non-exhaustive visitor!");
3211 if constexpr (std::is_same_v<T, BreakpointOK>)
3213 else if constexpr (std::is_same_v<T, BreakpointError>)
3237 if (!packet_str.consume_front(
"jMultiBreakpoint:"))
3239 "Invalid jMultiBreakpoint packet prefix");
3241 llvm::Expected<llvm::json::Value> parsed = llvm::json::parse(packet_str);
3243 llvm::consumeError(parsed.takeError());
3245 "jMultiBreakpoint did not contain valid JSON");
3247 llvm::json::Object *request_dict = parsed->getAsObject();
3250 packet,
"jMultiBreakpoint did not contain a JSON dictionary");
3252 llvm::json::Array *request_array =
3253 request_dict->getArray(
"breakpoint_requests");
3257 "jMultiBreakpoint did not contain a valid 'breakpoint_requests' field");
3259 llvm::json::Array reply_array;
3260 for (
const llvm::json::Value &value : *request_array) {
3261 std::optional<llvm::StringRef> request = value.getAsString();
3264 "jMultiBreakpoint had a non-string entry");
3269 [&](
const auto &arg) {
3270 using T = std::decay_t<
decltype(arg)>;
3271 static_assert(std::is_same_v<T, BreakpointOK> ||
3272 std::is_same_v<T, BreakpointError> ||
3273 std::is_same_v<T, BreakpointIllFormed>,
3274 "non-exhaustive visitor!");
3275 if constexpr (std::is_same_v<T, BreakpointOK>)
3276 reply_array.push_back(
"OK");
3277 else if constexpr (std::is_same_v<T, BreakpointError>)
3278 reply_array.push_back(
3279 llvm::formatv(
"E{0:X-2}", arg.error_code).str());
3281 reply_array.push_back(
"E03");
3286 llvm::json::Object dict;
3287 dict.try_emplace(
"results", std::move(reply_array));
3290 stream.
AsRawOstream() << llvm::json::Value(std::move(dict));
3291 StringRef response_str = stream.
GetString();
3306 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
3344llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
3349 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3350 "No thread available");
3358 response.
Printf(
"<?xml version=\"1.0\"?>\n");
3359 response.
Printf(
"<target version=\"1.0\">\n");
3363 const llvm::StringRef arch_name =
3368 const llvm::StringRef new_arch_name = StringSwitch<llvm::StringRef>(arch_name)
3369 .Case(
"x86_64",
"i386:x86-64")
3370 .Case(
"riscv64",
"riscv:rv64")
3371 .Case(
"riscv32",
"riscv:rv32")
3372 .Default(arch_name);
3373 response.
Format(
"<architecture>{}</architecture>\n", new_arch_name);
3374 response.
Indent(
"<feature>\n");
3377 if (registers_count)
3380 std::unordered_set<std::string> register_types_emitted;
3381 for (
int reg_index = 0; reg_index < registers_count; reg_index++) {
3387 "%s failed to get register info for register index %" PRIu32,
3388 "target.xml", reg_index);
3396 response.
Printf(
"<reg name=\"%s\" bitsize=\"%" PRIu32
3397 "\" regnum=\"%d\" ",
3407 if (!encoding.empty())
3408 response <<
"encoding=\"" << encoding <<
"\" ";
3411 if (!format.empty())
3412 response <<
"format=\"" << format <<
"\" ";
3415 response <<
"type=\""
3419 const char *
const register_set_name =
3421 if (register_set_name)
3422 response <<
"group=\"" << register_set_name <<
"\" ";
3426 response.
Printf(
"ehframe_regnum=\"%" PRIu32
"\" ",
3431 response.
Printf(
"dwarf_regnum=\"%" PRIu32
"\" ",
3435 if (!kind_generic.empty())
3436 response <<
"generic=\"" << kind_generic <<
"\" ";
3446 response.
PutCString(
"invalidate_regnums=\"");
3454 if (registers_count)
3457 response.
Indent(
"</feature>\n");
3459 response.
Indent(
"</target>\n");
3460 return MemoryBuffer::getMemBufferCopy(response.
GetString(),
"target.xml");
3463llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>>
3465 llvm::StringRef annex) {
3469 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3470 "No process available");
3473 if (
object ==
"auxv") {
3476 if (!buffer_or_error)
3477 return llvm::errorCodeToError(buffer_or_error.getError());
3478 return std::move(*buffer_or_error);
3481 if (
object ==
"siginfo") {
3484 return llvm::createStringError(llvm::inconvertibleErrorCode(),
3485 "no current thread");
3487 auto buffer_or_error = thread->GetSiginfo();
3488 if (!buffer_or_error)
3489 return buffer_or_error.takeError();
3490 return std::move(*buffer_or_error);
3493 if (
object ==
"libraries-svr4") {
3496 return library_list.takeError();
3499 response.
Printf(
"<library-list-svr4 version=\"1.0\">");
3500 for (
auto const &library : *library_list) {
3501 response.
Printf(
"<library name=\"%s\" ",
3503 response.
Printf(
"lm=\"0x%" PRIx64
"\" ", library.link_map);
3504 response.
Printf(
"l_addr=\"0x%" PRIx64
"\" ", library.base_addr);
3505 response.
Printf(
"l_ld=\"0x%" PRIx64
"\" />", library.ld_addr);
3507 response.
Printf(
"</library-list-svr4>");
3508 return MemoryBuffer::getMemBufferCopy(response.
GetString(), __FUNCTION__);
3511 if (
object ==
"libraries") {
3514 return library_list.takeError();
3517 response.
Printf(
"<library-list>");
3518 for (
auto const &library : *library_list) {
3519 response.
Printf(
"<library name=\"%s\">",
3521 response.
Printf(
"<section address=\"0x%" PRIx64
"\"/>",
3523 response.
Printf(
"</library>");
3525 response.
Printf(
"</library-list>");
3526 return MemoryBuffer::getMemBufferCopy(response.
GetString(), __FUNCTION__);
3529 if (
object ==
"features" && annex ==
"target.xml")
3532 return llvm::make_error<UnimplementedError>();
3538 SmallVector<StringRef, 5> fields;
3540 StringRef(packet.
GetStringRef()).split(fields,
':', 4);
3541 if (fields.size() != 5)
3543 StringRef &xfer_object = fields[1];
3544 StringRef &xfer_action = fields[2];
3545 StringRef &xfer_annex = fields[3];
3547 if (xfer_action !=
"read")
3550 const uint64_t xfer_offset =
3551 offset_data.
GetHexMaxU64(
false, std::numeric_limits<uint64_t>::max());
3552 if (xfer_offset == std::numeric_limits<uint64_t>::max())
3555 if (offset_data.
GetChar() !=
',')
3557 "qXfer packet missing comma after offset");
3559 const uint64_t xfer_length =
3560 offset_data.
GetHexMaxU64(
false, std::numeric_limits<uint64_t>::max());
3561 if (xfer_length == std::numeric_limits<uint64_t>::max())
3565 std::string buffer_key = (xfer_object + xfer_action + xfer_annex).str();
3572 .insert(std::make_pair(buffer_key, std::move(*buffer_up)))
3578 bool done_with_buffer =
false;
3579 llvm::StringRef buffer = buffer_it->second->getBuffer();
3580 if (xfer_offset >= buffer.size()) {
3583 done_with_buffer =
true;
3586 buffer = buffer.drop_front(xfer_offset);
3589 if (xfer_length >= buffer.size()) {
3592 done_with_buffer =
true;
3596 buffer = buffer.take_front(xfer_length);
3602 if (done_with_buffer)
3614 packet.
SetFilePos(strlen(
"QSaveRegisterState"));
3621 packet,
"No thread specified in QSaveRegisterState packet");
3624 "No thread was is set with the Hg packet");
3634 LLDB_LOG(log,
"pid {0} failed to save all register values: {1}",
3645 assert((saved_registers->map.find(save_id) == saved_registers->map.end()) &&
3646 "GetNextRegisterSaveID() returned an existing register save id");
3647 saved_registers->map[save_id] = register_data_sp;
3652 response.
Printf(
"%" PRIu32, save_id);
3662 packet.
SetFilePos(strlen(
"QRestoreRegisterState:"));
3665 packet,
"QRestoreRegisterState packet missing register save id");
3667 const uint32_t save_id = packet.
GetU32(0);
3669 LLDB_LOG(log,
"QRestoreRegisterState packet has malformed save id, "
3670 "expecting decimal uint32_t");
3679 packet,
"No thread specified in QRestoreRegisterState packet");
3682 "No thread was is set with the Hg packet");
3694 auto it = saved_registers->map.find(save_id);
3695 if (it == saved_registers->map.end()) {
3697 "pid {0} does not have a register set save buffer for id {1}",
3701 register_data_sp = it->second;
3704 saved_registers->map.erase(it);
3709 LLDB_LOG(log,
"pid {0} failed to restore all register values: {1}",
3731 "vAttach failed to parse the process id");
3735 "GDBRemoteCommunicationServerLLGS::%s attempting to attach to "
3743 "GDBRemoteCommunicationServerLLGS::%s failed to attach to "
3744 "pid %" PRIu64
": %s\n",
3745 __FUNCTION__, pid,
error.AsCString());
3768 std::string process_name;
3771 "vAttachWait failed to parse process name");
3773 LLDB_LOG(log,
"attempting to attach to process named '{0}'", process_name);
3777 LLDB_LOG(log,
"failed to attach to process named '{0}': {1}", process_name,
3807 std::string process_name;
3810 "vAttachOrWait failed to parse process name");
3812 LLDB_LOG(log,
"attempting to attach to process named '{0}'", process_name);
3816 LLDB_LOG(log,
"failed to attach to process named '{0}': {1}", process_name,
3834 if (!s.consume_front(
"vRun;"))
3837 llvm::SmallVector<llvm::StringRef, 16> argv;
3840 for (llvm::StringRef hex_arg : argv) {
3845 LLDB_LOGF(log,
"LLGSPacketHandler::%s added arg: \"%s\"", __FUNCTION__,
3884 llvm::Error detach_error = llvm::Error::success();
3885 bool detached =
false;
3890 "GDBRemoteCommunicationServerLLGS::%s detaching %" PRId64,
3891 __FUNCTION__, it->first);
3892 if (llvm::Error e = it->second.process_up->Detach().ToError())
3893 detach_error = llvm::joinErrors(std::move(detach_error), std::move(e));
3924 packet.
SetFilePos(strlen(
"qThreadStopInfo"));
3928 "GDBRemoteCommunicationServerLLGS::%s failed, could not "
3929 "parse thread id from request \"%s\"",
3949 const bool threads_with_valid_stop_info_only =
false;
3950 llvm::Expected<json::Value> threads_info =
3952 if (!threads_info) {
3954 "failed to prepare a packet for pid {1}: {0}",
3973 LLDB_LOG(log,
"failed, no process available");
3977 std::vector<AddressSpaceInfo> address_spaces =
3979 if (address_spaces.empty())
3995 packet.
SetFilePos(strlen(
"qWatchpointSupportInfo"));
4004 if (hw_debug_cap == std::nullopt)
4005 response.
Printf(
"num:0;");
4007 response.
Printf(
"num:%d;", hw_debug_cap->second);
4020 packet.
SetFilePos(strlen(
"qFileLoadAddress:"));
4024 std::string file_name;
4037 response.
PutHex64(file_load_address);
4044 std::vector<int> signals;
4050 int signal = packet.
GetS32(-1, 16);
4053 signals.push_back(signal);
4056 char separator = packet.
GetChar();
4057 if (separator ==
'\0')
4059 if (separator !=
';')
4061 " expected semicolon.");
4085 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
4095 const char *current_char = packet.
Peek();
4096 if (!current_char || *current_char ==
',')
4101 char previous_char = packet.
GetChar();
4102 current_char = packet.
Peek();
4104 if (previous_char !=
',' || (current_char && *current_char ==
':'))
4106 "Invalid addr,length pair in qMemTags packet");
4110 packet,
"Too short qMemtags: packet (looking for length)");
4114 const char *invalid_type_err =
"Invalid type field in qMemTags: packet";
4120 const char *first_type_char = packet.
Peek();
4121 if (first_type_char && (*first_type_char ==
'+' || *first_type_char ==
'-'))
4128 packet.
GetU64(std::numeric_limits<uint64_t>::max(), 16);
4131 raw_type > std::numeric_limits<uint32_t>::max() ||
4140 uint32_t raw_type_32 = raw_type;
4141 int32_t type =
reinterpret_cast<int32_t &
>(raw_type_32);
4144 std::vector<uint8_t> tags;
4166 "GDBRemoteCommunicationServerLLGS::%s failed, no process available",
4176 const char *current_char = packet.
Peek();
4177 if (!current_char || *current_char ==
',')
4182 char previous_char = packet.
GetChar();
4183 current_char = packet.
Peek();
4185 if (previous_char !=
',' || (current_char && *current_char ==
':'))
4187 "Invalid addr,length pair in QMemTags packet");
4191 packet,
"Too short QMemtags: packet (looking for length)");
4195 const char *invalid_type_err =
"Invalid type field in QMemTags: packet";
4200 const char *first_type_char = packet.
Peek();
4201 if (first_type_char && (*first_type_char ==
'+' || *first_type_char ==
'-'))
4209 packet.
GetU64(std::numeric_limits<uint64_t>::max(), 16);
4210 if (raw_type > std::numeric_limits<uint32_t>::max())
4215 uint32_t raw_type_32 = raw_type;
4216 int32_t type =
reinterpret_cast<int32_t &
>(raw_type_32);
4221 "Missing tag data in QMemTags: packet");
4224 const char *invalid_data_err =
"Invalid tag data in QMemTags: packet";
4231 std::vector<uint8_t> tag_data;
4236 tag_data.resize(byte_count);
4237 size_t converted_bytes = packet.
GetHexBytes(tag_data, 0);
4238 if (converted_bytes != byte_count) {
4256 std::string path_hint;
4259 assert(packet_str.starts_with(
"qSaveCore"));
4260 if (packet_str.consume_front(
"qSaveCore;")) {
4261 for (
auto x : llvm::split(packet_str,
';')) {
4262 if (x.consume_front(
"path-hint:"))
4286 assert(packet_str.starts_with(
"QNonStop:"));
4287 packet_str.consume_front(
"QNonStop:");
4288 if (packet_str ==
"0") {
4292 if (process_it.second.process_up->IsRunning()) {
4294 Status error = process_it.second.process_up->Interrupt();
4297 "while disabling nonstop, failed to halt process {0}: {1}",
4298 process_it.first,
error);
4312 }
else if (packet_str ==
"1") {
4324 std::deque<std::string> &queue) {
4368 return interrupt_res;
4388 llvm::createStringError(
"no current process and no PID provided"));
4396 if (!new_process_it->second.process_up->GetThreadByID(tid))
4410 connection->Disconnect(&
error);
4412 if (
error.Success()) {
4414 "GDBRemoteCommunicationServerLLGS::%s disconnect process "
4415 "terminal stdio - SUCCESS",
4419 "GDBRemoteCommunicationServerLLGS::%s disconnect process "
4420 "terminal stdio - FAIL: %s",
4421 __FUNCTION__,
error.AsCString());
4440 else if (current_tid == 0) {
4452 "GDBRemoteCommunicationServerLLGS::%s gdb-remote parse "
4453 "error: expected ';' prior to start of thread suffix: packet "
4463 if (strncmp(packet.
Peek(),
"thread:", strlen(
"thread:")) != 0) {
4465 "GDBRemoteCommunicationServerLLGS::%s gdb-remote parse "
4466 "error: expected 'thread:' but not found, packet contents = "
4509 ->GetLoadedModuleFileSpec(module_path.c_str(), file_spec)
4520 llvm::StringRef value) {
4522 for (
const char &c : value) {
4548 const llvm::ArrayRef<llvm::StringRef> client_features) {
4549 std::vector<std::string> ret =
4551 ret.insert(ret.end(), {
4552 "QThreadSuffixSupported+",
4553 "QListThreadsInStopReply+",
4554 "qXfer:features:read+",
4556 "jMultiBreakpoint+",
4562 if (
bool(plugin_features & Extension::pass_signals))
4563 ret.push_back(
"QPassSignals+");
4564 if (
bool(plugin_features & Extension::auxv))
4565 ret.push_back(
"qXfer:auxv:read+");
4566 if (
bool(plugin_features & Extension::libraries_svr4))
4567 ret.push_back(
"qXfer:libraries-svr4:read+");
4568 if (
bool(plugin_features & Extension::libraries))
4569 ret.push_back(
"qXfer:libraries:read+");
4570 if (
bool(plugin_features & Extension::siginfo_read))
4571 ret.push_back(
"qXfer:siginfo:read+");
4572 if (
bool(plugin_features & Extension::memory_tagging))
4573 ret.push_back(
"memory-tagging+");
4574 if (
bool(plugin_features & Extension::savecore))
4575 ret.push_back(
"qSaveCore+");
4576 if (
bool(plugin_features & Extension::address_spaces)) {
4577 ret.push_back(
"address-spaces+");
4581 ret.push_back(
"accelerator-plugins+");
4582 if (
bool(plugin_features & Extension::lldb_settings))
4583 ret.push_back(
"lldb-settings+");
4587 for (llvm::StringRef x : client_features)
4589 llvm::StringSwitch<Extension>(x)
4590 .Case(
"multiprocess+", Extension::multiprocess)
4591 .Case(
"fork-events+", Extension::fork)
4592 .Case(
"vfork-events+", Extension::vfork)
4593 .Case(
"qXfer:libraries:read+", Extension::libraries)
4594 .Case(
"qXfer:libraries-svr4:read+", Extension::libraries_svr4)
4609 ret.push_back(
"multiprocess+");
4611 ret.push_back(
"fork-events+");
4613 ret.push_back(
"vfork-events+");
4639 response.
Format(
"p{0:x-}.", pid);
4640 response.
Format(
"{0:x-}", tid);
4645 bool reverse_connect) {
4647 if (std::optional<URI> url =
URI::Parse(url_arg)) {
4648 if (reverse_connect)
4649 return url_arg.str();
4654 std::string new_url = llvm::StringSwitch<std::string>(url->scheme)
4655 .Case(
"tcp",
"listen")
4656 .Case(
"unix",
"unix-accept")
4657 .Case(
"unix-abstract",
"unix-abstract-accept")
4658 .Default(url->scheme.str());
4659 llvm::append_range(new_url, url_arg.substr(url->scheme.size()));
4663 std::string host_port = url_arg.str();
4666 if (url_arg.starts_with(
":"))
4667 host_port.insert(0,
"localhost");
4671 return (reverse_connect ?
"connect://" :
"listen://") + host_port;
4674 return (reverse_connect ?
"unix-connect://" :
"unix-accept://") +
4679 std::unique_ptr<LLDBServerAcceleratorPlugin> plugin_up) {
4690 std::optional<LLDBSettings> settings =
4704 std::vector<AcceleratorActions> accelerator_actions;
4705 for (std::unique_ptr<lldb_server::LLDBServerAcceleratorPlugin> &plugin_up :
4707 if (
auto actions = plugin_up->GetInitializeActions())
4708 accelerator_actions.push_back(std::move(*actions));
4718 packet.
ConsumeFront(
"jAcceleratorPluginBreakpointHit:");
4719 llvm::Expected<AcceleratorBreakpointHitArgs> args =
4720 llvm::json::parse<AcceleratorBreakpointHitArgs>(
4721 packet.
Peek(),
"AcceleratorBreakpointHitArgs");
4725 for (std::unique_ptr<lldb_server::LLDBServerAcceleratorPlugin> &plugin_up :
4727 if (plugin_up->GetPluginName() == args->plugin_name) {
4728 llvm::Expected<AcceleratorBreakpointHitResponse> bp_response =
4729 plugin_up->BreakpointWasHit(*args);
4734 response.
PutAsJSON(*bp_response,
false);
4745 packet.
ConsumeFront(
"jAcceleratorPluginGetDynamicLoaderLibraryInfo:");
4746 llvm::Expected<AcceleratorDynamicLoaderArgs> args =
4747 llvm::json::parse<AcceleratorDynamicLoaderArgs>(
4748 packet.
Peek(),
"AcceleratorDynamicLoaderArgs");
4756 std::optional<AcceleratorDynamicLoaderResponse> response =
4767 for (std::unique_ptr<lldb_server::LLDBServerAcceleratorPlugin> &plugin_up :
4769 if (plugin_up->GetPluginName() == args->plugin_name) {
4770 std::optional<AcceleratorDynamicLoaderResponse> response =
4771 plugin_up->GetDynamicLoaderLibraryInfos(*args);
4789 if (!packet_str.consume_front(
"jThreadExtendedInfo:"))
4791 "Invalid jThreadExtendedInfo packet prefix");
4793 if (packet_str.empty())
4796 llvm::Expected<llvm::json::Value> parsed = llvm::json::parse(packet_str);
4798 llvm::consumeError(parsed.takeError());
4800 packet,
"jThreadExtendedInfo did not contain valid JSON");
4802 llvm::json::Object *request_dict = parsed->getAsObject();
4805 packet,
"jThreadExtendedInfo did not contain a JSON dictionary");
4807 std::optional<int64_t> thread_id = request_dict->getInteger(
"thread");
4810 "a valid 'thread' field");
4818 createStringErrorV(
"no thread with specified ID ({0:x})", *thread_id));
4824 ext_info->Dump(stream,
false);
4826 StringRef response_str = stream.
GetString();
static const size_t reg_size
static llvm::raw_ostream & error(Stream &strm)
static llvm::StringRef GetEncodingNameOrEmpty(const RegisterInfo ®_info)
static llvm::StringRef GetFormatNameOrEmpty(const RegisterInfo ®_info)
static void WriteRegisterValueInHexFixedWidth(StreamString &response, NativeRegisterContext ®_ctx, const RegisterInfo ®_info, const RegisterValue *reg_value_p, lldb::ByteOrder byte_order)
static void AppendHexValue(StreamString &response, const uint8_t *buf, uint32_t buf_size, bool swap)
static std::optional< json::Object > GetRegistersAsJSON(NativeThreadProtocol &thread)
static const char * GetStopReasonString(StopReason stop_reason)
static void CollectRegNums(const uint32_t *reg_num, StreamString &response, bool usehex)
static bool ResumeActionListStopsAllThreads(ResumeActionList &actions)
static llvm::StringRef GetKindGenericOrEmpty(const RegisterInfo ®_info)
static llvm::Expected< json::Array > GetJSONThreadsInfo(NativeProcessProtocol &process, bool abridged)
#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,...)
void swap(lldb_private::NonNullSharedPtr< T > &lhs, lldb_private::NonNullSharedPtr< T > &rhs)
Specialized swap function for NonNullSharedPtr to enable argument-dependent lookup (ADL) and efficien...
An architecture specification class.
virtual void SetConnection(std::unique_ptr< Connection > connection)
Sets the connection that it to be used by this class.
A uniqued constant string class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
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.
static FileSystem & Instance()
static bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info)
static uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info, ProcessInstanceInfoList &proc_infos)
virtual void RequestTermination()
LazyBool GetReadable() const
std::optional< unsigned > GetProtectionKey() const
ConstString GetName() const
LazyBool GetExecutable() const
LazyBool IsShadowStack() const
LazyBool GetWritable() const
LazyBool IsStackMemory() const
LazyBool GetMemoryTagged() const
virtual std::optional< WaitStatus > GetExitStatus()
virtual void SetEnabledExtensions(Extension flags)
Method called in order to propagate the bitmap of protocol extensions supported by the client.
lldb::pid_t GetID() const
lldb::StateType GetState() const
NativeThreadProtocol * GetThreadByID(lldb::tid_t tid)
virtual Status Resume(const ResumeActionList &resume_actions)=0
virtual bool HasPendingLibraryEvents()
lldb::tid_t GetCurrentThreadID() const
Extension
Extension flag constants, returned by Manager::GetSupportedExtensions() and passed to SetEnabledExten...
ThreadIterable Threads() const
uint32_t ConvertRegisterKindToRegisterNumber(uint32_t kind, uint32_t num) const
virtual uint32_t GetUserRegisterCount() const =0
virtual const RegisterInfo * GetRegisterInfoAtIndex(uint32_t reg) const =0
const char * GetRegisterSetNameForRegisterAtIndex(uint32_t reg_index) const
virtual Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp)=0
virtual Status ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value)=0
virtual bool RegisterOffsetIsDynamic() const
virtual Status ReadAllRegisterValues(lldb::WritableDataBufferSP &data_sp)=0
virtual std::vector< uint32_t > GetExpeditedRegisters(ExpeditedRegs expType) const
virtual Status WriteRegister(const RegisterInfo *reg_info, const RegisterValue ®_value)=0
An address in a process, qualified by an address space.
FileSpec & GetExecutableFile()
void SetNameMatchType(NameMatch name_match_type)
ProcessInstanceInfo & GetProcessInfo()
const std::string & GetID() const
virtual void ToXML(Stream &strm, std::unordered_set< std::string > &previously_emitted, const RegisterType *user=nullptr) const
Output XML that describes this type, to be inserted into a target XML file.
const void * GetBytes() const
uint32_t GetByteSize() const
const ResumeAction * GetActionForThread(lldb::tid_t tid, bool default_ok) const
void Append(const ResumeAction &action)
bool SetDefaultThreadActionIfNeeded(lldb::StateType action, int signal)
static llvm::Expected< HostAndPort > DecodeHostAndPort(llvm::StringRef host_and_port)
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
bool Fail() const
Test for error condition.
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.
int PutAsJSONArray(const std::vector< T > &array, bool hex_ascii)
const char * GetData() const
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 Indent(llvm::StringRef s="")
Indent the current line in the stream.
size_t size_t PutHex8(uint8_t uvalue)
Append an uint8_t value in the hexadecimal format to the stream.
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)
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
size_t PutBytesAsRawHex8(const void *src, size_t src_len, lldb::ByteOrder src_byte_order=lldb::eByteOrderInvalid, lldb::ByteOrder dst_byte_order=lldb::eByteOrderInvalid)
void IndentMore(unsigned amount=2)
Increment the current indentation level.
std::shared_ptr< Object > ObjectSP
virtual FileSpec FindModuleFile(const std::string &module_path, const ArchSpec &arch)
void RegisterMemberFunctionHandler(StringExtractorGDBRemote::ServerPacketType packet_type, PacketResult(T::*handler)(StringExtractorGDBRemote &packet))
static void CreateProcessInfoResponse_DebugServerStyle(const ProcessInstanceInfo &proc_info, StreamString &response)
Status m_process_launch_error
ProcessLaunchInfo m_process_launch_info
virtual std::vector< std::string > HandleFeatures(llvm::ArrayRef< llvm::StringRef > client_features)
GDBRemoteCommunicationServerCommon(llvm::StringRef name)
PacketResult Handle_QMemTags(StringExtractorGDBRemote &packet)
PacketResult Handle_qVAttachOrWaitSupported(StringExtractorGDBRemote &packet)
PacketResult Handle_vStdio(StringExtractorGDBRemote &packet)
GDBRemoteCommunicationServerLLGS(MainLoop &mainloop, NativeProcessProtocol::Manager &process_manager, llvm::StringRef name)
PacketResult HandleNotificationAck(std::deque< std::string > &queue)
PacketResult Handle_QSetDisableASLR(StringExtractorGDBRemote &packet)
void SetLaunchInfo(const ProcessLaunchInfo &info)
PacketResult SendONotification(const char *buffer, uint32_t len)
PacketResult Handle_D(StringExtractorGDBRemote &packet)
NativeProcessProtocol::Extension m_extensions_supported
PacketResult Handle_qMemTags(StringExtractorGDBRemote &packet)
void AddProcessThreads(StreamGDBRemote &response, NativeProcessProtocol &process, bool &had_any)
llvm::StringMap< std::unique_ptr< llvm::MemoryBuffer > > m_xfer_buffer_map
PacketResult SendStopReasonForState(NativeProcessProtocol &process, lldb::StateType process_state, bool force_synchronous)
std::vector< std::unique_ptr< lldb_server::LLDBServerAcceleratorPlugin > > m_accelerator_plugins
void EnqueueStopReplyPackets(lldb::tid_t thread_to_skip)
PacketResult Handle_jLLDBTraceGetBinaryData(StringExtractorGDBRemote &packet)
PacketResult Handle_qfThreadInfo(StringExtractorGDBRemote &packet)
StreamString PrepareStopReplyPacketForThread(NativeThreadProtocol &thread)
uint8_t m_reg_bytes[RegisterValue::kMaxRegisterByteSize]
PacketResult Handle__m(StringExtractorGDBRemote &packet)
GDBRemoteCommunication::PacketResult SendStructuredDataPacket(const llvm::json::Value &value)
PacketResult Handle_g(StringExtractorGDBRemote &packet)
std::variant< BreakpointOK, BreakpointIllFormed, BreakpointError > BreakpointResult
PacketResult Handle_jAddressSpacesInfo(StringExtractorGDBRemote &packet)
void RegisterPacketHandlers()
PacketResult Handle_qMemoryRegionInfoSupported(StringExtractorGDBRemote &packet)
PacketResult Handle_qThreadStopInfo(StringExtractorGDBRemote &packet)
BreakpointResult ExecuteRemoveBreakpoint(llvm::StringRef packet_str)
Core logic for a z (remove breakpoint/watchpoint) request.
PacketResult Handle_c(StringExtractorGDBRemote &packet)
PacketResult Handle_QThreadSuffixSupported(StringExtractorGDBRemote &packet)
PacketResult Handle_interrupt(StringExtractorGDBRemote &packet)
PacketResult Handle_vKill(StringExtractorGDBRemote &packet)
std::unordered_map< lldb::pid_t, DebuggedProcess > m_debugged_processes
void InitializeDelegate(NativeProcessProtocol *process) override
FileSpec FindModuleFile(const std::string &module_path, const ArchSpec &arch) override
std::string m_pending_output_buffer
PacketResult Handle_vAttachOrWait(StringExtractorGDBRemote &packet)
PacketResult Handle_vAttach(StringExtractorGDBRemote &packet)
PacketResult Handle_stop_reason(StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceSupported(StringExtractorGDBRemote &packet)
std::deque< std::string > m_stop_notification_queue
PacketResult Handle_qsThreadInfo(StringExtractorGDBRemote &packet)
PacketResult Handle_vStopped(StringExtractorGDBRemote &packet)
PacketResult Handle_z(StringExtractorGDBRemote &packet)
bool m_disabling_non_stop
lldb::tid_t GetContinueThreadID() const
PacketResult Handle_H(StringExtractorGDBRemote &packet)
void StopSTDIOForwarding()
PacketResult SendContinueSuccessResponse()
PacketResult Handle_jLLDBTraceGetState(StringExtractorGDBRemote &packet)
std::deque< std::string > m_stdio_notification_queue
void NewProcessOutput(NativeProcessProtocol *process, llvm::StringRef data) override
Forward a chunk of inferior stdout/stderr produced by the platform's own reader.
bool m_list_threads_in_stop_reply
bool m_address_space_suffix_supported
PacketResult Handle_qFileLoadAddress(StringExtractorGDBRemote &packet)
void NewSubprocess(NativeProcessProtocol *parent_process, std::unique_ptr< NativeProcessProtocol > child_process) override
PacketResult Handle_qC(StringExtractorGDBRemote &packet)
static std::string XMLEncodeAttributeValue(llvm::StringRef value)
NativeThreadProtocol * GetThreadFromSuffix(StringExtractorGDBRemote &packet)
Status SetSTDIOFileDescriptor(int fd)
lldb::tid_t GetCurrentThreadID() const
PacketResult Handle_QNonStop(StringExtractorGDBRemote &packet)
Status AttachToProcess(lldb::pid_t pid)
Attach to a process.
PacketResult Handle_jAcceleratorPluginBreakpointHit(StringExtractorGDBRemote &packet)
PacketResult SendWResponse(NativeProcessProtocol *process)
PacketResult Handle_s(StringExtractorGDBRemote &packet)
Status InitializeConnection(std::unique_ptr< Connection > connection)
bool m_thread_suffix_supported
void HandleInferiorState_Exited(NativeProcessProtocol *process)
lldb::tid_t m_continue_tid
PacketResult Handle_P(StringExtractorGDBRemote &packet)
PacketResult SendBreakpointResponse(StringExtractorGDBRemote &packet, const BreakpointResult &result)
Convert a BreakpointResult into a PacketResult, sending the appropriate response.
PacketResult Handle_qSaveCore(StringExtractorGDBRemote &packet)
NativeProcessProtocol * m_current_process
void HandleInferiorState_Stopped(NativeProcessProtocol *process)
BreakpointResult ExecuteSetBreakpoint(llvm::StringRef packet_str)
Core logic for a Z (set breakpoint/watchpoint) request.
NativeProcessProtocol * m_continue_process
PacketResult Handle_vCont(StringExtractorGDBRemote &packet)
PacketResult Handle_vCont_actions(StringExtractorGDBRemote &packet)
PacketResult Handle_vCtrlC(StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceStart(StringExtractorGDBRemote &packet)
Status LaunchProcess() override
Launch a process with the current launch settings.
PacketResult Handle_qGetWorkingDir(StringExtractorGDBRemote &packet)
void DataAvailableCallback()
PacketResult Handle_qStructuredDataPlugins(StringExtractorGDBRemote &packet)
PacketResult Handle_jThreadsInfo(StringExtractorGDBRemote &packet)
PacketResult Handle_M(StringExtractorGDBRemote &packet)
std::mutex m_pending_output_mutex
void FlushPendingProcessOutput()
Drain m_pending_output_buffer and emit a $O packet if the debuggee is currently in a running state.
void DidExec(NativeProcessProtocol *process) override
PacketResult Handle_memory_read(StringExtractorGDBRemote &packet)
Status AttachWaitProcess(llvm::StringRef process_name, bool include_existing)
Wait to attach to a process with a given name.
PacketResult Handle_vAttachWait(StringExtractorGDBRemote &packet)
PacketResult ResumeProcess(NativeProcessProtocol &process, const ResumeActionList &actions)
PacketResult Handle_QListThreadsInStopReply(StringExtractorGDBRemote &packet)
void InstallPlugin(std::unique_ptr< lldb_server::LLDBServerAcceleratorPlugin > plugin_up)
lldb_server::LLDBServerAcceleratorPlugin * m_connection_accelerator_plugin
The plugin that owns this accelerator connection.
PacketResult Handle_jLLDBSettings(StringExtractorGDBRemote &packet)
PacketResult Handle_jLLDBTraceStop(StringExtractorGDBRemote &packet)
PacketResult Handle_T(StringExtractorGDBRemote &packet)
PacketResult Handle_jThreadExtendedInfo(StringExtractorGDBRemote &packet)
Guarded< SavedRegisters, std::mutex > m_saved_registers
PacketResult Handle_QSetWorkingDir(StringExtractorGDBRemote &packet)
PacketResult Handle_k(StringExtractorGDBRemote &packet)
PacketResult Handle_qXfer(StringExtractorGDBRemote &packet)
PacketResult Handle_jMultiBreakpoint(StringExtractorGDBRemote &packet)
PacketResult SendStopReplyPacketForThread(NativeProcessProtocol &process, lldb::tid_t tid, bool force_synchronous)
void StartSTDIOForwarding()
PacketResult Handle_C(StringExtractorGDBRemote &packet)
PacketResult Handle__M(StringExtractorGDBRemote &packet)
PacketResult Handle_jAcceleratorPluginGetDynamicLoaderLibraryInfo(StringExtractorGDBRemote &packet)
void AppendThreadIDToResponse(Stream &response, lldb::pid_t pid, lldb::tid_t tid)
std::vector< std::string > HandleFeatures(const llvm::ArrayRef< llvm::StringRef > client_features) override
void ClearProcessSpecificData()
PacketResult Handle_Z(StringExtractorGDBRemote &packet)
PacketResult Handle_QPassSignals(StringExtractorGDBRemote &packet)
PacketResult Handle_qWatchpointSupportInfo(StringExtractorGDBRemote &packet)
void ProcessStateChanged(NativeProcessProtocol *process, lldb::StateType state) override
lldb::tid_t m_current_tid
void SetEnabledExtensions(NativeProcessProtocol &process)
PacketResult Handle_QRestoreRegisterState(StringExtractorGDBRemote &packet)
NativeProcessProtocol::Manager & m_process_manager
void SetContinueThreadID(lldb::tid_t tid)
PacketResult Handle_p(StringExtractorGDBRemote &packet)
PacketResult Handle_qRegisterInfo(StringExtractorGDBRemote &packet)
void SetCurrentThreadID(lldb::tid_t tid)
PacketResult Handle_qProcessInfo(StringExtractorGDBRemote &packet)
PacketResult Handle_vRun(StringExtractorGDBRemote &packet)
MainLoop::ReadHandleUP m_stdio_handle_up
void MaybeCloseInferiorTerminalConnection()
PacketResult Handle_jAcceleratorPluginInitialize(StringExtractorGDBRemote &packet)
MainLoop::ReadHandleUP m_network_handle_up
PacketResult Handle_qMemoryRegionInfo(StringExtractorGDBRemote &packet)
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > ReadXferObject(llvm::StringRef object, llvm::StringRef annex)
PacketResult Handle_QSaveRegisterState(StringExtractorGDBRemote &packet)
std::recursive_mutex m_debugged_process_mutex
uint32_t GetNextSavedRegistersID()
Communication m_stdio_communication
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > BuildTargetXml()
PacketResult Handle_I(StringExtractorGDBRemote &packet)
void RegisterPacketHandler(StringExtractorGDBRemote::ServerPacketType packet_type, PacketHandler handler)
PacketResult SendErrorResponse(const Status &error)
PacketResult SendIllFormedResponse(const StringExtractorGDBRemote &packet, const char *error_message)
PacketResult GetPacketAndSendResponse(Timeout< std::micro > timeout, Status &error, bool &interrupt, bool &quit)
PacketResult SendJSONResponse(const llvm::json::Value &value)
Serialize and send a JSON object response.
PacketResult SendUnimplementedResponse(const char *packet)
PacketResult SendOKResponse()
PacketResult SendNotificationPacketNoLock(llvm::StringRef notify_type, std::deque< std::string > &queue, llvm::StringRef payload)
PacketResult SendPacketNoLock(llvm::StringRef payload)
#define LLDB_REGNUM_GENERIC_RA
#define LLDB_REGNUM_GENERIC_ARG8
#define LLDB_INVALID_SIGNAL_NUMBER
#define LLDB_INVALID_THREAD_ID
#define LLDB_REGNUM_GENERIC_ARG6
#define LLDB_REGNUM_GENERIC_SP
#define LLDB_REGNUM_GENERIC_ARG4
#define LLDB_REGNUM_GENERIC_ARG3
#define LLDB_REGNUM_GENERIC_ARG1
#define LLDB_REGNUM_GENERIC_ARG7
#define LLDB_REGNUM_GENERIC_FLAGS
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_REGNUM
#define LLDB_REGNUM_GENERIC_TP
#define LLDB_INVALID_PROCESS_ID
#define LLDB_DEFAULT_ADDRESS_SPACE_ID
#define LLDB_REGNUM_GENERIC_ARG2
#define LLDB_REGNUM_GENERIC_PC
#define LLDB_REGNUM_GENERIC_FP
#define LLDB_REGNUM_GENERIC_ARG5
lldb::ByteOrder InlHostByteOrder()
std::string LLGSArgToURL(llvm::StringRef url_arg, bool reverse_connect)
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.
bool StateIsRunningState(lldb::StateType state)
Check if a state represents a state where the process or thread is running.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::vector< ProcessInstanceInfo > ProcessInstanceInfoList
std::shared_ptr< lldb_private::IOObject > IOObjectSP
ConnectionStatus
Connection Status Types.
@ eConnectionStatusError
Check GetError() for details.
@ eConnectionStatusInterrupted
Interrupted read.
@ eConnectionStatusTimedOut
Request timed out.
@ eConnectionStatusEndOfFile
End-of-file encountered.
@ eConnectionStatusSuccess
Success.
@ eConnectionStatusLostConnection
Lost connection while connected to a valid connection.
@ eConnectionStatusNoConnection
No connection.
@ eFormatCString
Null-terminated C strings.
@ eFormatCharArray
Print characters with no single quotes, used for character arrays that can contain non printable char...
@ eFormatInstruction
Disassemble an opcode.
@ eFormatVoid
Do not print this.
@ eFormatComplex
Floating point complex type.
@ eFormatHexFloat
ISO C99 hex float string.
@ eFormatOSType
OS character codes encoded into an integer 'PICT' 'text' etc...
@ eFormatAddressInfo
Describe what an address points to (func + offset with file/line, symbol + offset,...
@ eFormatCharPrintable
Only printable characters, '.' if not printable.
@ eFormatComplexInteger
Integer complex type.
@ eFormatFloat128
Disambiguate between 128-bit long double (which uses eFormatFloat) and __float128 (which uses eFormat...
StateType
Process and Thread States.
@ eStateUnloaded
Process is object is valid, but not currently loaded.
@ eStateDetached
Process has been detached and can't be examined.
@ eStateStopped
Process or thread is stopped and can be examined.
@ eStateSuspended
Process or thread is in a suspended state as far as the debugger is concerned while other processes o...
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateLaunching
Process is in the process of launching.
@ eStateAttaching
Process is currently trying to attach.
@ eStateExited
Process has exited and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
@ eStateCrashed
Process or thread has crashed and can be examined.
@ eEncodingVector
vector registers
@ eEncodingUint
unsigned integer
@ eEncodingSint
signed integer
ByteOrder
Byte ordering definitions.
std::shared_ptr< lldb_private::DataBuffer > DataBufferSP
std::shared_ptr< lldb_private::WritableDataBuffer > WritableDataBufferSP
StopReason
Thread stop reasons.
@ eStopReasonInstrumentation
@ eStopReasonPlanComplete
@ eStopReasonDynamicLoader
Indicates that execution stopped so a dynamic-loader plugin can update the loaded libraries.
@ eStopReasonHistoryBoundary
@ eStopReasonExec
Program was re-exec'ed.
@ eStopReasonInterrupt
Thread requested interrupt.
@ eStopReasonProcessorTrace
@ eStopReasonThreadExiting
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
@ eRegisterKindDWARF
the register numbers seen DWARF
@ eRegisterKindEHFrame
the register numbers seen in eh_frame
Terminal window dimensions to use when the launcher creates a pseudo-terminal for the inferior's stdi...
BaseType GetRangeBase() const
SizeType GetByteSize() const
Every register is described in detail including its name, alternate name (optional),...
lldb::Encoding encoding
Encoding of the register bits.
const char * alt_name
Alternate name of this register, can be NULL.
uint32_t * value_regs
List of registers (terminated with LLDB_INVALID_REGNUM).
uint32_t byte_offset
The byte offset in the register context data where this register's value is found.
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.
const RegisterType * register_type
If not nullptr, a type defined by XML descriptions.
const char * name
Name of this register, can't be NULL.
lldb::Format format
Default display format.
uint32_t * invalidate_regs
List of registers (terminated with LLDB_INVALID_REGNUM).
struct lldb_private::ThreadStopInfo::@116236113001137253323017204263037302160273237376::@034237007264067231263360140073224264215170222231 exception
struct lldb_private::ThreadStopInfo::@116236113001137253323017204263037302160273237376::@075376350020015165106375110034031012204332263127 fork
union lldb_private::ThreadStopInfo::@116236113001137253323017204263037302160273237376 details
static std::optional< URI > Parse(llvm::StringRef uri)