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
"\n",
310 Thread *thread = thread_sp.get();
314 if (
m_options.m_provider_specific_backtrace) {
319 if (thread->IsAnyProviderActive()) {
321 "cannot use '--provider' option while a scripted frame provider is "
322 "being constructed on this thread\n");
328 thread->GetStatus(strm, 0, 0,
335 const auto &chain = thread->GetProviderChainIds();
336 m_options.m_provider_end_id = chain.empty() ? 0 : chain.back().second;
340 bool first_provider =
true;
342 provider_id <=
m_options.m_provider_end_id; ++provider_id) {
346 thread->GetFrameListByIdentifier(provider_id);
348 if (!frame_list_sp) {
356 first_provider =
false;
359 strm.
Printf(
"=== Provider %u", provider_id);
362 if (provider_id == 0) {
363 strm.
Printf(
": Base Unwinder ===\n");
366 const auto &provider_chain = thread->GetProviderChainIds();
367 std::string provider_name =
"Unknown";
368 std::string provider_desc;
369 std::optional<uint32_t> provider_priority;
371 for (
const auto &[descriptor,
id] : provider_chain) {
372 if (
id == provider_id) {
373 provider_name = descriptor.GetName().str();
374 provider_desc = descriptor.GetDescription();
375 provider_priority = descriptor.GetPriority();
380 strm.
Printf(
": %s", provider_name.c_str());
381 if (provider_priority.has_value()) {
382 strm.
Printf(
" (priority: %u)", *provider_priority);
386 if (!provider_desc.empty()) {
387 strm.
Printf(
"Description: %s\n", provider_desc.c_str());
392 const uint32_t num_frames_with_source = 0;
395 const char *selected_frame_marker = selected_frame_sp ?
"->" :
nullptr;
397 size_t num_frames = frame_list_sp->GetStatus(
399 true, num_frames_with_source,
402 selected_frame_marker);
404 if (num_frames == 0) {
405 strm.
Printf(
"(No frames available)\n");
409 if (first_provider) {
420 const uint32_t num_frames_with_source = 0;
421 const bool stop_format =
true;
423 num_frames_with_source, stop_format,
424 !
m_options.m_filtered_backtrace, only_stacks)) {
426 "error displaying backtrace for thread: \"0x%4.4x\"\n",
427 thread->GetIndexID());
432 "Interrupt skipped extended backtrace")) {
443#define LLDB_OPTIONS_thread_step_scope
444#include "CommandOptions.inc"
457 return llvm::ArrayRef(g_thread_step_scope_options);
463 const int short_option =
464 g_thread_step_scope_options[option_idx].short_option;
466 switch (short_option) {
469 bool avoid_no_debug =
473 "invalid boolean value for option '%c': %s", short_option,
482 bool avoid_no_debug =
486 "invalid boolean value for option '%c': %s", short_option,
496 "invalid integer value for option '%c': %s", short_option,
507 if (option_arg ==
"block") {
513 "invalid end line number '%s'", option_arg.str().c_str());
527 llvm_unreachable(
"Unimplemented option");
542 if (process_sp && process_sp->GetSteppingRunsAllThreads())
566 const char *name,
const char *help,
570 eCommandRequiresProcess | eCommandRequiresThread |
571 eCommandTryTargetAPILock |
572 eCommandProcessMustBeLaunched |
573 eCommandProcessMustBePaused),
608 if (thread ==
nullptr) {
609 result.
AppendError(
"no selected thread in process");
614 uint32_t step_thread_idx;
616 if (!llvm::to_integer(thread_idx_cstr, step_thread_idx)) {
623 if (thread ==
nullptr) {
625 "Thread index %u is out of range (valid values are 0 - %u).\n",
626 step_thread_idx, num_threads);
635 }
else if (!
GetDebugger().GetScriptInterpreter()->CheckObjectExists(
638 "class for scripted step: \"%s\" does not exist.",
647 "end line option is only valid for step into");
651 const bool abort_other_plans =
false;
656 bool bool_stop_other_threads;
658 bool_stop_other_threads =
false;
662 bool_stop_other_threads =
true;
668 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
669 assert(frame !=
nullptr);
679 llvm::toString(std::move(err)));
682 }
else if (
m_options.m_end_line_is_block_end) {
695 "Could not find the current block address.");
708 new_plan_sp = thread->QueueThreadPlanForStepInRange(
709 abort_other_plans, range,
711 m_options.m_step_in_target.c_str(), stop_other_threads,
712 new_plan_status,
m_options.m_step_in_avoid_no_debug,
715 if (new_plan_sp && !
m_options.m_avoid_regexp.empty()) {
721 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
722 false, abort_other_plans, bool_stop_other_threads, new_plan_status);
724 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
727 new_plan_sp = thread->QueueThreadPlanForStepOverRange(
731 stop_other_threads, new_plan_status,
734 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
735 true, abort_other_plans, bool_stop_other_threads, new_plan_status);
737 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
738 false, abort_other_plans, bool_stop_other_threads, new_plan_status);
740 new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
741 true, abort_other_plans, bool_stop_other_threads, new_plan_status);
743 new_plan_sp = thread->QueueThreadPlanForStepOut(
744 abort_other_plans,
nullptr,
false, bool_stop_other_threads,
eVoteYes,
747 new_plan_status,
m_options.m_step_out_avoid_no_debug);
749 new_plan_sp = thread->QueueThreadPlanForStepScripted(
763 new_plan_sp->SetIsControllingPlan(
true);
764 new_plan_sp->SetOkayToDiscard(
false);
767 if (!new_plan_sp->SetIterationCount(
m_options.m_step_count)) {
769 "step operation does not support iteration count");
779 if (synchronous_execution)
784 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\".\n", entry.c_str());
868 resume_threads.push_back(thread);
876 if (resume_threads.empty()) {
877 result.
AppendError(
"no valid thread indexes were specified");
881 if (resume_threads.size() == 1)
882 strm <<
"Resuming thread: ";
884 strm <<
"Resuming threads: ";
886 for (uint32_t idx = 0; idx < num_threads; ++idx) {
889 std::vector<Thread *>::iterator this_thread_pos =
890 find(resume_threads.begin(), resume_threads.end(), thread);
892 if (this_thread_pos != resume_threads.end()) {
893 resume_threads.erase(this_thread_pos);
894 if (!resume_threads.empty())
895 strm << llvm::formatv(
"{0}, ", thread->GetIndexID());
897 strm << llvm::formatv(
"{0} ", thread->GetIndexID());
899 const bool override_suspend =
true;
911 std::lock_guard<std::recursive_mutex> guard(
915 if (current_thread ==
nullptr) {
916 result.
AppendError(
"the process doesn't have a current thread");
920 for (uint32_t idx = 0; idx < num_threads; ++idx) {
922 if (thread == current_thread) {
924 "Resuming thread {0:x4} in process {1}", thread->GetID(),
926 const bool override_suspend =
true;
936 if (synchronous_execution)
942 if (
error.Success()) {
945 if (synchronous_execution) {
962 "Process cannot be continued from its current state (%s).\n",
970#define LLDB_OPTIONS_thread_until
971#include "CommandOptions.inc"
993 switch (short_option) {
1004 option_arg.str().c_str());
1011 option_arg.str().c_str());
1019 if (
error.Success()) {
1027 llvm_unreachable(
"Unimplemented option");
1040 return llvm::ArrayRef(g_thread_until_options);
1051 interpreter,
"thread until",
1052 "Continue until a line number or address is reached by the "
1053 "current or specified thread. Stops when returning from "
1054 "the current function as a safety measure. "
1055 "The target line number(s) are given as arguments, and if more "
1057 " is provided, stepping will stop when the first one is hit.",
1059 eCommandRequiresThread | eCommandTryTargetAPILock |
1060 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1070 bool synchronous_execution =
m_interpreter.GetSynchronous();
1075 if (process ==
nullptr) {
1076 result.
AppendError(
"need a valid process to step");
1078 Thread *thread =
nullptr;
1079 std::vector<uint32_t> line_numbers;
1083 for (
size_t i = 0; i < num_args; i++) {
1084 uint32_t line_number;
1090 line_numbers.push_back(line_number);
1092 }
else if (
m_options.m_until_addrs.empty()) {
1106 if (thread ==
nullptr) {
1109 "Thread index %u is out of range (valid values are 0 - %u).\n",
1114 const bool abort_other_plans =
false;
1117 thread->GetStackFrameAtIndex(
m_options.m_frame_idx).get();
1118 if (frame ==
nullptr) {
1120 "Frame index %u is out of range for thread id %" PRIu64
".\n",
1121 m_options.m_frame_idx, thread->GetID());
1136 if (line_table ==
nullptr) {
1138 "frame %u of thread id %" PRIu64
".\n",
1139 m_options.m_frame_idx, thread->GetID());
1144 std::vector<addr_t> address_list;
1150 "function info - can't get until range.");
1157 line_idx_ranges.
Append(begin, end - begin);
1159 line_idx_ranges.
Sort();
1161 bool found_something =
false;
1167 for (uint32_t line_number : line_numbers) {
1174 found_something =
true;
1175 line_number = line_entry.
line;
1180 exact, &line_entry);
1181 while (idx < end_func_idx) {
1186 address_list.push_back(address);
1189 exact, &line_entry);
1197 address_list.push_back(address);
1200 if (address_list.empty()) {
1201 if (found_something)
1203 "Until target outside of the current function.\n");
1206 "No line entries matching until target.\n");
1211 new_plan_sp = thread->QueueThreadPlanForStepUntil(
1212 abort_other_plans, address_list,
m_options.m_stop_others,
1213 m_options.m_frame_idx, new_plan_status);
1220 new_plan_sp->SetIsControllingPlan(
true);
1221 new_plan_sp->SetOkayToDiscard(
false);
1223 result.
SetError(std::move(new_plan_status));
1228 " has no debug information.\n",
1229 m_options.m_frame_idx, thread->GetID());
1235 "Failed to set the selected thread to thread id %" PRIu64
".\n",
1242 if (synchronous_execution)
1247 if (
error.Success()) {
1250 if (synchronous_execution) {
1273#define LLDB_OPTIONS_thread_select
1274#include "CommandOptions.inc"
1290 const int short_option = g_thread_select_options[option_idx].short_option;
1291 switch (short_option) {
1296 option_arg.str().c_str());
1302 llvm_unreachable(
"Unimplemented option");
1309 return llvm::ArrayRef(g_thread_select_options);
1317 "Change the currently selected thread.",
1318 "thread select <thread-index> (or -t <thread-id>)",
1319 eCommandRequiresProcess | eCommandTryTargetAPILock |
1320 eCommandProcessMustBeLaunched |
1321 eCommandProcessMustBePaused) {
1332 arg.push_back(thread_idx_arg);
1359 if (process ==
nullptr) {
1365 "'%s' takes exactly one thread index argument, or a thread ID "
1366 "option:\nUsage: %s\n",
1372 "and a thread index argument:\nUsage: %s\n",
1377 Thread *new_thread =
nullptr;
1386 if (new_thread ==
nullptr) {
1394 if (new_thread ==
nullptr) {
1415 interpreter,
"thread list",
1416 "Show a summary of each thread in the current target process. "
1417 "Use 'settings set thread-format' to customize the individual "
1420 eCommandRequiresProcess | eCommandTryTargetAPILock |
1421 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1430 const bool only_threads_with_stop_reason =
false;
1431 const uint32_t start_frame = 0;
1432 const uint32_t num_frames = 0;
1433 const uint32_t num_frames_with_source = 0;
1435 process->
GetThreadStatus(strm, only_threads_with_stop_reason, start_frame,
1436 num_frames, num_frames_with_source,
false);
1441#define LLDB_OPTIONS_thread_info
1442#include "CommandOptions.inc"
1463 switch (short_option) {
1477 llvm_unreachable(
"Unimplemented option");
1483 return llvm::ArrayRef(g_thread_info_options);
1493 interpreter,
"thread info",
1494 "Show an extended summary of one or "
1495 "more threads. Defaults to the "
1498 eCommandRequiresProcess | eCommandTryTargetAPILock |
1499 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {
1517 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1524 Thread *thread = thread_sp.get();
1525 if (
m_options.m_backing_thread && thread->GetBackingThread())
1526 thread = thread->GetBackingThread().get();
1533 thread->GetIndexID());
1548 interpreter,
"thread exception",
1549 "Display the current exception object for a thread. Defaults to "
1550 "the current thread.",
1552 eCommandRequiresProcess | eCommandTryTargetAPILock |
1553 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1567 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1575 ValueObjectSP exception_object_sp = thread_sp->GetCurrentException();
1576 if (exception_object_sp) {
1577 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1583 ThreadSP exception_thread_sp = thread_sp->GetCurrentExceptionBacktrace();
1584 if (exception_thread_sp && exception_thread_sp->IsValid()) {
1585 const uint32_t num_frames_with_source = 0;
1586 const bool stop_format =
false;
1587 exception_thread_sp->GetStatus(strm, 0,
UINT32_MAX,
1588 num_frames_with_source, stop_format,
1600 interpreter,
"thread siginfo",
1601 "Display the current siginfo object for a thread. Defaults to "
1602 "the current thread.",
1604 eCommandRequiresProcess | eCommandTryTargetAPILock |
1605 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1619 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
1629 thread_sp->GetIndexID());
1632 ValueObjectSP exception_object_sp = thread_sp->GetSiginfoValue();
1633 if (exception_object_sp) {
1634 if (llvm::Error
error = exception_object_sp->Dump(strm)) {
1639 strm.
Printf(
"(no siginfo)\n");
1647#define LLDB_OPTIONS_thread_return
1648#include "CommandOptions.inc"
1667 switch (short_option) {
1676 "invalid boolean value '%s' for 'x' option",
1677 option_arg.str().c_str());
1681 llvm_unreachable(
"Unimplemented option");
1691 return llvm::ArrayRef(g_thread_return_options);
1701 "Prematurely return from a stack frame, "
1702 "short-circuiting execution of newer frames "
1703 "and optionally yielding a specified value. Defaults "
1704 "to the exiting the current stack "
1707 eCommandRequiresFrame | eCommandTryTargetAPILock |
1708 eCommandProcessMustBeLaunched |
1709 eCommandProcessMustBePaused) {
1723 if (command.starts_with(
"-x")) {
1724 if (command.size() != 2U)
1725 result.
AppendWarning(
"return values ignored when returning from user "
1726 "called expressions");
1730 error = thread->UnwindInnermostExpression();
1731 if (!
error.Success()) {
1743 "Could not select 0th frame after unwinding expression.");
1752 uint32_t frame_idx = frame_sp->GetFrameIndex();
1754 if (frame_sp->IsInlined()) {
1755 result.
AppendError(
"don't know how to return from inlined frames");
1759 if (!command.empty()) {
1768 return_valobj_sp, options);
1770 if (return_valobj_sp)
1772 "Error evaluating result expression: %s",
1773 return_valobj_sp->GetError().AsCString());
1776 "Unknown error evaluating result expression.");
1783 const bool broadcast =
true;
1784 error = thread_sp->ReturnFromFrame(frame_sp, return_valobj_sp, broadcast);
1785 if (!
error.Success()) {
1787 "Error returning from frame %d of thread %d: %s.", frame_idx,
1788 thread_sp->GetIndexID(),
error.AsCString());
1799#define LLDB_OPTIONS_thread_jump
1800#include "CommandOptions.inc"
1823 switch (short_option) {
1832 option_arg.str().c_str());
1835 option_arg.consume_front(
"+");
1839 option_arg.str().c_str());
1850 llvm_unreachable(
"Unimplemented option");
1856 return llvm::ArrayRef(g_thread_jump_options);
1868 interpreter,
"thread jump",
1869 "Sets the program counter to a new address.",
"thread jump",
1870 eCommandRequiresFrame | eCommandTryTargetAPILock |
1871 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
1896 if (!reg_ctx->
SetPC(callAddr)) {
1898 thread->GetIndexID());
1903 int32_t line = (int32_t)
m_options.m_line_num;
1909 if (
m_options.m_filenames.GetSize() == 1)
1910 file =
m_options.m_filenames.GetFileSpecAtIndex(0);
1914 "no source file available for the current location");
1918 std::string warnings;
1919 Status err = thread->JumpToLine(file, line,
m_options.m_force, &warnings);
1926 if (!warnings.empty())
1939#define LLDB_OPTIONS_thread_plan_list
1940#include "CommandOptions.inc"
1958 switch (short_option) {
1964 if (option_arg.getAsInteger(0, tid))
1966 option_arg.str().c_str());
1976 llvm_unreachable(
"Unimplemented option");
1990 return llvm::ArrayRef(g_thread_plan_list_options);
2002 interpreter,
"thread plan list",
2003 "Show thread plans for one or more threads. If no threads are "
2004 "specified, show the "
2005 "current thread. Use the thread-index \"all\" to see all threads.",
2007 eCommandRequiresProcess | eCommandRequiresThread |
2008 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2009 eCommandProcessMustBePaused) {}
2022 m_exe_ctx.GetProcessPtr()->DumpThreadPlans(
2053 if (llvm::is_contained(
m_options.m_tids, tid))
2076 "Discards thread plans up to and including the "
2077 "specified index (see 'thread plan list'.) "
2078 "Only user visible plans can be discarded.",
2080 eCommandRequiresProcess | eCommandRequiresThread |
2081 eCommandTryTargetAPILock |
2082 eCommandProcessMustBeLaunched |
2083 eCommandProcessMustBePaused) {
2095 m_exe_ctx.GetThreadPtr()->AutoCompleteThreadPlans(request);
2102 "thread plan index - but got %zu.",
2107 uint32_t thread_plan_idx;
2110 "Invalid thread index: \"%s\" - should be unsigned int.",
2115 if (thread_plan_idx == 0) {
2117 "You wouldn't really want me to discard the base thread plan.");
2121 if (thread->DiscardUserThreadPlansUpToIndex(thread_plan_idx)) {
2125 "Could not find User thread plan with index %s.",
2135 "Removes any thread plans associated with "
2136 "currently unreported threads. "
2137 "Specify one or more TID's to remove, or if no "
2138 "TID's are provides, remove threads for all "
2139 "unreported threads",
2141 eCommandRequiresProcess |
2142 eCommandTryTargetAPILock |
2143 eCommandProcessMustBeLaunched |
2144 eCommandProcessMustBePaused) {
2161 std::lock_guard<std::recursive_mutex> guard(
2164 for (
size_t i = 0; i < num_args; i++) {
2187 interpreter,
"plan",
2188 "Commands for managing thread plans that control execution.",
2189 "thread plan <subcommand> [<subcommand objects]") {
2211 interpreter,
"trace thread export",
2212 "Commands for exporting traces of the threads in the current "
2213 "process to different formats.",
2214 "thread trace export <export-plugin> [<subcommand objects>]") {
2217 if (cbs.create_thread_trace_export_command)
2219 cbs.create_thread_trace_export_command(interpreter));
2230 true, interpreter,
"thread trace start",
2231 "Start tracing threads with the corresponding trace "
2232 "plug-in for the current process.",
2233 "thread trace start [<trace-options>]") {}
2247 interpreter,
"thread trace stop",
2248 "Stop tracing threads, including the ones traced with the "
2249 "\"process trace start\" command."
2250 "Defaults to the current thread. Thread indices can be "
2251 "specified as arguments.\n Use the thread-index \"all\" to stop "
2253 "for all existing threads.",
2254 "thread trace stop [<thread-index> <thread-index> ...]",
2255 eCommandRequiresProcess | eCommandTryTargetAPILock |
2256 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2257 eCommandProcessMustBeTraced) {}
2262 llvm::ArrayRef<lldb::tid_t> tids)
override {
2265 TraceSP trace_sp = process_sp->GetTarget().GetTrace();
2267 if (llvm::Error err = trace_sp->Stop(tids))
2282 uint32_t thread_idx;
2284 if (!llvm::to_integer(arg, thread_idx)) {
2296#define LLDB_OPTIONS_thread_trace_dump_function_calls
2297#include "CommandOptions.inc"
2312 switch (short_option) {
2327 llvm_unreachable(
"Unimplemented option");
2338 return llvm::ArrayRef(g_thread_trace_dump_function_calls_options);
2350 interpreter,
"thread trace dump function-calls",
2351 "Dump the traced function-calls for one thread. If no "
2352 "thread is specified, the current thread is used.",
2354 eCommandRequiresProcess | eCommandRequiresThread |
2355 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2356 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2372 llvm::Expected<TraceCursorSP> cursor_or_error =
2373 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2375 if (!cursor_or_error) {
2376 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2381 std::optional<StreamFile> out_file;
2383 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2388 m_options.m_dumper_options.forwards =
true;
2401#define LLDB_OPTIONS_thread_trace_dump_instructions
2402#include "CommandOptions.inc"
2417 switch (short_option) {
2420 if (option_arg.empty() || option_arg.getAsInteger(0, count) ||
2423 "invalid integer value for option '%s'",
2424 option_arg.str().c_str());
2435 if (option_arg.empty() || option_arg.getAsInteger(0,
skip) ||
skip < 0)
2437 "invalid integer value for option '%s'",
2438 option_arg.str().c_str());
2445 if (option_arg.empty() || option_arg.getAsInteger(0,
id))
2447 "invalid integer value for option '%s'",
2448 option_arg.str().c_str());
2496 llvm_unreachable(
"Unimplemented option");
2509 return llvm::ArrayRef(g_thread_trace_dump_instructions_options);
2523 interpreter,
"thread trace dump instructions",
2524 "Dump the traced instructions for one thread. If no "
2525 "thread is specified, show the current thread.",
2527 eCommandRequiresProcess | eCommandRequiresThread |
2528 eCommandTryTargetAPILock | eCommandProcessMustBeLaunched |
2529 eCommandProcessMustBePaused | eCommandProcessMustBeTraced) {
2538 uint32_t index)
override {
2541 if (cmd.find(
" --continue") == std::string::npos)
2542 cmd +=
" --continue";
2561 llvm::Expected<TraceCursorSP> cursor_or_error =
2562 m_exe_ctx.GetTargetSP()->GetTrace()->CreateNewCursor(*thread_sp);
2564 if (!cursor_or_error) {
2565 result.
AppendError(llvm::toString(cursor_or_error.takeError()));
2571 !cursor_sp->HasId(*
m_options.m_dumper_options.id)) {
2576 std::optional<StreamFile> out_file;
2578 out_file.emplace(
m_options.m_output_file->GetPath().c_str(),
2604#define LLDB_OPTIONS_thread_trace_dump_info
2605#include "CommandOptions.inc"
2620 switch (short_option) {
2630 llvm_unreachable(
"Unimplemented option");
2641 return llvm::ArrayRef(g_thread_trace_dump_info_options);
2651 interpreter,
"thread trace dump info",
2652 "Dump the traced information for one or more threads. If no "
2653 "threads are specified, show the current thread. Use the "
2654 "thread-index \"all\" to see all threads.",
2656 eCommandRequiresProcess | eCommandTryTargetAPILock |
2657 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
2658 eCommandProcessMustBeTraced) {}
2668 m_exe_ctx.GetProcessPtr()->GetThreadList().FindThreadByID(tid);
2682 interpreter,
"dump",
2683 "Commands for displaying trace information of the threads "
2684 "in the current process.",
2685 "thread trace dump <subcommand> [<subcommand objects>]") {
2703 interpreter,
"trace",
2704 "Commands for operating on traces of the threads in the current "
2706 "thread trace <subcommand> [<subcommand objects>]") {
2725 "Commands for operating on "
2726 "one or more threads in "
2727 "the current process.",
2728 "thread <subcommand> [<subcommand-options>]") {
2751 interpreter,
"thread step-in",
2752 "Source level single step, stepping into calls. Defaults "
2753 "to current thread unless specified.",
2758 interpreter,
"thread step-out",
2759 "Finish executing the current stack frame and stop after "
2760 "returning. Defaults to current thread unless specified.",
2765 interpreter,
"thread step-over",
2766 "Source level single step, stepping over calls. Defaults "
2767 "to current thread unless specified.",
2772 interpreter,
"thread step-inst",
2773 "Instruction level single step, stepping into calls. "
2774 "Defaults to current thread unless specified.",
2779 interpreter,
"thread step-inst-over",
2780 "Instruction level single step, stepping over calls. "
2781 "Defaults to current thread unless specified.",
2787 interpreter,
"thread step-scripted",
2788 "Step as instructed by the script class passed in the -C option. "
2789 "You can also specify a dictionary of key (-k) and value (-v) pairs "
2790 "that will be used to populate an SBStructuredData Dictionary, which "
2791 "will be passed to the constructor of the class implementing the "
2792 "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.