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) {
362 strm.
Printf(
": Base Unwinder ===\n");
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) {
404 strm.
Printf(
"(No frames available)\n");
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;
667 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
668 assert(frame !=
nullptr);
678 llvm::toString(std::move(err)));
681 }
else if (
m_options.m_end_line_is_block_end) {
694 "Could not find the current block address");
707 new_plan_sp = thread->QueueThreadPlanForStepInRange(
708 abort_other_plans, range,
710 m_options.m_step_in_target.c_str(), stop_other_threads,
711 new_plan_status,
m_options.m_step_in_avoid_no_debug,
714 if (new_plan_sp && !
m_options.m_avoid_regexp.empty()) {
720 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
721 false, abort_other_plans, bool_stop_other_threads, new_plan_status);
723 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
726 new_plan_sp = thread->QueueThreadPlanForStepOverRange(
730 stop_other_threads, new_plan_status,
733 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
734 true, abort_other_plans, bool_stop_other_threads, new_plan_status);
736 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
737 false, abort_other_plans, bool_stop_other_threads, new_plan_status);
739 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
740 true, abort_other_plans, bool_stop_other_threads, new_plan_status);
742 new_plan_sp = thread->QueueThreadPlanForStepOut(
743 abort_other_plans,
nullptr,
false, bool_stop_other_threads,
eVoteYes,
746 new_plan_status,
m_options.m_step_out_avoid_no_debug);
748 new_plan_sp = thread->QueueThreadPlanForStepScripted(
762 new_plan_sp->SetIsControllingPlan(
true);
763 new_plan_sp->SetOkayToDiscard(
false);
766 if (!new_plan_sp->SetIterationCount(
m_options.m_step_count)) {
768 "step operation does not support iteration count");
778 if (synchronous_execution)
783 if (!
error.Success()) {
793 process->
SyncIOHandler(iohandler_id, std::chrono::seconds(2));
795 if (synchronous_execution) {
808 result.
SetError(std::move(new_plan_status));
824 interpreter,
"thread continue",
825 "Continue execution of the current target process. One "
826 "or more threads may be specified, by default all "
829 eCommandRequiresThread | eCommandTryTargetAPILock |
830 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
840 if (process ==
nullptr) {
841 result.
AppendError(
"no process exists. Cannot continue");
853 std::lock_guard<std::recursive_mutex> guard(
856 std::vector<Thread *> resume_threads;
857 for (
auto &entry : command.
entries()) {
859 if (entry.ref().getAsInteger(0, thread_idx)) {
861 "invalid thread index argument: \"%s\"", entry.c_str());
868 resume_threads.push_back(thread);
875 if (resume_threads.empty()) {
876 result.
AppendError(
"no valid thread indexes were specified");
880 if (resume_threads.size() == 1)
881 strm <<
"Resuming thread: ";
883 strm <<
"Resuming threads: ";
885 for (uint32_t idx = 0; idx < num_threads; ++idx) {
888 std::vector<Thread *>::iterator this_thread_pos =
889 find(resume_threads.begin(), resume_threads.end(), thread);
891 if (this_thread_pos != resume_threads.end()) {
892 resume_threads.erase(this_thread_pos);
893 if (!resume_threads.empty())
894 strm << llvm::formatv(
"{0}, ", thread->GetIndexID());
896 strm << llvm::formatv(
"{0} ", thread->GetIndexID());
898 const bool override_suspend =
true;
910 std::lock_guard<std::recursive_mutex> guard(
914 if (current_thread ==
nullptr) {
915 result.
AppendError(
"the process doesn't have a current thread");
919 for (uint32_t idx = 0; idx < num_threads; ++idx) {
921 if (thread == current_thread) {
923 "Resuming thread {0:x4} in process {1}", thread->GetID(),
925 const bool override_suspend =
true;
935 if (synchronous_execution)
941 if (
error.Success()) {
944 if (synchronous_execution) {
961 "Process cannot be continued from its current state (%s)",
969#define LLDB_OPTIONS_thread_until
970#include "CommandOptions.inc"
992 switch (short_option) {
1003 option_arg.str().c_str());
1010 option_arg.str().c_str());
1018 if (
error.Success()) {
1026 llvm_unreachable(
"Unimplemented option");
1039 return llvm::ArrayRef(g_thread_until_options);
1050 interpreter,
"thread until",
1051 "Continue until a line number or address is reached by the "
1052 "current or specified thread. Stops when returning from "
1053 "the current function as a safety measure. "
1054 "The target line number(s) are given as arguments, and if more "
1056 " is provided, stepping will stop when the first one is hit.",
1058 eCommandRequiresThread | eCommandTryTargetAPILock |
1059 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1069 bool synchronous_execution =
m_interpreter.GetSynchronous();
1074 if (process ==
nullptr) {
1075 result.
AppendError(
"need a valid process to step");
1077 Thread *thread =
nullptr;
1078 std::vector<uint32_t> line_numbers;
1082 for (
size_t i = 0; i < num_args; i++) {
1083 uint32_t line_number;
1089 line_numbers.push_back(line_number);
1091 }
else if (
m_options.m_until_addrs.empty()) {
1105 if (thread ==
nullptr) {
1108 "Thread index %u is out of range (valid values are 0 - %u)",
1113 const bool abort_other_plans =
false;
1116 thread->GetStackFrameAtIndex(
m_options.m_frame_idx).get();
1117 if (frame ==
nullptr) {
1119 "Frame index %u is out of range for thread id %" PRIu64,
1120 m_options.m_frame_idx, thread->GetID());
1135 if (line_table ==
nullptr) {
1137 "frame %u of thread id %" PRIu64,
1138 m_options.m_frame_idx, thread->GetID());
1143 std::vector<addr_t> address_list;
1149 "function info - can't get until range");
1156 line_idx_ranges.
Append(begin, end - begin);
1158 line_idx_ranges.
Sort();
1160 bool found_something =
false;
1166 for (uint32_t line_number : line_numbers) {
1173 found_something =
true;
1174 line_number = line_entry.
line;
1179 exact, &line_entry);
1180 while (idx < end_func_idx) {
1185 address_list.push_back(address);
1188 exact, &line_entry);
1196 address_list.push_back(address);
1199 if (address_list.empty()) {
1200 if (found_something)
1202 "Until target outside of the current function");
1205 "No line entries matching until target");
1210 new_plan_sp = thread->QueueThreadPlanForStepUntil(
1211 abort_other_plans, address_list,
m_options.m_stop_others,
1212 m_options.m_frame_idx, new_plan_status);
1219 new_plan_sp->SetIsControllingPlan(
true);
1220 new_plan_sp->SetOkayToDiscard(
false);
1222 result.
SetError(std::move(new_plan_status));
1227 " has no debug information",
1228 m_options.m_frame_idx, thread->GetID());
1234 "Failed to set the selected thread to thread id %" PRIu64,
1241 if (synchronous_execution)
1246 if (
error.Success()) {
1249 if (synchronous_execution) {
1272#define LLDB_OPTIONS_thread_select
1273#include "CommandOptions.inc"
1289 const int short_option = g_thread_select_options[option_idx].short_option;
1290 switch (short_option) {
1295 option_arg.str().c_str());
1301 llvm_unreachable(
"Unimplemented option");
1308 return llvm::ArrayRef(g_thread_select_options);
1316 "Change the currently selected thread.",
1317 "thread select <thread-index> (or -t <thread-id>)",
1318 eCommandRequiresProcess | eCommandTryTargetAPILock |
1319 eCommandProcessMustBeLaunched |
1320 eCommandProcessMustBePaused) {
1331 arg.push_back(thread_idx_arg);
1358 if (process ==
nullptr) {
1364 "'%s' takes exactly one thread index argument, or a thread ID "
1365 "option:\nUsage: %s",
1371 "and a thread index argument:\nUsage: %s",
1376 Thread *new_thread =
nullptr;
1385 if (new_thread ==
nullptr) {
1393 if (new_thread ==
nullptr) {
1414 interpreter,
"thread list",
1415 "Show a summary of each thread in the current target process. "
1416 "Use 'settings set thread-format' to customize the individual "
1419 eCommandRequiresProcess | eCommandTryTargetAPILock |
1420 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1429 const bool only_threads_with_stop_reason =
false;
1430 const uint32_t start_frame = 0;
1431 const uint32_t num_frames = 0;
1432 const uint32_t num_frames_with_source = 0;
1434 process->
GetThreadStatus(strm, only_threads_with_stop_reason, start_frame,
1435 num_frames, num_frames_with_source,
false);
1440#define LLDB_OPTIONS_thread_info
1441#include "CommandOptions.inc"
1462 switch (short_option) {
1476 llvm_unreachable(
"Unimplemented option");
1482 return llvm::ArrayRef(g_thread_info_options);
1492 interpreter,
"thread info",
1493 "Show an extended summary of one or "
1494 "more threads. Defaults to the "
1497 eCommandRequiresProcess | eCommandTryTargetAPILock |
1498 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1516 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1522 Thread *thread = thread_sp.get();
1523 if (
m_options.m_backing_thread && thread->GetBackingThread())
1524 thread = thread->GetBackingThread().get();
1531 thread->GetIndexID());
1546 interpreter,
"thread exception",
1547 "Display the current exception object for a thread. Defaults to "
1548 "the current thread.",
1550 eCommandRequiresProcess | eCommandTryTargetAPILock |
1551 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1565 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1572 ValueObjectSP exception_object_sp = thread_sp->GetCurrentException();
1573 if (exception_object_sp) {
1574 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1580 ThreadSP exception_thread_sp = thread_sp->GetCurrentExceptionBacktrace();
1581 if (exception_thread_sp && exception_thread_sp->IsValid()) {
1582 const uint32_t num_frames_with_source = 0;
1583 const bool stop_format =
false;
1584 exception_thread_sp->GetStatus(strm, 0,
UINT32_MAX,
1585 num_frames_with_source, stop_format,
1597 interpreter,
"thread siginfo",
1598 "Display the current siginfo object for a thread. Defaults to "
1599 "the current thread.",
1601 eCommandRequiresProcess | eCommandTryTargetAPILock |
1602 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1616 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1625 thread_sp->GetIndexID());
1628 ValueObjectSP exception_object_sp = thread_sp->GetSiginfoValue();
1629 if (exception_object_sp) {
1630 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1635 strm.
Printf(
"(no siginfo)\n");
1643#define LLDB_OPTIONS_thread_return
1644#include "CommandOptions.inc"
1663 switch (short_option) {
1672 "invalid boolean value '%s' for 'x' option",
1673 option_arg.str().c_str());
1677 llvm_unreachable(
"Unimplemented option");
1687 return llvm::ArrayRef(g_thread_return_options);
1697 "Prematurely return from a stack frame, "
1698 "short-circuiting execution of newer frames "
1699 "and optionally yielding a specified value. Defaults "
1700 "to the exiting the current stack "
1703 eCommandRequiresFrame | eCommandTryTargetAPILock |
1704 eCommandProcessMustBeLaunched |
1705 eCommandProcessMustBePaused) {
1719 if (command.starts_with(
"-x")) {
1720 if (command.size() != 2U)
1721 result.
AppendWarning(
"return values ignored when returning from user "
1722 "called expressions");
1726 error = thread->UnwindInnermostExpression();
1727 if (!
error.Success()) {
1739 "Could not select 0th frame after unwinding expression");
1748 uint32_t frame_idx = frame_sp->GetFrameIndex();
1750 if (frame_sp->IsInlined()) {
1751 result.
AppendError(
"don't know how to return from inlined frames");
1755 if (!command.empty()) {
1764 return_valobj_sp, options);
1766 if (return_valobj_sp)
1768 "Error evaluating result expression: %s",
1769 return_valobj_sp->GetError().AsCString());
1772 "Unknown error evaluating result expression");
1779 const bool broadcast =
true;
1780 error = thread_sp->ReturnFromFrame(frame_sp, return_valobj_sp, broadcast);
1781 if (!
error.Success()) {
1783 "Error returning from frame %d of thread %d: %s", frame_idx,
1784 thread_sp->GetIndexID(),
error.AsCString());
1795#define LLDB_OPTIONS_thread_jump
1796#include "CommandOptions.inc"
1819 switch (short_option) {
1828 option_arg.str().c_str());
1831 option_arg.consume_front(
"+");
1835 option_arg.str().c_str());
1846 llvm_unreachable(
"Unimplemented option");
1852 return llvm::ArrayRef(g_thread_jump_options);
1864 interpreter,
"thread jump",
1865 "Sets the program counter to a new address.",
"thread jump",
1866 eCommandRequiresFrame | eCommandTryTargetAPILock |
1867 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1892 if (!reg_ctx->
SetPC(callAddr)) {
1894 thread->GetIndexID());
1899 int32_t line = (int32_t)
m_options.m_line_num;
1905 if (
m_options.m_filenames.GetSize() == 1)
1906 file =
m_options.m_filenames.GetFileSpecAtIndex(0);
1910 "no source file available for the current location");
1914 std::string warnings;
1915 Status err = thread->JumpToLine(file, line,
m_options.m_force, &warnings);
1922 if (!warnings.empty())
1935#define LLDB_OPTIONS_thread_plan_list
1936#include "CommandOptions.inc"
1954 switch (short_option) {
1960 if (option_arg.getAsInteger(0, tid))
1962 option_arg.str().c_str());
1972 llvm_unreachable(
"Unimplemented option");
1986 return llvm::ArrayRef(g_thread_plan_list_options);
1998 interpreter,
"thread plan list",
1999 "Show thread plans for one or more threads. If no threads are "
2000 "specified, show the "
2001 "current thread. Use the thread-index \"all\" to see all threads.",
2003 eCommandRequiresProcess | eCommandRequiresThread |
2004 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2005 eCommandProcessMustBePaused) {}
2018 m_exe_ctx.GetProcessPtr()->DumpThreadPlans(
2049 if (llvm::is_contained(
m_options.m_tids, tid))
2072 "Discards thread plans up to and including the "
2073 "specified index (see 'thread plan list'.) "
2074 "Only user visible plans can be discarded.",
2076 eCommandRequiresProcess | eCommandRequiresThread |
2077 eCommandTryTargetAPILock |
2078 eCommandProcessMustBeLaunched |
2079 eCommandProcessMustBePaused) {
2091 m_exe_ctx.GetThreadPtr()->AutoCompleteThreadPlans(request);
2098 "thread plan index - but got %zu",
2103 uint32_t thread_plan_idx;
2106 "Invalid thread index: \"%s\" - should be unsigned int",
2111 if (thread_plan_idx == 0) {
2113 "You wouldn't really want me to discard the base thread plan");
2117 if (thread->DiscardUserThreadPlansUpToIndex(thread_plan_idx)) {
2121 "Could not find User thread plan with index %s",
2131 "Removes any thread plans associated with "
2132 "currently unreported threads. "
2133 "Specify one or more TID's to remove, or if no "
2134 "TID's are provides, remove threads for all "
2135 "unreported threads",
2137 eCommandRequiresProcess |
2138 eCommandTryTargetAPILock |
2139 eCommandProcessMustBeLaunched |
2140 eCommandProcessMustBePaused) {
2157 std::lock_guard<std::recursive_mutex> guard(
2160 for (
size_t i = 0; i < num_args; i++) {
2183 interpreter,
"plan",
2184 "Commands for managing thread plans that control execution.",
2185 "thread plan <subcommand> [<subcommand objects]") {
2207 interpreter,
"trace thread export",
2208 "Commands for exporting traces of the threads in the current "
2209 "process to different formats.",
2210 "thread trace export <export-plugin> [<subcommand objects>]") {
2213 if (cbs.create_thread_trace_export_command)
2215 cbs.create_thread_trace_export_command(interpreter));
2226 true, interpreter,
"thread trace start",
2227 "Start tracing threads with the corresponding trace "
2228 "plug-in for the current process.",
2229 "thread trace start [<trace-options>]") {}
2243 interpreter,
"thread trace stop",
2244 "Stop tracing threads, including the ones traced with the "
2245 "\"process trace start\" command."
2246 "Defaults to the current thread. Thread indices can be "
2247 "specified as arguments.\n Use the thread-index \"all\" to stop "
2249 "for all existing threads.",
2250 "thread trace stop [<thread-index> <thread-index> ...]",
2251 eCommandRequiresProcess | eCommandTryTargetAPILock |
2252 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2253 eCommandProcessMustBeTraced) {}
2258 llvm::ArrayRef<lldb::tid_t> tids)
override {
2261 TraceSP trace_sp = process_sp->GetTarget().GetTrace();
2263 if (llvm::Error err = trace_sp->Stop(tids))
2278 uint32_t thread_idx;
2280 if (!llvm::to_integer(arg, thread_idx)) {
2292#define LLDB_OPTIONS_thread_trace_dump_function_calls
2293#include "CommandOptions.inc"
2308 switch (short_option) {
2323 llvm_unreachable(
"Unimplemented option");
2334 return llvm::ArrayRef(g_thread_trace_dump_function_calls_options);
2346 interpreter,
"thread trace dump function-calls",
2347 "Dump the traced function-calls for one thread. If no "
2348 "thread is specified, the current thread is used.",
2350 eCommandRequiresProcess | eCommandRequiresThread |
2351 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2352 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2368 llvm::Expected<TraceCursorSP> cursor_or_error =
2369 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2371 if (!cursor_or_error) {
2372 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2377 std::optional<StreamFile> out_file;
2379 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2384 m_options.m_dumper_options.forwards =
true;
2397#define LLDB_OPTIONS_thread_trace_dump_instructions
2398#include "CommandOptions.inc"
2413 switch (short_option) {
2416 if (option_arg.empty() || option_arg.getAsInteger(0, count) ||
2419 "invalid integer value for option '%s'",
2420 option_arg.str().c_str());
2431 if (option_arg.empty() || option_arg.getAsInteger(0,
skip) ||
skip < 0)
2433 "invalid integer value for option '%s'",
2434 option_arg.str().c_str());
2441 if (option_arg.empty() || option_arg.getAsInteger(0,
id))
2443 "invalid integer value for option '%s'",
2444 option_arg.str().c_str());
2492 llvm_unreachable(
"Unimplemented option");
2505 return llvm::ArrayRef(g_thread_trace_dump_instructions_options);
2519 interpreter,
"thread trace dump instructions",
2520 "Dump the traced instructions for one thread. If no "
2521 "thread is specified, show the current thread.",
2523 eCommandRequiresProcess | eCommandRequiresThread |
2524 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2525 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2534 uint32_t index)
override {
2537 if (cmd.find(
" --continue") == std::string::npos)
2538 cmd +=
" --continue";
2557 llvm::Expected<TraceCursorSP> cursor_or_error =
2558 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2560 if (!cursor_or_error) {
2561 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2567 !cursor_sp->HasId(*
m_options.m_dumper_options.id)) {
2572 std::optional<StreamFile> out_file;
2574 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2600#define LLDB_OPTIONS_thread_trace_dump_info
2601#include "CommandOptions.inc"
2616 switch (short_option) {
2626 llvm_unreachable(
"Unimplemented option");
2637 return llvm::ArrayRef(g_thread_trace_dump_info_options);
2647 interpreter,
"thread trace dump info",
2648 "Dump the traced information for one or more threads. If no "
2649 "threads are specified, show the current thread. Use the "
2650 "thread-index \"all\" to see all threads.",
2652 eCommandRequiresProcess | eCommandTryTargetAPILock |
2653 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2654 eCommandProcessMustBeTraced) {}
2664 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
2678 interpreter,
"dump",
2679 "Commands for displaying trace information of the threads "
2680 "in the current process.",
2681 "thread trace dump <subcommand> [<subcommand objects>]") {
2699 interpreter,
"trace",
2700 "Commands for operating on traces of the threads in the current "
2702 "thread trace <subcommand> [<subcommand objects>]") {
2721 "Commands for operating on "
2722 "one or more threads in "
2723 "the current process.",
2724 "thread <subcommand> [<subcommand-options>]") {
2747 interpreter,
"thread step-in",
2748 "Source level single step, stepping into calls. Defaults "
2749 "to current thread unless specified.",
2754 interpreter,
"thread step-out",
2755 "Finish executing the current stack frame and stop after "
2756 "returning. Defaults to current thread unless specified.",
2761 interpreter,
"thread step-over",
2762 "Source level single step, stepping over calls. Defaults "
2763 "to current thread unless specified.",
2768 interpreter,
"thread step-inst",
2769 "Instruction level single step, stepping into calls. "
2770 "Defaults to current thread unless specified.",
2775 interpreter,
"thread step-inst-over",
2776 "Instruction level single step, stepping over calls. "
2777 "Defaults to current thread unless specified.",
2783 interpreter,
"thread step-scripted",
2784 "Step as instructed by the script class passed in the -C option. "
2785 "You can also specify a dictionary of key (-k) and value (-v) pairs "
2786 "that will be used to populate an SBStructuredData Dictionary, which "
2787 "will be passed to the constructor of the class implementing the "
2788 "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,...
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.
void GetStatus(Stream &ostrm)
uint32_t GetIOHandlerID() const
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 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.
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)
@ eStepTypeTraceOver
Single step one instruction, stepping over.
@ eStepTypeOut
Single step out a specified context.
@ eStepTypeScripted
A step type implemented by the script interpreter.
@ eStepTypeInto
Single step into a specified context.
@ eStepTypeOver
Single step over a specified context.
@ eStepTypeTrace
Single step one instruction.
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
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.