45#define LLDB_OPTIONS_thread_backtrace
46#include "CommandOptions.inc"
65 switch (short_option) {
67 if (option_arg.getAsInteger(0,
m_count)) {
70 "invalid integer value for option '%c': %s", short_option,
78 if (option_arg.getAsInteger(0,
m_start))
80 "invalid integer value for option '%c': %s", short_option,
89 "invalid boolean value for option '%c': %s", short_option,
98 llvm::StringRef trimmed = option_arg.trim();
99 if (trimmed ==
"*" || trimmed.equals_insensitive(
"all")) {
105 std::string option_lower = option_arg.lower();
106 static constexpr llvm::StringLiteral range_specifiers[] = {
"-",
"to"};
108 llvm::StringRef range_from;
109 llvm::StringRef range_to;
110 bool is_range =
false;
113 for (
auto specifier : range_specifiers) {
114 size_t idx = option_lower.find(specifier);
115 if (idx == std::string::npos)
118 range_from = llvm::StringRef(option_lower).take_front(idx).trim();
119 range_to = llvm::StringRef(option_lower)
120 .drop_front(idx + specifier.size())
123 if (!range_from.empty() && !range_to.empty()) {
133 "invalid start provider ID for option '%c': %s", short_option,
139 "invalid end provider ID for option '%c': %s", short_option,
147 "invalid provider range for option '%c': start ID %u > end "
156 "invalid provider ID for option '%c': %s", short_option,
166 llvm_unreachable(
"Unimplemented option");
183 return g_thread_backtrace_options;
199 interpreter,
"thread backtrace",
200 "Show backtraces of thread call stacks. Defaults to the current "
201 "thread, thread indexes can be specified as arguments.\n"
202 "Use the thread-index \"all\" to see all threads.\n"
203 "Use the thread-index \"unique\" to see threads grouped by unique "
205 "Use '--provider <id>' or '--provider <start>-<end>' to view "
206 "synthetic frame providers (0=base unwinder, 1+=synthetic). "
207 "Range specifiers '-', 'to', 'To', 'TO' are supported.\n"
208 "Use 'settings set frame-format' to customize the printing of "
209 "frames in the backtrace and 'settings set thread-format' to "
210 "customize the thread header.\n"
211 "Customizable frame recognizers may filter out less interesting "
212 "frames, which results in gaps in the numbering. "
213 "Use '-u' to see all frames.",
215 eCommandRequiresProcess | eCommandRequiresThread |
216 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
217 eCommandProcessMustBePaused) {}
224 uint32_t index)
override {
225 llvm::StringRef count_opt(
"--count");
226 llvm::StringRef start_opt(
"--start");
233 Args copy_args(current_args);
236 size_t count_idx = 0;
237 size_t start_idx = 0;
238 size_t count_val = 0;
239 size_t start_val = 0;
241 for (
size_t idx = 0; idx < num_entries; idx++) {
242 llvm::StringRef arg_string = copy_args[idx].ref();
243 if (arg_string ==
"-c" || count_opt.starts_with(arg_string)) {
245 if (idx == num_entries)
248 if (copy_args[idx].ref().getAsInteger(0, count_val))
250 }
else if (arg_string ==
"-s" || start_opt.starts_with(arg_string)) {
252 if (idx == num_entries)
255 if (copy_args[idx].ref().getAsInteger(0, start_val))
262 std::string new_start_val = llvm::formatv(
"{0}", start_val + count_val);
263 if (start_idx == 0) {
269 std::string repeat_command;
272 return repeat_command;
280 const std::vector<ConstString> &types =
282 for (
auto type : types) {
284 thread->shared_from_this(), type);
285 if (ext_thread_sp && ext_thread_sp->IsValid()) {
286 const uint32_t num_frames_with_source = 0;
287 const bool stop_format =
false;
289 if (ext_thread_sp->GetStatus(strm,
m_options.m_start,
291 num_frames_with_source, stop_format,
302 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
305 "thread disappeared while computing backtraces: 0x%" PRIx64, tid);
309 Thread *thread = thread_sp.get();
313 if (
m_options.m_provider_specific_backtrace) {
318 if (thread->IsAnyProviderActive()) {
320 "cannot use '--provider' option while a scripted frame provider is "
321 "being constructed on this thread");
327 thread->GetStatus(strm, 0, 0,
334 const auto &chain = thread->GetProviderChainIds();
335 m_options.m_provider_end_id = chain.empty() ? 0 : chain.back().second;
339 bool first_provider =
true;
341 provider_id <=
m_options.m_provider_end_id; ++provider_id) {
345 thread->GetFrameListByIdentifier(provider_id);
347 if (!frame_list_sp) {
355 first_provider =
false;
358 strm.
Printf(
"=== Provider %u", provider_id);
361 if (provider_id == 0) {
365 const auto &provider_chain = thread->GetProviderChainIds();
366 std::string provider_name =
"Unknown";
367 std::string provider_desc;
368 std::optional<uint32_t> provider_priority;
370 for (
const auto &[descriptor,
id] : provider_chain) {
371 if (
id == provider_id) {
372 provider_name = descriptor.GetName().str();
373 provider_desc = descriptor.GetDescription();
374 provider_priority = descriptor.GetPriority();
379 strm.
Printf(
": %s", provider_name.c_str());
380 if (provider_priority.has_value()) {
381 strm.
Printf(
" (priority: %u)", *provider_priority);
385 if (!provider_desc.empty()) {
386 strm.
Printf(
"Description: %s\n", provider_desc.c_str());
391 const uint32_t num_frames_with_source = 0;
394 const char *selected_frame_marker = selected_frame_sp ?
"->" :
nullptr;
396 size_t num_frames = frame_list_sp->GetStatus(
398 true, num_frames_with_source,
401 selected_frame_marker);
403 if (num_frames == 0) {
408 if (first_provider) {
419 const uint32_t num_frames_with_source = 0;
420 const bool stop_format =
true;
422 num_frames_with_source, stop_format,
423 !
m_options.m_filtered_backtrace, only_stacks)) {
425 "error displaying backtrace for thread: \"0x%4.4x\"",
426 thread->GetIndexID());
431 "Interrupt skipped extended backtrace")) {
442#define LLDB_OPTIONS_thread_step_scope
443#include "CommandOptions.inc"
456 return llvm::ArrayRef(g_thread_step_scope_options);
462 const int short_option =
463 g_thread_step_scope_options[option_idx].short_option;
465 switch (short_option) {
468 bool avoid_no_debug =
472 "invalid boolean value for option '%c': %s", short_option,
481 bool avoid_no_debug =
485 "invalid boolean value for option '%c': %s", short_option,
495 "invalid integer value for option '%c': %s", short_option,
506 if (option_arg ==
"block") {
512 "invalid end line number '%s'", option_arg.str().c_str());
526 llvm_unreachable(
"Unimplemented option");
541 if (process_sp && process_sp->GetSteppingRunsAllThreads())
565 const char *name,
const char *help,
569 eCommandRequiresProcess | eCommandRequiresThread |
570 eCommandTryTargetAPILock |
571 eCommandProcessMustBeLaunched |
572 eCommandProcessMustBePaused),
607 if (thread ==
nullptr) {
608 result.
AppendError(
"no selected thread in process");
613 uint32_t step_thread_idx;
615 if (!llvm::to_integer(thread_idx_cstr, step_thread_idx)) {
622 if (thread ==
nullptr) {
624 "Thread index %u is out of range (valid values are 0 - %u)",
625 step_thread_idx, num_threads);
634 }
else if (!
GetDebugger().GetScriptInterpreter()->CheckObjectExists(
637 "class for scripted step: \"%s\" does not exist",
646 "end line option is only valid for step into");
650 const bool abort_other_plans =
false;
655 bool bool_stop_other_threads;
657 bool_stop_other_threads =
false;
661 bool_stop_other_threads =
true;
666 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
667 assert(frame !=
nullptr);
671 llvm::Expected<lldb::ThreadPlanSP> frame_plan_result =
673 if (
auto llvm_err = frame_plan_result.takeError()) {
675 "scripted frame provider got an error "
676 "while constructing step plan: \"%s\"",
677 llvm::toString(std::move(llvm_err)).c_str());
680 new_plan_sp = *frame_plan_result;
684 thread->QueueThreadPlan(new_plan_sp, abort_other_plans);
685 new_plan_sp->SetStopOthers(bool_stop_other_threads);
696 llvm::toString(std::move(err)));
699 }
else if (
m_options.m_end_line_is_block_end) {
712 "Could not find the current block address");
725 new_plan_sp = thread->QueueThreadPlanForStepInRange(
726 abort_other_plans, range,
728 m_options.m_step_in_target, stop_other_threads, new_plan_status,
732 if (new_plan_sp && !
m_options.m_avoid_regexp.empty()) {
739 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
740 false, abort_other_plans, bool_stop_other_threads,
745 new_plan_sp = thread->QueueThreadPlanForStepOverRange(
749 stop_other_threads, new_plan_status,
752 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
753 true, abort_other_plans, bool_stop_other_threads,
756 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
757 false, abort_other_plans, bool_stop_other_threads, new_plan_status);
759 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
760 true, abort_other_plans, bool_stop_other_threads, new_plan_status);
762 new_plan_sp = thread->QueueThreadPlanForStepOut(
763 abort_other_plans,
nullptr,
false, bool_stop_other_threads,
766 new_plan_status,
m_options.m_step_out_avoid_no_debug);
770 new_plan_sp = thread->QueueThreadPlanForStepScripted(
771 abort_other_plans, scripted_metadata, bool_stop_other_threads,
784 new_plan_sp->SetIsControllingPlan(
true);
785 new_plan_sp->SetOkayToDiscard(
false);
788 if (!new_plan_sp->SetIterationCount(
m_options.m_step_count)) {
790 "step operation does not support iteration count");
800 if (synchronous_execution)
805 if (!
error.Success()) {
815 process->
SyncIOHandler(iohandler_id, std::chrono::seconds(2));
817 if (synchronous_execution) {
830 result.
SetError(std::move(new_plan_status));
846 interpreter,
"thread continue",
847 "Continue execution of the current target process. One "
848 "or more threads may be specified, by default all "
851 eCommandRequiresThread | eCommandTryTargetAPILock |
852 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
862 if (process ==
nullptr) {
863 result.
AppendError(
"no process exists. Cannot continue");
875 std::lock_guard<std::recursive_mutex> guard(
878 std::vector<Thread *> resume_threads;
879 for (
auto &entry : command.
entries()) {
881 if (entry.ref().getAsInteger(0, thread_idx)) {
883 "invalid thread index argument: \"%s\"", entry.c_str());
890 resume_threads.push_back(thread);
897 if (resume_threads.empty()) {
898 result.
AppendError(
"no valid thread indexes were specified");
902 if (resume_threads.size() == 1)
903 strm <<
"Resuming thread: ";
905 strm <<
"Resuming threads: ";
907 for (uint32_t idx = 0; idx < num_threads; ++idx) {
910 std::vector<Thread *>::iterator this_thread_pos =
911 find(resume_threads.begin(), resume_threads.end(), thread);
913 if (this_thread_pos != resume_threads.end()) {
914 resume_threads.erase(this_thread_pos);
915 if (!resume_threads.empty())
916 strm << llvm::formatv(
"{0}, ", thread->GetIndexID());
918 strm << llvm::formatv(
"{0} ", thread->GetIndexID());
920 const bool override_suspend =
true;
932 std::lock_guard<std::recursive_mutex> guard(
936 if (current_thread ==
nullptr) {
937 result.
AppendError(
"the process doesn't have a current thread");
941 for (uint32_t idx = 0; idx < num_threads; ++idx) {
943 if (thread == current_thread) {
945 "Resuming thread {0:x4} in process {1}", thread->GetID(),
947 const bool override_suspend =
true;
957 if (synchronous_execution)
963 if (
error.Success()) {
966 if (synchronous_execution) {
983 "Process cannot be continued from its current state (%s)",
991#define LLDB_OPTIONS_thread_until
992#include "CommandOptions.inc"
1014 switch (short_option) {
1018 if (
error.Success())
1025 option_arg.str().c_str());
1032 option_arg.str().c_str());
1040 if (
error.Success()) {
1048 llvm_unreachable(
"Unimplemented option");
1061 return llvm::ArrayRef(g_thread_until_options);
1072 interpreter,
"thread until",
1073 "Continue until a line number or address is reached by the "
1074 "current or specified thread. Stops when returning from "
1075 "the current function as a safety measure. "
1076 "The target line number(s) are given as arguments, and if more "
1078 " is provided, stepping will stop when the first one is hit.",
1080 eCommandRequiresThread | eCommandTryTargetAPILock |
1081 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1091 bool synchronous_execution =
m_interpreter.GetSynchronous();
1096 if (process ==
nullptr) {
1097 result.
AppendError(
"need a valid process to step");
1099 Thread *thread =
nullptr;
1100 std::vector<uint32_t> line_numbers;
1104 for (
size_t i = 0; i < num_args; i++) {
1105 uint32_t line_number;
1111 line_numbers.push_back(line_number);
1113 }
else if (
m_options.m_until_addrs.empty()) {
1127 if (thread ==
nullptr) {
1130 "Thread index %u is out of range (valid values are 0 - %u)",
1135 const bool abort_other_plans =
false;
1138 thread->GetStackFrameAtIndex(
m_options.m_frame_idx).get();
1139 if (frame ==
nullptr) {
1141 "Frame index %u is out of range for thread id %" PRIu64,
1142 m_options.m_frame_idx, thread->GetID());
1157 if (line_table ==
nullptr) {
1159 "frame %u of thread id %" PRIu64,
1160 m_options.m_frame_idx, thread->GetID());
1165 std::vector<addr_t> address_list;
1171 "function info - can't get until range");
1178 line_idx_ranges.
Append(begin, end - begin);
1180 line_idx_ranges.
Sort();
1182 bool found_something =
false;
1188 for (uint32_t line_number : line_numbers) {
1195 found_something =
true;
1196 line_number = line_entry.
line;
1201 exact, &line_entry);
1202 while (idx < end_func_idx) {
1207 address_list.push_back(address);
1210 exact, &line_entry);
1218 address_list.push_back(address);
1221 if (address_list.empty()) {
1222 if (found_something)
1224 "Until target outside of the current function");
1227 "No line entries matching until target");
1232 new_plan_sp = thread->QueueThreadPlanForStepUntil(
1233 abort_other_plans, address_list,
m_options.m_stop_others,
1234 m_options.m_frame_idx, new_plan_status);
1241 new_plan_sp->SetIsControllingPlan(
true);
1242 new_plan_sp->SetOkayToDiscard(
false);
1244 result.
SetError(std::move(new_plan_status));
1249 " has no debug information",
1250 m_options.m_frame_idx, thread->GetID());
1256 "Failed to set the selected thread to thread id %" PRIu64,
1263 if (synchronous_execution)
1268 if (
error.Success()) {
1271 if (synchronous_execution) {
1294#define LLDB_OPTIONS_thread_select
1295#include "CommandOptions.inc"
1311 const int short_option = g_thread_select_options[option_idx].short_option;
1312 switch (short_option) {
1317 option_arg.str().c_str());
1323 llvm_unreachable(
"Unimplemented option");
1330 return llvm::ArrayRef(g_thread_select_options);
1338 "Change the currently selected thread.",
1339 "thread select <thread-index> (or -t <thread-id>)",
1340 eCommandRequiresProcess | eCommandTryTargetAPILock |
1341 eCommandProcessMustBeLaunched |
1342 eCommandProcessMustBePaused) {
1353 arg.push_back(thread_idx_arg);
1380 if (process ==
nullptr) {
1386 "'%s' takes exactly one thread index argument, or a thread ID "
1387 "option:\nUsage: %s",
1393 "and a thread index argument:\nUsage: %s",
1398 Thread *new_thread =
nullptr;
1407 if (new_thread ==
nullptr) {
1415 if (new_thread ==
nullptr) {
1436 interpreter,
"thread list",
1437 "Show a summary of each thread in the current target process. "
1438 "Use 'settings set thread-format' to customize the individual "
1441 eCommandRequiresProcess | eCommandTryTargetAPILock |
1442 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1451 const bool only_threads_with_stop_reason =
false;
1452 const uint32_t start_frame = 0;
1453 const uint32_t num_frames = 0;
1454 const uint32_t num_frames_with_source = 0;
1456 process->
GetThreadStatus(strm, only_threads_with_stop_reason, start_frame,
1457 num_frames, num_frames_with_source,
false);
1462#define LLDB_OPTIONS_thread_info
1463#include "CommandOptions.inc"
1484 switch (short_option) {
1498 llvm_unreachable(
"Unimplemented option");
1504 return llvm::ArrayRef(g_thread_info_options);
1514 interpreter,
"thread info",
1515 "Show an extended summary of one or "
1516 "more threads. Defaults to the "
1519 eCommandRequiresProcess | eCommandTryTargetAPILock |
1520 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1538 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1544 Thread *thread = thread_sp.get();
1545 if (
m_options.m_backing_thread && thread->GetBackingThread())
1546 thread = thread->GetBackingThread().get();
1553 thread->GetIndexID());
1568 interpreter,
"thread exception",
1569 "Display the current exception object for a thread. Defaults to "
1570 "the current thread.",
1572 eCommandRequiresProcess | eCommandTryTargetAPILock |
1573 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1587 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1594 ValueObjectSP exception_object_sp = thread_sp->GetCurrentException();
1595 if (exception_object_sp) {
1596 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1602 ThreadSP exception_thread_sp = thread_sp->GetCurrentExceptionBacktrace();
1603 if (exception_thread_sp && exception_thread_sp->IsValid()) {
1604 const uint32_t num_frames_with_source = 0;
1605 const bool stop_format =
false;
1606 exception_thread_sp->GetStatus(strm, 0,
UINT32_MAX,
1607 num_frames_with_source, stop_format,
1619 interpreter,
"thread siginfo",
1620 "Display the current siginfo object for a thread. Defaults to "
1621 "the current thread.",
1623 eCommandRequiresProcess | eCommandTryTargetAPILock |
1624 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1638 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1647 thread_sp->GetIndexID());
1650 ValueObjectSP exception_object_sp = thread_sp->GetSiginfoValue();
1651 if (exception_object_sp) {
1652 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1665#define LLDB_OPTIONS_thread_return
1666#include "CommandOptions.inc"
1685 switch (short_option) {
1694 "invalid boolean value '%s' for 'x' option",
1695 option_arg.str().c_str());
1699 llvm_unreachable(
"Unimplemented option");
1709 return llvm::ArrayRef(g_thread_return_options);
1719 "Prematurely return from a stack frame, "
1720 "short-circuiting execution of newer frames "
1721 "and optionally yielding a specified value. Defaults "
1722 "to the exiting the current stack "
1725 eCommandRequiresFrame | eCommandTryTargetAPILock |
1726 eCommandProcessMustBeLaunched |
1727 eCommandProcessMustBePaused) {
1741 if (command.starts_with(
"-x")) {
1742 if (command.size() != 2U)
1743 result.
AppendWarning(
"return values ignored when returning from user "
1744 "called expressions");
1748 error = thread->UnwindInnermostExpression();
1749 if (!
error.Success()) {
1761 "Could not select 0th frame after unwinding expression");
1770 uint32_t frame_idx = frame_sp->GetFrameIndex();
1772 if (frame_sp->IsInlined()) {
1773 result.
AppendError(
"don't know how to return from inlined frames");
1777 if (!command.empty()) {
1786 return_valobj_sp, options);
1788 if (return_valobj_sp)
1790 "Error evaluating result expression: %s",
1791 return_valobj_sp->GetError().AsCString());
1794 "Unknown error evaluating result expression");
1801 const bool broadcast =
true;
1802 error = thread_sp->ReturnFromFrame(frame_sp, return_valobj_sp, broadcast);
1803 if (!
error.Success()) {
1805 "Error returning from frame %d of thread %d: %s", frame_idx,
1806 thread_sp->GetIndexID(),
error.AsCString());
1817#define LLDB_OPTIONS_thread_jump
1818#include "CommandOptions.inc"
1841 switch (short_option) {
1850 option_arg.str().c_str());
1853 option_arg.consume_front(
"+");
1857 option_arg.str().c_str());
1868 llvm_unreachable(
"Unimplemented option");
1874 return llvm::ArrayRef(g_thread_jump_options);
1886 interpreter,
"thread jump",
1887 "Sets the program counter to a new address.",
"thread jump",
1888 eCommandRequiresFrame | eCommandTryTargetAPILock |
1889 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1914 if (!reg_ctx->
SetPC(callAddr)) {
1916 thread->GetIndexID());
1921 int32_t line = (int32_t)
m_options.m_line_num;
1927 if (
m_options.m_filenames.GetSize() == 1)
1928 file =
m_options.m_filenames.GetFileSpecAtIndex(0);
1932 "no source file available for the current location");
1936 std::string warnings;
1937 Status err = thread->JumpToLine(file, line,
m_options.m_force, &warnings);
1944 if (!warnings.empty())
1957#define LLDB_OPTIONS_thread_plan_list
1958#include "CommandOptions.inc"
1976 switch (short_option) {
1982 if (option_arg.getAsInteger(0, tid))
1984 option_arg.str().c_str());
1994 llvm_unreachable(
"Unimplemented option");
2008 return llvm::ArrayRef(g_thread_plan_list_options);
2020 interpreter,
"thread plan list",
2021 "Show thread plans for one or more threads. If no threads are "
2022 "specified, show the "
2023 "current thread. Use the thread-index \"all\" to see all threads.",
2025 eCommandRequiresProcess | eCommandRequiresThread |
2026 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2027 eCommandProcessMustBePaused) {}
2040 m_exe_ctx.GetProcessPtr()->DumpThreadPlans(
2071 if (llvm::is_contained(
m_options.m_tids, tid))
2094 "Discards thread plans up to and including the "
2095 "specified index (see 'thread plan list'.) "
2096 "Only user visible plans can be discarded.",
2098 eCommandRequiresProcess | eCommandRequiresThread |
2099 eCommandTryTargetAPILock |
2100 eCommandProcessMustBeLaunched |
2101 eCommandProcessMustBePaused) {
2113 m_exe_ctx.GetThreadPtr()->AutoCompleteThreadPlans(request);
2120 "thread plan index - but got %zu",
2125 uint32_t thread_plan_idx;
2128 "Invalid thread index: \"%s\" - should be unsigned int",
2133 if (thread_plan_idx == 0) {
2135 "You wouldn't really want me to discard the base thread plan");
2139 if (thread->DiscardUserThreadPlansUpToIndex(thread_plan_idx)) {
2143 "Could not find User thread plan with index %s",
2153 "Removes any thread plans associated with "
2154 "currently unreported threads. "
2155 "Specify one or more TID's to remove, or if no "
2156 "TID's are provides, remove threads for all "
2157 "unreported threads",
2159 eCommandRequiresProcess |
2160 eCommandTryTargetAPILock |
2161 eCommandProcessMustBeLaunched |
2162 eCommandProcessMustBePaused) {
2179 std::lock_guard<std::recursive_mutex> guard(
2182 for (
size_t i = 0; i < num_args; i++) {
2205 interpreter,
"plan",
2206 "Commands for managing thread plans that control execution.",
2207 "thread plan <subcommand> [<subcommand objects]") {
2229 interpreter,
"trace thread export",
2230 "Commands for exporting traces of the threads in the current "
2231 "process to different formats.",
2232 "thread trace export <export-plugin> [<subcommand objects>]") {
2235 if (cbs.create_thread_trace_export_command)
2237 cbs.create_thread_trace_export_command(interpreter));
2248 true, interpreter,
"thread trace start",
2249 "Start tracing threads with the corresponding trace "
2250 "plug-in for the current process.",
2251 "thread trace start [<trace-options>]") {}
2265 interpreter,
"thread trace stop",
2266 "Stop tracing threads, including the ones traced with the "
2267 "\"process trace start\" command."
2268 "Defaults to the current thread. Thread indices can be "
2269 "specified as arguments.\n Use the thread-index \"all\" to stop "
2271 "for all existing threads.",
2272 "thread trace stop [<thread-index> <thread-index> ...]",
2273 eCommandRequiresProcess | eCommandTryTargetAPILock |
2274 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2275 eCommandProcessMustBeTraced) {}
2280 llvm::ArrayRef<lldb::tid_t> tids)
override {
2283 TraceSP trace_sp = process_sp->GetTarget().GetTrace();
2285 if (llvm::Error err = trace_sp->Stop(tids))
2300 uint32_t thread_idx;
2302 if (!llvm::to_integer(arg, thread_idx)) {
2314#define LLDB_OPTIONS_thread_trace_dump_function_calls
2315#include "CommandOptions.inc"
2330 switch (short_option) {
2345 llvm_unreachable(
"Unimplemented option");
2356 return llvm::ArrayRef(g_thread_trace_dump_function_calls_options);
2368 interpreter,
"thread trace dump function-calls",
2369 "Dump the traced function-calls for one thread. If no "
2370 "thread is specified, the current thread is used.",
2372 eCommandRequiresProcess | eCommandRequiresThread |
2373 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2374 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2390 llvm::Expected<TraceCursorSP> cursor_or_error =
2391 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2393 if (!cursor_or_error) {
2394 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2399 std::optional<StreamFile> out_file;
2401 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2406 m_options.m_dumper_options.forwards =
true;
2419#define LLDB_OPTIONS_thread_trace_dump_instructions
2420#include "CommandOptions.inc"
2435 switch (short_option) {
2438 if (option_arg.empty() || option_arg.getAsInteger(0, count) ||
2441 "invalid integer value for option '%s'",
2442 option_arg.str().c_str());
2453 if (option_arg.empty() || option_arg.getAsInteger(0,
skip) ||
skip < 0)
2455 "invalid integer value for option '%s'",
2456 option_arg.str().c_str());
2463 if (option_arg.empty() || option_arg.getAsInteger(0,
id))
2465 "invalid integer value for option '%s'",
2466 option_arg.str().c_str());
2514 llvm_unreachable(
"Unimplemented option");
2527 return llvm::ArrayRef(g_thread_trace_dump_instructions_options);
2541 interpreter,
"thread trace dump instructions",
2542 "Dump the traced instructions for one thread. If no "
2543 "thread is specified, show the current thread.",
2545 eCommandRequiresProcess | eCommandRequiresThread |
2546 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2547 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2556 uint32_t index)
override {
2559 if (cmd.find(
" --continue") == std::string::npos)
2560 cmd +=
" --continue";
2579 llvm::Expected<TraceCursorSP> cursor_or_error =
2580 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2582 if (!cursor_or_error) {
2583 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2589 !cursor_sp->HasId(*
m_options.m_dumper_options.id)) {
2594 std::optional<StreamFile> out_file;
2596 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2622#define LLDB_OPTIONS_thread_trace_dump_info
2623#include "CommandOptions.inc"
2638 switch (short_option) {
2648 llvm_unreachable(
"Unimplemented option");
2659 return llvm::ArrayRef(g_thread_trace_dump_info_options);
2669 interpreter,
"thread trace dump info",
2670 "Dump the traced information for one or more threads. If no "
2671 "threads are specified, show the current thread. Use the "
2672 "thread-index \"all\" to see all threads.",
2674 eCommandRequiresProcess | eCommandTryTargetAPILock |
2675 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2676 eCommandProcessMustBeTraced) {}
2686 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
2700 interpreter,
"dump",
2701 "Commands for displaying trace information of the threads "
2702 "in the current process.",
2703 "thread trace dump <subcommand> [<subcommand objects>]") {
2721 interpreter,
"trace",
2722 "Commands for operating on traces of the threads in the current "
2724 "thread trace <subcommand> [<subcommand objects>]") {
2743 "Commands for operating on "
2744 "one or more threads in "
2745 "the current process.",
2746 "thread <subcommand> [<subcommand-options>]") {
2769 interpreter,
"thread step-in",
2770 "Source level single step, stepping into calls. Defaults "
2771 "to current thread unless specified.",
2776 interpreter,
"thread step-out",
2777 "Finish executing the current stack frame and stop after "
2778 "returning. Defaults to current thread unless specified.",
2783 interpreter,
"thread step-over",
2784 "Source level single step, stepping over calls. Defaults "
2785 "to current thread unless specified.",
2790 interpreter,
"thread step-inst",
2791 "Instruction level single step, stepping into calls. "
2792 "Defaults to current thread unless specified.",
2797 interpreter,
"thread step-inst-over",
2798 "Instruction level single step, stepping over calls. "
2799 "Defaults to current thread unless specified.",
2805 interpreter,
"thread step-scripted",
2806 "Step as instructed by the script class passed in the -C option. "
2807 "You can also specify a dictionary of key (-k) and value (-v) pairs "
2808 "that will be used to populate an SBStructuredData Dictionary, which "
2809 "will be passed to the constructor of the class implementing the "
2810 "scripted step. See the Python Reference for more details.",
static ThreadSP GetSingleThreadFromArgs(ExecutionContext &exe_ctx, Args &args, CommandReturnObject &result)
static llvm::raw_ostream & error(Stream &strm)
#define INTERRUPT_REQUESTED(debugger,...)
This handy define will keep you from having to generate a report for the interruption by hand.
static void skip(TSLexer *lexer)
~CommandObjectMultiwordThreadPlan() override=default
CommandObjectMultiwordThreadPlan(CommandInterpreter &interpreter)
~CommandObjectMultiwordTraceDump() override=default
CommandObjectMultiwordTraceDump(CommandInterpreter &interpreter)
CommandObjectMultiwordTrace(CommandInterpreter &interpreter)
~CommandObjectMultiwordTrace() override=default
~CommandOptions() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
bool m_show_all_providers
bool m_provider_specific_backtrace
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
bool m_filtered_backtrace
bool m_extended_backtrace
lldb::frame_list_id_t m_provider_start_id
lldb::frame_list_id_t m_provider_end_id
Options * GetOptions() override
CommandObjectThreadBacktrace(CommandInterpreter &interpreter)
std::optional< std::string > GetRepeatCommand(Args ¤t_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
void DoExtendedBacktrace(Thread *thread, CommandReturnObject &result)
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
~CommandObjectThreadBacktrace() override=default
~CommandObjectThreadContinue() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectThreadContinue(CommandInterpreter &interpreter)
CommandObjectThreadException(CommandInterpreter &interpreter)
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
~CommandObjectThreadException() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectThreadInfo(CommandInterpreter &interpreter)
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
~CommandObjectThreadInfo() override=default
Options * GetOptions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandOptions() override=default
CommandObjectThreadJump(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
~CommandObjectThreadJump() override=default
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectThreadList() override=default
CommandObjectThreadList(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
CommandObjectThreadPlanDiscard(CommandInterpreter &interpreter)
~CommandObjectThreadPlanDiscard() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
std::vector< lldb::tid_t > m_tids
void OptionParsingStarting(ExecutionContext *execution_context) override
Options * GetOptions() override
CommandObjectThreadPlanList(CommandInterpreter &interpreter)
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
~CommandObjectThreadPlanList() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectThreadPlanPrune(CommandInterpreter &interpreter)
~CommandObjectThreadPlanPrune() override=default
void DoExecute(Args &args, CommandReturnObject &result) override
~CommandOptions() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Options * GetOptions() override
CommandObjectThreadReturn(CommandInterpreter &interpreter)
void DoExecute(llvm::StringRef command, CommandReturnObject &result) override
~CommandObjectThreadReturn() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
~OptionGroupThreadSelect() override=default
OptionGroupThreadSelect()
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void DoExecute(Args &command, CommandReturnObject &result) override
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
OptionGroupOptions m_option_group
CommandObjectThreadSelect(CommandInterpreter &interpreter)
~CommandObjectThreadSelect() override=default
OptionGroupThreadSelect m_options
Options * GetOptions() override
~CommandObjectThreadSiginfo() override=default
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
CommandObjectThreadSiginfo(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
OptionGroupPythonClassWithDict m_class_options
~CommandObjectThreadStepWithTypeAndScope() override=default
OptionGroupOptions m_all_options
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
ThreadStepScopeOptionGroup m_options
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectThreadStepWithTypeAndScope(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, StepType step_type)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandOptions() override=default
std::vector< lldb::addr_t > m_until_addrs
Options * GetOptions() override
CommandObjectThreadUntil(CommandInterpreter &interpreter)
~CommandObjectThreadUntil() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
TraceDumperOptions m_dumper_options
~CommandOptions() override=default
static const size_t kDefaultCount
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
std::optional< FileSpec > m_output_file
void DoExecute(Args &args, CommandReturnObject &result) override
CommandObjectTraceDumpFunctionCalls(CommandInterpreter &interpreter)
~CommandObjectTraceDumpFunctionCalls() override=default
Options * GetOptions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandObjectTraceDumpInfo() override=default
Options * GetOptions() override
bool HandleOneThread(lldb::tid_t tid, CommandReturnObject &result) override
CommandObjectTraceDumpInfo(CommandInterpreter &interpreter)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
std::optional< FileSpec > m_output_file
~CommandOptions() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
TraceDumperOptions m_dumper_options
static const size_t kDefaultCount
void OptionParsingStarting(ExecutionContext *execution_context) override
CommandObjectTraceDumpInstructions(CommandInterpreter &interpreter)
Options * GetOptions() override
~CommandObjectTraceDumpInstructions() override=default
std::optional< std::string > GetRepeatCommand(Args ¤t_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
void DoExecute(Args &args, CommandReturnObject &result) override
std::optional< lldb::user_id_t > m_last_id
CommandObjectTraceExport(CommandInterpreter &interpreter)
lldb::CommandObjectSP GetDelegateCommand(Trace &trace) override
CommandObjectTraceStart(CommandInterpreter &interpreter)
~CommandObjectTraceStop() override=default
bool DoExecuteOnThreads(Args &command, CommandReturnObject &result, llvm::ArrayRef< lldb::tid_t > tids) override
CommandObjectTraceStop(CommandInterpreter &interpreter)
void OptionParsingStarting(ExecutionContext *execution_context) override
LazyBool m_step_in_avoid_no_debug
~ThreadStepScopeOptionGroup() override=default
std::string m_avoid_regexp
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
std::string m_step_in_target
bool m_end_line_is_block_end
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
LazyBool m_step_out_avoid_no_debug
ThreadStepScopeOptionGroup()
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
lldb::addr_t GetByteSize() const
Get accessor for the byte size of this range.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
lldb::addr_t GetFileAddress() const
Get the file address.
bool IsValid() const
Check if the object state is valid.
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
void ReplaceArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char='\0')
Replaces the argument value at index idx to arg_str if idx is a valid argument index.
void AppendArgument(llvm::StringRef arg_str, char quote_char='\0')
Appends a new argument to the end of the list argument list.
llvm::ArrayRef< ArgEntry > entries() const
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
bool GetCommandString(std::string &command) const
bool GetQuotedCommandString(std::string &command) const
A class that describes a single lexical block.
bool GetRangeContainingAddress(const Address &addr, AddressRange &range)
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
CommandObjectIterateOverThreads(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, uint32_t flags)
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectMultipleThreads(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, uint32_t flags)
CommandObjectMultiwordThread(CommandInterpreter &interpreter)
~CommandObjectMultiwordThread() override
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
friend class CommandInterpreter
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
CommandObjectRaw(CommandInterpreter &interpreter, llvm::StringRef name, llvm::StringRef help="", llvm::StringRef syntax="", uint32_t flags=0)
CommandObjectTraceProxy(bool live_debug_session_only, CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
std::vector< CommandArgumentData > CommandArgumentEntry
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
ExecutionContext m_exe_ctx
std::vector< CommandArgumentEntry > m_arguments
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
Thread * GetDefaultThread()
virtual void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector)
The default version handles argument definitions that have only one argument type,...
Target * GetTarget()
Get the target this command should operate on.
virtual llvm::StringRef GetSyntax()
void AppendMessage(llvm::StringRef in_string)
void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void SetError(Status error)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
void SetDidChangeProcessState(bool b)
void AppendWarning(llvm::StringRef in_string)
void AppendErrorWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
uint32_t FindLineEntry(uint32_t start_idx, uint32_t line, const FileSpec *file_spec_ptr, bool exact, LineEntry *line_entry)
Find the line entry by line and optional inlined file spec.
LineTable * GetLineTable()
Get the line table for the compile unit.
"lldb/Utility/ArgCompletionRequest.h"
size_t GetCursorIndex() const
void SetUnwindOnError(bool unwind=false)
void SetUseDynamic(lldb::DynamicValueType dynamic=lldb::eDynamicCanRunTarget)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
Process & GetProcessRef() const
Returns a reference to the process object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
bool GetRangeContainingLoadAddress(lldb::addr_t load_addr, Target &target, AddressRange &range)
AddressRanges GetAddressRanges()
std::pair< uint32_t, uint32_t > GetLineEntryIndexRange(const AddressRange &range) const
Returns the (half-open) range of line entry indexes which overlap the given address range.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
static llvm::SmallVector< TraceExporterCallbacks > GetTraceExporterCallbacks()
A plug-in interface definition class for debugging a process.
lldb::pid_t GetID() const
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid.
ThreadList & GetThreadList()
Status Resume()
Resumes all of a process's threads as configured using the Thread run control functions.
void PruneThreadPlans()
Prune ThreadPlanStacks for all unreported threads.
bool PruneThreadPlansForTID(lldb::tid_t tid)
Prune ThreadPlanStacks for unreported threads.
virtual SystemRuntime * GetSystemRuntime()
Get the system runtime plug-in for this process.
bool DumpThreadPlansForTID(Stream &strm, lldb::tid_t tid, lldb::DescriptionLevel desc_level, bool internal, bool condense_trivial, bool skip_unreported_plans)
Dump the thread plans associated with thread with tid.
Status ResumeSynchronous(Stream *stream)
Resume a process, and wait for it to stop.
size_t GetThreadStatus(Stream &ostrm, bool only_threads_with_stop_reason, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format)
lldb::StateType GetState()
Get accessor for the current process state.
uint32_t GetIOHandlerID() const
void GetStatus(Stream &ostrm, bool is_verbose=false)
void SyncIOHandler(uint32_t iohandler_id, const Timeout< std::micro > &timeout)
Waits for the process state to be running within a given msec timeout.
uint32_t FindEntryIndexThatContains(B addr) const
BaseType GetMaxRangeEnd(BaseType fail_value) const
void Append(const Entry &entry)
BaseType GetMinRangeBase(BaseType fail_value) const
This base class provides an interface to stack frames.
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
virtual llvm::Expected< lldb::ThreadPlanSP > GetThreadPlanForStepType(lldb::StepType step_type)
virtual bool HasDebugInformation()
Determine whether this StackFrame has debug information available or not.
virtual const Address & GetFrameCodeAddress()
Get an Address for the current pc value in this StackFrame.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
bool Fail() const
Test for error condition.
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
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.
Defines a symbol context baton that can be handed other debug core functions.
llvm::Error GetAddressRangeFromHereToEndLine(uint32_t end_line, AddressRange &range)
Function * function
The Function for a given query.
Block * block
The Block for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
LineEntry line_entry
The LineEntry for a given query.
A plug-in interface definition class for system runtimes.
virtual lldb::ThreadSP GetExtendedBacktraceThread(lldb::ThreadSP thread, ConstString type)
Return a Thread which shows the origin of this thread's creation.
virtual const std::vector< ConstString > & GetExtendedBacktraceTypes()
Return a list of thread origin extended backtraces that may be available.
lldb::ExpressionResults EvaluateExpression(llvm::StringRef expression, ExecutionContextScope *exe_scope, lldb::ValueObjectSP &result_valobj_sp, const EvaluateExpressionOptions &options=EvaluateExpressionOptions(), std::string *fixed_expression=nullptr, ValueObject *ctx_obj=nullptr)
uint32_t GetSize(bool can_update=true)
bool SetSelectedThreadByID(lldb::tid_t tid, bool notify=false)
lldb::ThreadSP FindThreadByIndexID(uint32_t index_id, bool can_update=true)
lldb::ThreadSP GetThreadAtIndex(uint32_t idx, bool can_update=true)
std::recursive_mutex & GetMutex() const override
lldb::ThreadSP FindThreadByID(lldb::tid_t tid, bool can_update=true)
void SetAvoidRegexp(const char *name)
Class used to dump the instructions of a TraceCursor using its current state and granularity.
std::optional< lldb::user_id_t > DumpInstructions(size_t count)
Dump count instructions of the thread trace starting at the current cursor position.
void DumpFunctionCalls()
Dump all function calls forwards chronologically and hierarchically.
A plug-in interface definition class for trace information.
virtual lldb::CommandObjectSP GetThreadTraceStartCommand(CommandInterpreter &interpreter)=0
Get the command handle for the "thread trace start" command.
#define LLDB_INVALID_LINE_NUMBER
#define LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_INDEX32
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_FRAME_ID
@ DoNoSelectMostRelevantFrame
A class that represents a running process on the host machine.
std::vector< OptionArgElement > OptionElementVector
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
std::string toString(FormatterBytecode::OpCodes op)
std::shared_ptr< lldb_private::Trace > TraceSP
std::shared_ptr< lldb_private::ThreadPlan > ThreadPlanSP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
StateType
Process and Thread States.
@ 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.
@ eStateCrashed
Process or thread has crashed and can be examined.
ExpressionResults
The results of expression evaluation.
std::shared_ptr< lldb_private::Process > ProcessSP
@ eReturnStatusSuccessContinuingNoResult
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
@ eArgTypeUnsignedInteger
@ eTraceCursorSeekTypeEnd
The end of the trace, i.e the most recent item.
std::shared_ptr< lldb_private::TraceCursor > TraceCursorSP
@ eStepTypeInto
Single step into a specified context.
@ eStepTypeTraceOver
Single step one instruction, stepping over.
@ eStepTypeTrace
Single step one instruction.
@ eStepTypeOut
Single step out a specified context.
@ eStepTypeScripted
A step type implemented by the script interpreter.
@ eStepTypeOver
Single step over a specified context.
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP
Used to build individual command argument lists.
ArgumentRepetitionType arg_repetition
lldb::CommandArgumentType arg_type
uint32_t arg_opt_set_association
This arg might be associated only with some particular option set(s).
A line table entry class.
AddressRange range
The section offset address range for this line entry.
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.
const FileSpec & GetFile() const
Helper to access the file.
static int64_t ToOptionEnum(llvm::StringRef s, const OptionEnumValues &enum_values, int32_t fail_value, Status &error)
static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx, llvm::StringRef s, lldb::addr_t fail_value, Status *error_ptr)
Try to parse an address.
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)
Class that holds the configuration used by TraceDumper for traversing and dumping instructions.
lldb::user_id_t GetID() const
Get accessor for the user ID.