63#include "clang/Frontend/CompilerInstance.h"
64#include "clang/Frontend/CompilerInvocation.h"
65#include "clang/Frontend/FrontendActions.h"
66#include "clang/Serialization/ObjectFilePCHContainerReader.h"
67#include "llvm/ADT/ScopeExit.h"
68#include "llvm/ADT/StringRef.h"
69#include "llvm/Support/FileSystem.h"
70#include "llvm/Support/FormatAdapters.h"
77 const char *prefix_cstr,
78 bool show_stopped_process_status,
Stream &strm) {
83 bool exe_valid =
false;
88 ::strcpy(exe_path,
"<none>");
90 std::string formatted_label =
"";
91 const std::string &label = target->
GetLabel();
93 formatted_label =
" (" + label +
")";
96 strm.
Printf(
"%starget #%u%s: %s", prefix_cstr ? prefix_cstr :
"", target_idx,
97 formatted_label.data(), exe_path);
99 uint32_t properties = 0;
107 strm.
Format(
"{0}platform={1}", properties++ > 0 ?
", " :
" ( ",
108 platform_sp->GetName());
111 bool show_process_status =
false;
114 StateType state = process_sp->GetState();
115 if (show_stopped_process_status)
119 strm.
Printf(
"%spid=%" PRIu64, properties++ > 0 ?
", " :
" ( ", pid);
120 strm.
Printf(
"%sstate=%s", properties++ > 0 ?
", " :
" ( ", state_cstr);
126 if (show_process_status) {
127 const bool only_threads_with_stop_reason =
true;
128 const uint32_t start_frame = 0;
129 const uint32_t num_frames = 1;
130 const uint32_t num_frames_with_source = 1;
131 const bool stop_format =
false;
132 process_sp->GetStatus(strm);
133 process_sp->GetThreadStatus(strm, only_threads_with_stop_reason,
134 start_frame, num_frames, num_frames_with_source,
140 bool show_stopped_process_status,
Stream &strm) {
145 for (uint32_t i = 0; i < num_targets; ++i) {
148 bool is_selected = target_sp.get() == selected_target_sp.get();
150 show_stopped_process_status, strm);
157#define LLDB_OPTIONS_target_dependents
158#include "CommandOptions.inc"
167 return llvm::ArrayRef(g_target_dependents_options);
175 if (option_value.empty()) {
180 const char short_option =
181 g_target_dependents_options[option_idx].short_option;
182 if (short_option ==
'd') {
185 option_value, g_target_dependents_options[option_idx].enum_values, 0,
191 "unrecognized short option '%c'", short_option);
211#pragma mark CommandObjectTargetCreate
217 interpreter,
"target create",
218 "Create a target using the argument as the main executable.",
222 "Fullpath to a core file to use for this target."),
224 "Optional name for this target.", nullptr),
227 "Fullpath to a stand alone debug "
228 "symbols file for when debug symbols "
229 "are not in the executable."),
232 "Fullpath to the file on the remote host if debugging remotely.") {
263 llvm::toString(file.takeError()));
268 if (argc == 1 || core_file || remote_file) {
277 llvm::toString(file.takeError()));
285 bool must_set_platform_path =
false;
290 llvm::StringRef arch_cstr =
m_arch_option.GetArchitectureName();
292 debugger, file_path, arch_cstr,
301 const llvm::StringRef label =
302 m_label.GetOptionValue().GetCurrentValueAsRef();
303 if (!label.empty()) {
304 if (
auto E = target_sp->SetLabel(label))
309 auto on_error = llvm::make_scope_exit(
311 target_list.DeleteTarget(target_sp);
318 PlatformSP platform_sp = target_sp->GetPlatform();
322 file_spec.
SetFile(file_path, FileSpec::Style::native);
327 if (platform_sp && platform_sp->IsHost() &&
337 if (!platform_sp->GetFileExists(remote_file)) {
338 Status err = platform_sp->PutFile(file_spec, remote_file);
352 Status err = platform_sp->GetFile(remote_file, file_spec);
366 if (platform_sp->IsHost()) {
367 result.
AppendError(
"Supply a local file, not a remote file, "
368 "when debugging on the host.");
371 if (platform_sp->IsConnected() && !platform_sp->GetFileExists(remote_file)) {
372 result.
AppendError(
"remote --> local transfer without local "
373 "path is not implemented yet");
380 target_sp->SetProcessLaunchInfo(launch_info);
384 result.
AppendError(
"no platform found for target");
389 if (symfile || remote_file) {
390 ModuleSP module_sp(target_sp->GetExecutableModule());
393 module_sp->SetSymbolFileFileSpec(symfile);
395 std::string remote_path = remote_file.
GetPath();
396 target_sp->SetArg0(remote_path.c_str());
397 module_sp->SetPlatformFileSpec(remote_file);
402 if (must_set_platform_path) {
405 target_sp->GetOrCreateModule(main_module_spec,
true );
407 module_sp->SetPlatformFileSpec(remote_file);
413 target_sp->AppendExecutableSearchPaths(core_file_dir);
415 ProcessSP process_sp(target_sp->CreateProcess(
416 GetDebugger().GetListener(), llvm::StringRef(), &core_file,
false));
421 error = process_sp->LoadCore();
428 "Core file '{0}' ({1}) was loaded.\n", core_file.
GetPath(),
429 target_sp->GetArchitecture().GetArchitectureName());
439 "Current executable set to '%s' (%s).\n",
441 target_sp->GetArchitecture().GetArchitectureName());
447 "argument, or use the --core option.\n",
463#pragma mark CommandObjectTargetList
469 interpreter,
"target list",
470 "List all current targets in the current debug session.", nullptr) {
479 bool show_stopped_process_status =
false;
481 show_stopped_process_status, strm) == 0) {
488#pragma mark CommandObjectTargetSelect
494 interpreter,
"target select",
495 "Select a target as the current target by target index.", nullptr) {
508 if (llvm::to_integer(target_identifier, target_idx)) {
509 if (target_idx < num_targets) {
512 bool show_stopped_process_status =
false;
516 if (num_targets > 0) {
518 "index %u is out of range, valid target indexes are 0 - %u\n",
519 target_idx, num_targets - 1);
522 "index %u is out of range since there are no active targets\n",
527 for (
size_t i = 0; i < num_targets; i++) {
529 const std::string &label = target_sp->GetLabel();
530 if (!label.empty() && label == target_identifier) {
540 bool show_stopped_process_status =
false;
550 "'target select' takes a single argument: a target index\n");
555#pragma mark CommandObjectTargetDelete
561 "Delete one or more targets by target index.",
567 "Perform extra cleanup to minimize memory consumption after "
568 "deleting the target. "
569 "By default, LLDB will keep in memory any modules previously "
570 "loaded by the target as well "
571 "as all of its debug info. Specifying --clean will unload all of "
572 "these shared modules and "
573 "cause them to be reparsed again the next time the target is run",
588 std::vector<TargetSP> delete_target_list;
595 }
else if (argc > 0) {
598 if (num_targets == 0) {
603 for (
auto &entry : args.
entries()) {
605 if (entry.ref().getAsInteger(0, target_idx)) {
610 if (target_idx < num_targets) {
613 delete_target_list.push_back(target_sp);
619 "target indexes are 0 - %u\n",
620 target_idx, num_targets - 1);
623 "target index %u is out of range, the only valid index is 0\n",
634 delete_target_list.push_back(target_sp);
637 const size_t num_targets_to_delete = delete_target_list.size();
638 for (
size_t idx = 0; idx < num_targets_to_delete; ++idx) {
639 target_sp = delete_target_list[idx];
641 target_sp->Destroy();
646 const bool mandatory =
true;
650 (uint32_t)num_targets_to_delete);
663 interpreter,
"target show-launch-environment",
664 "Shows the environment being passed to the process when launched, "
665 "taking info account 3 settings: target.env-vars, "
666 "target.inherit-env and target.unset-env-vars.",
667 nullptr, eCommandRequiresTarget) {}
676 std::vector<Environment::value_type *> env_vector;
677 env_vector.reserve(env.size());
679 env_vector.push_back(&KV);
680 std::sort(env_vector.begin(), env_vector.end(),
681 [](Environment::value_type *a, Environment::value_type *b) {
682 return a->first() < b->first();
686 for (
auto &KV : env_vector)
687 strm.
Format(
"{0}={1}\n", KV->first(), KV->second);
693#pragma mark CommandObjectTargetVariable
702 "Read global variables for the current target, "
703 "before or while running a process.",
704 nullptr, eCommandRequiresTarget),
709 "A basename or fullpath to a file that contains "
710 "global variables. This option can be "
711 "specified multiple times."),
715 "A basename or fullpath to a shared library to use in the search "
717 "variables. This option can be specified multiple times.") {
736 const char *root_name) {
739 if (!valobj_sp->GetTargetSP()->GetDisplayRuntimeSupportValues() &&
740 valobj_sp->IsRuntimeSupportValue())
743 switch (var_sp->GetScope()) {
774 bool show_fullpaths =
false;
775 bool show_module =
true;
776 if (var_sp->DumpDeclaration(&s, show_fullpaths, show_module))
786 if (llvm::Error
error = valobj_sp->Dump(s, options))
792 size_t old_size = variable_list.
GetSize();
797 return variable_list.
GetSize() - old_size;
808 if (variable_list.
Empty())
812 s.
Format(
"Global variables for {0} in {1}:\n",
815 s.
Printf(
"Global variables for %s\n",
816 sc.
module_sp->GetFileSpec().GetPath().c_str());
845 bool use_var_name =
false;
850 "error: invalid regular expression: '%s'\n", arg.c_str());
856 matches = variable_list.
GetSize();
859 arg.c_str(),
m_exe_ctx.GetBestExecutionContextScope(),
861 matches = variable_list.
GetSize();
869 for (uint32_t global_idx = 0; global_idx < matches; ++global_idx) {
876 m_exe_ctx.GetBestExecutionContextScope(), var_sp);
880 use_var_name ? var_sp->GetName().GetCString()
892 const size_t num_compile_units = compile_units.
GetSize();
893 const size_t num_shlibs = shlibs.
GetSize();
894 if (num_compile_units == 0 && num_shlibs == 0) {
895 bool success =
false;
902 const bool can_create =
true;
905 if (comp_unit_varlist_sp) {
906 size_t count = comp_unit_varlist_sp->GetSize();
919 "no global variables in current compile unit: {0}\n",
923 "no debug information for frame %u\n",
926 result.
AppendError(
"'target variable' takes one or more global "
927 "variable names as arguments\n");
932 if (num_shlibs > 0) {
933 for (
size_t shlib_idx = 0; shlib_idx < num_shlibs; ++shlib_idx) {
940 if (num_compile_units > 0) {
941 for (
size_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
942 module_sp->FindCompileUnits(
952 "target doesn't contain the specified shared library: %s\n",
953 module_file.
GetPath().c_str());
959 for (
size_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
966 const bool can_create =
true;
968 sc.comp_unit->GetVariableList(can_create));
969 if (comp_unit_varlist_sp)
972 }
else if (sc.module_sp) {
975 llvm::StringRef(
"."));
977 sc.module_sp->FindGlobalVariables(all_globals_regex,
UINT32_MAX,
997#pragma mark CommandObjectTargetModulesSearchPathsAdd
1003 "Add new image search paths substitution pairs to "
1004 "the current target.",
1005 nullptr, eCommandRequiresTarget) {
1024 arg.push_back(old_prefix_arg);
1025 arg.push_back(new_prefix_arg);
1037 result.
AppendError(
"add requires an even number of arguments\n");
1039 for (
size_t i = 0; i < argc; i += 2) {
1043 if (from[0] && to[0]) {
1047 "target modules search path adding ImageSearchPath "
1048 "pair: '%s' -> '%s'",
1051 bool last_pair = ((argc - i) == 2);
1053 from, to, last_pair);
1057 result.
AppendError(
"<path-prefix> can't be empty\n");
1059 result.
AppendError(
"<new-path-prefix> can't be empty\n");
1066#pragma mark CommandObjectTargetModulesSearchPathsClear
1072 "Clear all current image search path substitution "
1073 "pairs from the current target.",
1074 "target modules search-paths clear",
1075 eCommandRequiresTarget) {}
1088#pragma mark CommandObjectTargetModulesSearchPathsInsert
1094 "Insert a new image search path substitution pair "
1095 "into the current target at the specified index.",
1096 nullptr, eCommandRequiresTarget) {
1108 arg1.push_back(index_arg);
1124 arg2.push_back(old_prefix_arg);
1125 arg2.push_back(new_prefix_arg);
1142 const size_t num = list.
GetSize();
1144 for (
size_t i = 0; i < num; ++i) {
1148 strm << old_path <<
" -> " << new_path;
1158 if (argc >= 3 && argc & 1) {
1159 uint32_t insert_idx;
1163 "<index> parameter is not an integer: '%s'.\n",
1172 for (uint32_t i = 0; i < argc; i += 2, ++insert_idx) {
1176 if (from[0] && to[0]) {
1177 bool last_pair = ((argc - i) == 2);
1183 result.
AppendError(
"<path-prefix> can't be empty\n");
1185 result.
AppendError(
"<new-path-prefix> can't be empty\n");
1190 result.
AppendError(
"insert requires at least three arguments\n");
1195#pragma mark CommandObjectTargetModulesSearchPathsList
1201 "List all current image search path substitution "
1202 "pairs in the current target.",
1203 "target modules search-paths list",
1204 eCommandRequiresTarget) {}
1216#pragma mark CommandObjectTargetModulesSearchPathsQuery
1222 interpreter,
"target modules search-paths query",
1223 "Transform a path using the first applicable image search path.",
1224 nullptr, eCommandRequiresTarget) {
1234 result.
AppendError(
"query requires one argument\n");
1251 bool full_triple, uint32_t width) {
1256 module->GetArchitecture().DumpTriple(arch_strm.AsRawOstream());
1259 std::string arch_str = std::string(arch_strm.
GetString());
1262 strm.
Printf(
"%-*s", width, arch_str.c_str());
1270 module->GetUUID().Dump(strm);
1279 uint32_t num_matches = 0;
1282 num_matches =
module->ResolveSymbolContextsForFileSpec(
1283 file_spec, 0, false, eSymbolContextCompUnit, sc_list);
1285 bool first_module =
true;
1290 strm <<
"Line table for " << sc.comp_unit->GetPrimaryFile() <<
" in `"
1291 <<
module->GetFileSpec().GetFilename() << "\n";
1292 LineTable *line_table = sc.comp_unit->GetLineTable();
1298 strm <<
"No line table";
1300 first_module =
false;
1308 if (file_spec_ptr) {
1310 std::string fullpath = file_spec_ptr->
GetPath();
1311 strm.
Printf(
"%-*s", width, fullpath.c_str());
1320 strm.
Printf(
"%-*s", width,
"");
1325 if (file_spec_ptr) {
1334 strm.
Printf(
"%-*s", width,
"");
1339 if (file_spec_ptr) {
1348 strm.
Printf(
"%-*s", width,
"");
1352 std::lock_guard<std::recursive_mutex> guard(module_list.
GetMutex());
1353 const size_t num_modules = module_list.
GetSize();
1354 if (num_modules == 0)
1357 size_t num_dumped = 0;
1358 strm.
Format(
"Dumping headers for {0} module(s).\n", num_modules);
1362 if (num_dumped++ > 0) {
1366 ObjectFile *objfile = module_sp->GetObjectFile();
1368 objfile->
Dump(&strm);
1370 strm.
Format(
"No object file for module: {0:F}\n",
1371 module_sp->GetFileSpec());
1386 sort_order, name_preference);
1392 SectionList *section_list =
module->GetSectionList();
1394 strm.
Printf(
"Sections for '%s' (%s):\n",
1407 symbol_file->Dump(strm);
1415 Module *module,
bool errors_only,
1416 bool load_all_debug_info) {
1420 if (symbol_file->GetSeparateDebugInfo(d, errors_only,
1421 load_all_debug_info)) {
1423 std::make_shared<StructuredData::Dictionary>(std::move(d)));
1436 "------------------ --- -----------------------------------------");
1445 strm.
Printf(
"0x%16.16" PRIx64
" ", dwo_id);
1447 strm.
Printf(
"0x???????????????? ");
1449 llvm::StringRef
error;
1451 strm <<
"E " <<
error;
1453 llvm::StringRef resolved_dwo_path;
1455 resolved_dwo_path)) {
1456 strm <<
" " << resolved_dwo_path;
1457 if (resolved_dwo_path.ends_with(
".dwp")) {
1458 llvm::StringRef dwo_name;
1460 strm <<
"(" << dwo_name <<
")";
1473 strm.
PutCString(
"------------------ --- ---------------------");
1480 uint32_t oso_mod_time;
1482 strm.
Printf(
"0x%16.16" PRIx32
" ", oso_mod_time);
1484 llvm::StringRef
error;
1486 strm <<
"E " <<
error;
1488 llvm::StringRef oso_path;
1490 strm <<
" " << oso_path;
1499 bool verbose,
bool all_ranges,
Stream &strm,
1500 std::optional<Stream::HighlightSettings> settings = std::nullopt) {
1502 strm.
Indent(
" Address: ");
1507 strm.
Indent(
" Summary: ");
1523 Module *module, uint32_t resolve_mask,
1525 bool verbose,
bool all_ranges) {
1534 else if (so_addr.
GetModule().get() != module)
1543 DumpAddress(exe_scope, so_addr, verbose, all_ranges, strm);
1552 const char *name,
bool name_is_regex,
1553 bool verbose,
bool all_ranges) {
1557 Symtab *symtab =
module->GetSymtab();
1563 std::vector<uint32_t> match_indexes;
1565 uint32_t num_matches = 0;
1566 if (name_is_regex) {
1575 if (num_matches > 0) {
1577 strm.
Printf(
"%u symbols match %s'%s' in ", num_matches,
1578 name_is_regex ?
"the regular expression " :
"", name);
1585 for (uint32_t i = 0; i < num_matches; ++i) {
1592 use_color && name_is_regex
1593 ? std::optional<Stream::HighlightSettings>{settings}
1601 use_color && name_is_regex
1602 ? std::optional<Stream::HighlightSettings>{settings}
1623 std::optional<Stream::HighlightSettings> settings = std::nullopt) {
1625 bool first_module =
true;
1631 if (sc.line_entry.IsValid())
1632 addr = sc.line_entry.range.GetBaseAddress();
1633 else if (sc.block && sc.block->GetContainingInlinedBlock())
1634 sc.block->GetContainingInlinedBlock()->GetStartAddress(addr);
1636 addr = sc.GetFunctionOrSymbolAddress();
1638 DumpAddress(exe_scope, addr, verbose, all_ranges, strm, settings);
1639 first_module =
false;
1646 const char *name,
bool name_is_regex,
1648 bool verbose,
bool all_ranges) {
1649 if (module && name && name[0]) {
1651 size_t num_matches = 0;
1652 if (name_is_regex) {
1654 module->FindFunctions(function_name_regex, options, sc_list);
1657 module->FindFunctions(function_name, CompilerDeclContext(),
1658 eFunctionNameTypeAuto, options, sc_list);
1660 num_matches = sc_list.
GetSize();
1663 strm.
Printf(
"%" PRIu64
" match%s found in ", (uint64_t)num_matches,
1664 num_matches > 1 ?
"es" :
"");
1669 strm, sc_list, verbose, all_ranges);
1678 Module *module,
const char *name_cstr,
1679 bool name_is_regex) {
1680 if (module && name_cstr && name_cstr[0]) {
1683 module->FindTypes(query, results);
1688 sc.
module_sp =
module->shared_from_this();
1692 if (type_list.
Empty())
1695 const uint64_t num_matches = type_list.
GetSize();
1698 strm.
Printf(
"%" PRIu64
" match%s found in ", num_matches,
1699 num_matches > 1 ?
"es" :
"");
1707 type_sp->GetFullCompilerType();
1710 TypeSP typedef_type_sp(type_sp);
1711 TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
1712 while (typedefed_type_sp) {
1714 strm.
Printf(
" typedef '%s': ",
1715 typedef_type_sp->GetName().GetCString());
1716 typedefed_type_sp->GetFullCompilerType();
1719 typedef_type_sp = typedefed_type_sp;
1720 typedefed_type_sp = typedef_type_sp->GetTypedefType();
1731 const char *name_cstr,
bool name_is_regex) {
1734 module.FindTypes(query, results);
1737 sc.
module_sp =
module.shared_from_this();
1739 if (type_list.
Empty())
1751 type_sp->GetFullCompilerType();
1754 TypeSP typedef_type_sp(type_sp);
1755 TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
1756 while (typedefed_type_sp) {
1758 strm.
Printf(
" typedef '%s': ",
1759 typedef_type_sp->GetName().GetCString());
1760 typedefed_type_sp->GetFullCompilerType();
1763 typedef_type_sp = typedefed_type_sp;
1764 typedefed_type_sp = typedef_type_sp->GetTypedefType();
1774 uint32_t line,
bool check_inlines,
1775 bool verbose,
bool all_ranges) {
1776 if (module && file_spec) {
1778 const uint32_t num_matches =
module->ResolveSymbolContextsForFileSpec(
1779 file_spec, line, check_inlines, eSymbolContextEverything, sc_list);
1780 if (num_matches > 0) {
1782 strm.
Printf(
"%u match%s found in ", num_matches,
1783 num_matches > 1 ?
"es" :
"");
1786 strm.
Printf(
":%u", line);
1792 strm, sc_list, verbose, all_ranges);
1801 bool check_global_list) {
1802 FileSpec module_file_spec(module_name);
1805 const size_t initial_size = module_list.
GetSize();
1807 if (check_global_list) {
1809 std::lock_guard<std::recursive_mutex> guard(
1813 for (
size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
1818 module_sp =
module->shared_from_this();
1826 const size_t num_matches = module_list.
GetSize();
1830 if (num_matches == 0) {
1839 return module_list.
GetSize() - initial_size;
1842#pragma mark CommandObjectTargetModulesModuleAutoComplete
1869#pragma mark CommandObjectTargetModulesSourceFileAutoComplete
1879 const char *syntax, uint32_t flags)
1894#pragma mark CommandObjectTargetModulesDumpObjfile
1901 interpreter,
"target modules dump objfile",
1902 "Dump the object file headers from one or more target modules.",
1903 nullptr, eCommandRequiresTarget) {}
1915 size_t num_dumped = 0;
1920 if (num_dumped == 0) {
1921 result.
AppendError(
"the target has no associated executable images");
1926 const char *arg_cstr;
1927 for (
int arg_idx = 0;
1930 size_t num_matched =
1932 if (num_matched == 0) {
1934 "Unable to find an image that matches '%s'.\n", arg_cstr);
1942 if (num_dumped > 0) {
1945 result.
AppendError(
"no matching executable images found");
1950#define LLDB_OPTIONS_target_modules_dump_symtab
1951#include "CommandOptions.inc"
1958 interpreter,
"target modules dump symtab",
1959 "Dump the symbol table from one or more target modules.", nullptr,
1960 eCommandRequiresTarget) {}
1977 switch (short_option) {
1990 llvm_unreachable(
"Unimplemented option");
2001 return llvm::ArrayRef(g_target_modules_dump_symtab_options);
2011 uint32_t num_dumped = 0;
2023 std::lock_guard<std::recursive_mutex> guard(module_list.
GetMutex());
2024 const size_t num_modules = module_list.
GetSize();
2025 if (num_modules > 0) {
2027 "Dumping symbol table for {0} modules.\n", num_modules);
2029 if (num_dumped > 0) {
2034 "Interrupted in dump all symtabs with {0} "
2035 "of {1} dumped.", num_dumped, num_modules))
2040 module_sp.get(),
m_options.m_sort_order,
2044 result.
AppendError(
"the target has no associated executable images");
2049 const char *arg_cstr;
2050 for (
int arg_idx = 0;
2054 const size_t num_matches =
2056 if (num_matches > 0) {
2059 if (num_dumped > 0) {
2064 "Interrupted in dump symtab list with {0} of {1} dumped.",
2065 num_dumped, num_matches))
2070 module_sp.get(),
m_options.m_sort_order,
2076 "Unable to find an image that matches '%s'.\n", arg_cstr);
2083 result.
AppendError(
"no matching executable images found");
2090#pragma mark CommandObjectTargetModulesDumpSections
2099 interpreter,
"target modules dump sections",
2100 "Dump the sections from one or more target modules.",
2102 nullptr, eCommandRequiresTarget) {}
2109 uint32_t num_dumped = 0;
2118 if (num_modules == 0) {
2119 result.
AppendError(
"the target has no associated executable images");
2125 for (
size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
2127 "Interrupted in dump all sections with {0} of {1} dumped",
2128 image_idx, num_modules))
2138 const char *arg_cstr;
2139 for (
int arg_idx = 0;
2143 const size_t num_matches =
2145 if (num_matches > 0) {
2146 for (
size_t i = 0; i < num_matches; ++i) {
2148 "Interrupted in dump section list with {0} of {1} dumped.",
2161 std::lock_guard<std::recursive_mutex> guard(
2165 "Unable to find an image that matches '%s'.\n", arg_cstr);
2173 result.
AppendError(
"no matching executable images found");
2182 interpreter,
"target modules dump pcm-info",
2183 "Dump information about the given clang module (pcm).") {
2202 result.
AppendError(
"file must have a .pcm extension");
2211 const char *clang_args[] = {
"clang", pcm_path};
2212 clang::CompilerInstance compiler(clang::createInvocation(clang_args));
2213 compiler.setVirtualFileSystem(
2215 compiler.createDiagnostics();
2219 std::shared_ptr<llvm::raw_ostream> Out(
2221 clang::DumpModuleInfoAction dump_module_info(Out);
2223 compiler.getPCHContainerOperations()->registerReader(
2224 std::make_unique<clang::ObjectFilePCHContainerReader>());
2226 if (compiler.ExecuteAction(dump_module_info))
2231#pragma mark CommandObjectTargetModulesDumpClangAST
2240 interpreter,
"target modules dump ast",
2241 "Dump the clang ast for a given module's symbol file.",
2242 "target modules dump ast [--filter <name>] [<file1> ...]",
2243 eCommandRequiresTarget),
2245 "Dump only the decls whose names contain the specified filter "
2264 const size_t num_modules = module_list.
GetSize();
2265 if (num_modules == 0) {
2266 result.
AppendError(
"the target has no associated executable images");
2270 llvm::StringRef filter =
m_filter.GetOptionValue().GetCurrentValueAsRef();
2279 if (
SymbolFile *sf = module_sp->GetSymbolFile())
2290 const size_t num_matches =
2292 if (num_matches == 0) {
2294 std::lock_guard<std::recursive_mutex> guard(
2298 "Unable to find an image that matches '%s'.\n", arg.c_str());
2302 for (
size_t i = 0; i < num_matches; ++i) {
2304 "Interrupted in dump clang ast list with {0} of {1} dumped.",
2318#pragma mark CommandObjectTargetModulesDumpSymfile
2327 interpreter,
"target modules dump symfile",
2328 "Dump the debug symbol file for one or more target modules.",
2330 nullptr, eCommandRequiresTarget) {}
2337 uint32_t num_dumped = 0;
2346 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2347 const size_t num_modules = target_modules.
GetSize();
2348 if (num_modules == 0) {
2349 result.
AppendError(
"the target has no associated executable images");
2353 "Dumping debug symbols for {0} modules.\n", num_modules);
2356 "debug symbols with {0} of {1} modules dumped",
2357 num_dumped, num_modules))
2365 const char *arg_cstr;
2366 for (
int arg_idx = 0;
2370 const size_t num_matches =
2372 if (num_matches > 0) {
2373 for (
size_t i = 0; i < num_matches; ++i) {
2375 "of {1} requested modules",
2386 "Unable to find an image that matches '%s'.\n", arg_cstr);
2393 result.
AppendError(
"no matching executable images found");
2398#pragma mark CommandObjectTargetModulesDumpLineTable
2399#define LLDB_OPTIONS_target_modules_dump
2400#include "CommandOptions.inc"
2409 interpreter,
"target modules dump line-table",
2410 "Dump the line table for one or more compilation units.", nullptr,
2411 eCommandRequiresTarget) {}
2420 uint32_t total_num_dumped = 0;
2427 result.
AppendError(
"file option must be specified");
2431 const char *arg_cstr;
2432 for (
int arg_idx = 0;
2438 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2439 size_t num_modules = target_modules.
GetSize();
2440 if (num_modules > 0) {
2441 uint32_t num_dumped = 0;
2444 "Interrupted in dump all line tables with "
2445 "{0} of {1} dumped", num_dumped,
2456 if (num_dumped == 0)
2458 "No source filenames matched '%s'.\n", arg_cstr);
2460 total_num_dumped += num_dumped;
2465 if (total_num_dumped > 0)
2468 result.
AppendError(
"no source filenames matched any command arguments");
2478 assert(option_idx == 0 &&
"We only have one option.");
2489 return llvm::ArrayRef(g_target_modules_dump_options);
2498#pragma mark CommandObjectTargetModulesDumpSeparateDebugInfoFiles
2499#define LLDB_OPTIONS_target_modules_dump_separate_debug_info
2500#include "CommandOptions.inc"
2510 interpreter,
"target modules dump separate-debug-info",
2511 "List the separate debug info symbol files for one or more target "
2513 nullptr, eCommandRequiresTarget) {}
2530 switch (short_option) {
2536 m_json.SetCurrentValue(
true);
2537 m_json.SetOptionWasSet();
2544 llvm_unreachable(
"Unimplemented option");
2556 return llvm::ArrayRef(g_target_modules_dump_separate_debug_info_options);
2567 uint32_t num_dumped = 0;
2577 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2578 const size_t num_modules = target_modules.
GetSize();
2579 if (num_modules == 0) {
2580 result.
AppendError(
"the target has no associated executable images");
2586 "Interrupted in dumping all "
2587 "separate debug info with {0} of {1} modules dumped",
2588 num_dumped, num_modules))
2599 const char *arg_cstr;
2600 for (
int arg_idx = 0;
2604 const size_t num_matches =
2606 if (num_matches > 0) {
2607 for (
size_t i = 0; i < num_matches; ++i) {
2609 "Interrupted dumping {0} "
2610 "of {1} requested modules",
2621 "Unable to find an image that matches '%s'.\n", arg_cstr);
2625 if (num_dumped > 0) {
2630 separate_debug_info_lists_by_module.
Dump(strm,
2634 separate_debug_info_lists_by_module.
ForEach(
2644 if (!separate_debug_info_list) {
2648 llvm::StringRef type;
2649 llvm::StringRef symfile;
2656 "separate-debug-info-files", files))) {
2660 strm <<
"Symbol file: " << symfile;
2662 strm <<
"Type: \"" << type <<
"\"";
2664 if (type ==
"dwo") {
2666 }
else if (type ==
"oso") {
2670 "Found unsupported debug info type '%s'.\n",
2671 type.str().c_str());
2678 result.
AppendError(
"no matching executable images found");
2685#pragma mark CommandObjectTargetModulesDump
2694 interpreter,
"target modules dump",
2695 "Commands for dumping information about one or more target "
2697 "target modules dump "
2698 "[objfile|symtab|sections|ast|symfile|line-table|pcm-info|separate-"
2700 "[<file1> <file2> ...]") {
2736 "Add a new module to the current target's modules.",
2737 "target modules add [<module>]",
2738 eCommandRequiresTarget),
2741 "Fullpath to a stand alone debug "
2742 "symbols file for when debug symbols "
2743 "are not in the executable.") {
2787 "Unable to create the executable or symbol file with "
2788 "UUID %s with path %s and symbol file %s",
2793 "Unable to create the executable or symbol file with "
2794 "UUID %s with path %s",
2800 "or symbol file with UUID %s",
2809 "Unable to locate the executable or symbol file with UUID %s",
2816 "one or more executable image paths must be specified");
2820 for (
auto &entry : args.
entries()) {
2821 if (entry.ref().empty())
2839 const char *error_cstr =
error.AsCString();
2851 std::string resolved_path = file_spec.
GetPath();
2852 if (resolved_path != entry.ref()) {
2854 "invalid module path '%s' with resolved path '%s'\n",
2855 entry.ref().str().c_str(), resolved_path.c_str());
2878 interpreter,
"target modules load",
2879 "Set the load addresses for one or more sections in a target "
2881 "target modules load [--file <module> --uuid <uuid>] <sect-name> "
2882 "<address> [<sect-name> <address> ....]",
2883 eCommandRequiresTarget),
2885 "Fullpath or basename for module to load.",
""),
2887 "Write file contents to the memory.", false, true),
2889 "Set PC to the entry point."
2890 " Only applicable with '--load' option.",
2893 "Set the load address for all sections to be the "
2894 "virtual address in the file plus the offset.",
2912 const bool load =
m_load_option.GetOptionValue().GetCurrentValue();
2913 const bool set_pc =
m_pc_option.GetOptionValue().GetCurrentValue();
2917 bool search_using_module_spec =
false;
2924 if (module_list.
GetSize() == 1) {
2925 search_using_module_spec =
true;
2933 search_using_module_spec =
true;
2934 const char *arg_cstr =
m_file_option.GetOptionValue().GetCurrentValue();
2935 const bool use_global_module_list =
true;
2938 &target, arg_cstr, module_list, use_global_module_list);
2939 if (num_matches == 1) {
2942 }
else if (num_matches > 1) {
2943 search_using_module_spec =
false;
2945 "more than 1 module matched by name '%s'\n", arg_cstr);
2947 search_using_module_spec =
false;
2954 search_using_module_spec =
true;
2959 if (search_using_module_spec) {
2962 const size_t num_matches = matching_modules.
GetSize();
2965 if (num_matches == 1) {
2968 ObjectFile *objfile =
module->GetObjectFile();
2970 SectionList *section_list =
module->GetSectionList();
2972 bool changed =
false;
2977 const bool slide_is_offset =
true;
2978 module->SetLoadAddress(target, slide, slide_is_offset,
2981 result.
AppendError(
"one or more section name + load "
2982 "address pair must be specified");
2987 result.
AppendError(
"The \"--slide <offset>\" option can't "
2988 "be used in conjunction with setting "
2989 "section load addresses.\n");
2993 for (
size_t i = 0; i < argc; i += 2) {
2996 if (sect_name && load_addr_cstr) {
2999 if (llvm::to_integer(load_addr_cstr, load_addr)) {
3003 if (section_sp->IsThreadSpecific()) {
3005 "thread specific sections are not yet "
3006 "supported (section '%s')\n",
3014 "section '%s' loaded at 0x%" PRIx64
"\n",
3015 sect_name, load_addr);
3019 "matches the section "
3026 "invalid load address string '%s'\n", load_addr_cstr);
3031 result.
AppendError(
"section names must be followed by "
3032 "a load address.\n");
3034 result.
AppendError(
"one or more section name + load "
3035 "address pair must be specified.\n");
3054 if (set_pc && !file_entry.
IsValid()) {
3055 result.
AppendError(
"No entry address in object file");
3058 std::vector<ObjectFile::LoadableData> loadables(
3060 if (loadables.size() == 0) {
3064 Status error = process->WriteObjectFile(std::move(loadables));
3070 ThreadList &thread_list = process->GetThreadList();
3074 if (!reg_context->SetPC(file_entry_addr)) {
3082 module->GetFileSpec().GetPath(path, sizeof(path));
3087 module->GetFileSpec().GetPath(path, sizeof(path));
3093 if (module_spec_file) {
3094 module_spec_file->
GetPath(path,
sizeof(path));
3100 std::string uuid_str;
3109 if (num_matches > 1) {
3111 "multiple modules match%s%s%s%s:\n", path[0] ?
" file=" :
"",
3112 path, !uuid_str.empty() ?
" uuid=" :
"", uuid_str.c_str());
3113 for (
size_t i = 0; i < num_matches; ++i) {
3121 "no modules were found that match%s%s%s%s.\n",
3122 path[0] ?
" file=" :
"", path, !uuid_str.empty() ?
" uuid=" :
"",
3127 result.
AppendError(
"either the \"--file <module>\" or the \"--uuid "
3128 "<uuid>\" option must be specified.\n");
3140#pragma mark CommandObjectTargetModulesList
3142#define LLDB_OPTIONS_target_modules_list
3143#include "CommandOptions.inc"
3158 if (short_option ==
'g') {
3160 }
else if (short_option ==
'a') {
3164 unsigned long width = 0;
3165 option_arg.getAsInteger(0, width);
3178 return llvm::ArrayRef(g_target_modules_list_options);
3190 interpreter,
"target modules list",
3191 "List current executable and dependent shared library images.") {
3202 const bool use_global_module_list =
m_options.m_use_global_module_list;
3222 "Couldn't find module matching address: 0x%" PRIx64
".",
3227 "Couldn't find module containing address: 0x%" PRIx64
".",
3233 size_t num_modules = 0;
3239 std::unique_lock<std::recursive_mutex> guard(
3245 if (use_global_module_list) {
3255 &target, arg.c_str(), module_list, use_global_module_list);
3256 if (num_matches == 0) {
3265 module_list_ptr = &module_list;
3268 std::unique_lock<std::recursive_mutex> lock;
3269 if (module_list_ptr !=
nullptr) {
3271 std::unique_lock<std::recursive_mutex>(module_list_ptr->
GetMutex());
3273 num_modules = module_list_ptr->
GetSize();
3276 if (num_modules > 0) {
3277 for (uint32_t image_idx = 0; image_idx < num_modules; ++image_idx) {
3280 if (module_list_ptr) {
3282 module = module_sp.get();
3284 module = Module::GetAllocatedModuleAtIndex(image_idx);
3285 module_sp =
module->shared_from_this();
3288 const size_t indent = strm.
Printf(
"[%3u] ", image_idx);
3294 if (use_global_module_list)
3296 "the global module list has no matching modules");
3298 result.
AppendError(
"the target has no matching modules");
3300 if (use_global_module_list)
3301 result.
AppendError(
"the global module list is empty");
3304 "the target has no associated executable images");
3311 if (module ==
nullptr) {
3316 bool dump_object_name =
false;
3318 m_options.m_format_array.push_back(std::make_pair(
'u', 0));
3319 m_options.m_format_array.push_back(std::make_pair(
'h', 0));
3320 m_options.m_format_array.push_back(std::make_pair(
'f', 0));
3321 m_options.m_format_array.push_back(std::make_pair(
'S', 0));
3323 const size_t num_entries =
m_options.m_format_array.size();
3324 bool print_space =
false;
3325 for (
size_t i = 0; i < num_entries; ++i) {
3329 const char format_char =
m_options.m_format_array[i].first;
3330 uint32_t width =
m_options.m_format_array[i].second;
3331 switch (format_char) {
3342 dump_object_name =
true;
3351 dump_object_name =
true;
3358 uint32_t addr_nibble_width =
3361 ObjectFile *objfile =
module->GetObjectFile();
3368 base_addr.
Dump(&strm, &target,
3372 if (format_char ==
'o') {
3374 strm.
Printf(
"0x%*.*" PRIx64, addr_nibble_width,
3379 strm.
Printf(
"0x%*.*" PRIx64, addr_nibble_width,
3380 addr_nibble_width, load_addr);
3391 strm.
Printf(
"%*s", addr_nibble_width + 2,
"");
3396 size_t ref_count = 0;
3397 char in_shared_cache =
'Y';
3399 ModuleSP module_sp(module->shared_from_this());
3401 in_shared_cache =
'N';
3404 ref_count = module_sp.use_count() - 1;
3407 strm.
Printf(
"{%c %*" PRIu64
"}", in_shared_cache, width, (uint64_t)ref_count);
3409 strm.
Printf(
"{%c %" PRIu64
"}", in_shared_cache, (uint64_t)ref_count);
3416 symbol_file->GetObjectFile()->GetFileSpec();
3417 if (format_char ==
'S') {
3419 if (!symfile_spec || symfile_spec == module->
GetFileSpec()) {
3420 print_space =
false;
3424 strm.
Printf(
"\n%*s", indent,
"");
3427 dump_object_name =
true;
3430 strm.
Printf(
"%.*s", width,
"<NONE>");
3435 llvm::AlignStyle::Left, width));
3439 strm.
Printf(
"%p",
static_cast<void *
>(module));
3450 if (dump_object_name) {
3451 const char *object_name =
module->GetObjectName().GetCString();
3453 strm.
Printf(
"(%s)", object_name);
3461#pragma mark CommandObjectTargetModulesShowUnwind
3464#define LLDB_OPTIONS_target_modules_show_unwind
3465#include "CommandOptions.inc"
3490 switch (short_option) {
3492 m_str = std::string(option_arg);
3498 "invalid address string '%s'", option_arg.str().c_str());
3503 m_str = std::string(option_arg);
3508 bool value, success;
3514 "invalid boolean value '%s' passed for -c option", option_arg);
3519 llvm_unreachable(
"Unimplemented option");
3533 return llvm::ArrayRef(g_target_modules_show_unwind_options);
3547 interpreter,
"target modules show-unwind",
3548 "Show synthesized unwind instructions for a function.", nullptr,
3549 eCommandRequiresTarget | eCommandRequiresProcess |
3550 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
3562 abi = process->
GetABI().get();
3564 if (process ==
nullptr) {
3566 "You must have a process running to use this command.");
3572 result.
AppendError(
"the process must be paused to use this command");
3578 result.
AppendError(
"the process must be paused to use this command");
3590 function_options, sc_list);
3596 module_sp->ResolveSymbolContextForAddress(addr,
3597 eSymbolContextEverything, sc);
3604 "address-expression or function name option must be specified.");
3615 if (sc.symbol ==
nullptr && sc.function ==
nullptr)
3617 if (!sc.module_sp || sc.module_sp->GetObjectFile() ==
nullptr)
3619 Address addr = sc.GetFunctionOrSymbolAddress();
3629 UnwindTable &uw_table = sc.module_sp->GetUnwindTable();
3635 if (!func_unwinders_sp)
3639 "UNWIND PLANS for %s`%s (start addr 0x%" PRIx64
")\n",
3640 sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(),
3646 for (
size_t i = 0; i < count; i++) {
3648 if (strcmp(funcname.
GetCString(), trap_func_name) == 0)
3651 "treated as a trap handler function via user setting.\n");
3655 const std::vector<ConstString> trap_handler_names(
3656 platform_sp->GetTrapHandlerSymbolNames());
3657 for (
ConstString trap_name : trap_handler_names) {
3658 if (trap_name == funcname) {
3661 "name is listed by the platform as a trap handler.\n");
3668 if (std::shared_ptr<const UnwindPlan> plan_sp =
3669 func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread)) {
3671 "Asynchronous (not restricted to call-sites) UnwindPlan is '%s'\n",
3672 plan_sp->GetSourceName().AsCString());
3674 if (std::shared_ptr<const UnwindPlan> plan_sp =
3675 func_unwinders_sp->GetUnwindPlanAtCallSite(*target, *thread)) {
3677 "Synchronous (restricted to call-sites) UnwindPlan is '%s'\n",
3678 plan_sp->GetSourceName().AsCString());
3680 if (std::shared_ptr<const UnwindPlan> plan_sp =
3681 func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread)) {
3683 plan_sp->GetSourceName().AsCString());
3688 if (std::shared_ptr<const UnwindPlan> plan_sp =
3689 func_unwinders_sp->GetAssemblyUnwindPlan(*target, *thread)) {
3691 "Assembly language inspection UnwindPlan:\n");
3697 if (std::shared_ptr<const UnwindPlan> plan_sp =
3698 func_unwinders_sp->GetObjectFileUnwindPlan(*target)) {
3705 if (std::shared_ptr<const UnwindPlan> plan_sp =
3706 func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target,
3714 if (std::shared_ptr<const UnwindPlan> plan_sp =
3715 func_unwinders_sp->GetEHFrameUnwindPlan(*target)) {
3722 if (std::shared_ptr<const UnwindPlan> plan_sp =
3723 func_unwinders_sp->GetEHFrameAugmentedUnwindPlan(*target,
3731 if (std::shared_ptr<const UnwindPlan> plan_sp =
3732 func_unwinders_sp->GetDebugFrameUnwindPlan(*target)) {
3739 if (std::shared_ptr<const UnwindPlan> plan_sp =
3740 func_unwinders_sp->GetDebugFrameAugmentedUnwindPlan(*target,
3748 if (std::shared_ptr<const UnwindPlan> plan_sp =
3749 func_unwinders_sp->GetArmUnwindUnwindPlan(*target)) {
3756 if (std::shared_ptr<const UnwindPlan> plan_sp =
3757 func_unwinders_sp->GetSymbolFileUnwindPlan(*thread)) {
3764 if (std::shared_ptr<const UnwindPlan> plan_sp =
3765 func_unwinders_sp->GetCompactUnwindUnwindPlan(*target)) {
3772 if (std::shared_ptr<const UnwindPlan> plan_sp =
3773 func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread)) {
3782 if (
UnwindPlanSP plan_sp = abi_sp->CreateDefaultUnwindPlan()) {
3789 if (
UnwindPlanSP plan_sp = abi_sp->CreateFunctionEntryUnwindPlan()) {
3791 "Arch default at entry point UnwindPlan:\n");
3806#define LLDB_OPTIONS_target_modules_lookup
3807#include "CommandOptions.inc"
3834 switch (short_option) {
3842 if (option_arg.getAsInteger(0,
m_offset))
3844 "invalid offset string '%s'", option_arg.str().c_str());
3848 m_str = std::string(option_arg);
3853 m_file.SetFile(option_arg, FileSpec::Style::native);
3864 "invalid line number string '%s'", option_arg.str().c_str());
3871 m_str = std::string(option_arg);
3876 m_str = std::string(option_arg);
3881 m_str = std::string(option_arg);
3901 llvm_unreachable(
"Unimplemented option");
3926 "conjunction with --verbose.");
3932 return llvm::ArrayRef(g_target_modules_lookup_options);
3953 "Look up information within executable and "
3954 "dependent shared library images.",
3955 nullptr, eCommandRequiresTarget) {
3964 bool &syntax_error) {
3982 const SymbolContext &sym_ctx(frame->GetSymbolContext(eSymbolContextModule));
4012 eSymbolContextEverything |
4014 ?
static_cast<int>(eSymbolContextVariable)
4059 m_options.m_use_regex, function_options,
4084 syntax_error =
true;
4095 bool syntax_error =
false;
4097 uint32_t num_successful_lookups = 0;
4109 num_successful_lookups++;
4119 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
4120 if (target_modules.
GetSize() == 0) {
4121 result.
AppendError(
"the target has no associated executable images");
4129 num_successful_lookups++;
4134 const char *arg_cstr;
4139 const size_t num_matches =
4141 if (num_matches > 0) {
4142 for (
size_t j = 0; j < num_matches; ++j) {
4147 num_successful_lookups++;
4153 "Unable to find an image that matches '%s'.\n", arg_cstr);
4157 if (num_successful_lookups > 0)
4166#pragma mark CommandObjectMultiwordImageSearchPaths
4175 interpreter,
"target modules search-paths",
4176 "Commands for managing module search paths for a target.",
4177 "target modules search-paths <subcommand> [<subcommand-options>]") {
4199#pragma mark CommandObjectTargetModules
4208 "Commands for accessing information for one or "
4209 "more target modules.",
4210 "target modules <sub-command> ...") {
4244 interpreter,
"target symbols add",
4245 "Add a debug symbol file to one of the target's current modules by "
4246 "specifying a path to a debug symbols file or by using the options "
4247 "to specify a module.",
4248 "target symbols add <cmd-options> [<symfile>]",
4249 eCommandRequiresTarget),
4253 "Locate the debug symbols for the shared library specified by "
4257 "Locate the debug symbols for the currently selected frame.", false,
4260 "Locate the debug symbols for every frame in "
4261 "the current call stack.",
4284 if (!symbol_fspec) {
4286 "one or more executable image paths must be specified");
4291 symbol_fspec.
GetPath(symfile_path,
sizeof(symfile_path));
4305 0, 0, symfile_module_specs)) {
4311 symfile_module_spec)) {
4315 symfile_uuid_module_spec.
GetUUID() = symfile_module_spec.
GetUUID();
4321 if (matching_modules.
IsEmpty()) {
4324 const size_t num_symfile_module_specs = symfile_module_specs.
GetSize();
4326 i < num_symfile_module_specs && matching_modules.
IsEmpty(); ++i) {
4328 i, symfile_module_spec)) {
4332 symfile_uuid_module_spec.
GetUUID() =
4333 symfile_module_spec.
GetUUID();
4344 if (matching_modules.
IsEmpty())
4347 while (matching_modules.
IsEmpty()) {
4351 if (!filename_no_extension)
4363 if (matching_modules.
GetSize() > 1) {
4365 "use the --uuid option to resolve the "
4371 if (matching_modules.
GetSize() == 1) {
4377 module_sp->SetSymbolFileFileSpec(symbol_fspec);
4383 if (object_file && object_file->
GetFileSpec() == symbol_fspec) {
4385 const FileSpec &module_fs = module_sp->GetFileSpec();
4387 "symbol file '%s' has been added to '%s'\n", symfile_path,
4393 module_list.
Append(module_sp);
4400 module_sp->LoadScriptingResourceInTarget(target,
error,
4404 "unable to load scripting data for module %s - error "
4406 module_sp->GetFileSpec()
4407 .GetFileNameStrippingExtension()
4410 else if (feedback_stream.
GetSize())
4419 module_sp->SetSymbolFileFileSpec(
FileSpec());
4424 ss_symfile_uuid <<
" (";
4426 ss_symfile_uuid <<
')';
4429 "symbol file '%s'%s does not match any existing module%s\n",
4430 symfile_path, ss_symfile_uuid.
GetData(),
4431 !llvm::sys::fs::is_regular_file(symbol_fspec.
GetPath())
4432 ?
"\n please specify the full path to the symbol file"
4459 error_strm.
PutCString(
"unable to find debug symbols for UUID ");
4478 module_spec.
GetFileSpec() = module_sp->GetFileSpec();
4480 module_spec.
GetUUID() = module_sp->GetUUID();
4489 "unable to find debug symbols for the executable file ");
4504 "a process must exist in order to use the --frame option");
4523 if (!frame_module_sp) {
4529 module_spec.
GetUUID() = frame_module_sp->GetUUID();
4531 module_spec.
GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4534 result.
AppendError(
"unable to find debug symbols for the current frame");
4547 "a process must exist in order to use the --stack option");
4564 bool symbols_found =
false;
4565 uint32_t frame_count = thread->GetStackFrameCount();
4566 for (uint32_t i = 0; i < frame_count; ++i) {
4570 frame_sp->GetSymbolContext(eSymbolContextModule).module_sp);
4571 if (!frame_module_sp)
4575 module_spec.
GetUUID() = frame_module_sp->GetUUID();
4576 module_spec.
GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4579 bool current_frame_flush =
false;
4581 symbols_found =
true;
4582 flush |= current_frame_flush;
4585 if (!symbols_found) {
4587 "unable to find debug symbols in the current call stack");
4599 const bool uuid_option_set =
4601 const bool file_option_set =
m_file_option.GetOptionValue().OptionWasSet();
4602 const bool frame_option_set =
4604 const bool stack_option_set =
4609 if (uuid_option_set)
4611 else if (file_option_set)
4613 else if (frame_option_set)
4615 else if (stack_option_set)
4618 result.
AppendError(
"one or more symbol file paths must be specified, "
4619 "or options must be specified");
4621 if (uuid_option_set) {
4622 result.
AppendError(
"specify either one or more paths to symbol files "
4623 "or use the --uuid option without arguments");
4624 }
else if (frame_option_set) {
4625 result.
AppendError(
"specify either one or more paths to symbol files "
4626 "or use the --frame option without arguments");
4627 }
else if (file_option_set && argc > 1) {
4628 result.
AppendError(
"specify at most one symbol file path when "
4629 "--shlib option is set");
4633 for (
auto &entry : args.
entries()) {
4634 if (!entry.ref().empty()) {
4636 symbol_file_spec.
SetFile(entry.ref(), FileSpec::Style::native);
4638 if (file_option_set) {
4645 ->ResolveSymbolFile(*target, module_spec, symfile_spec)
4650 bool symfile_exists =
4653 if (symfile_exists) {
4657 std::string resolved_symfile_path =
4659 if (resolved_symfile_path != entry.ref()) {
4661 "invalid module path '%s' with resolved path '%s'\n",
4662 entry.c_str(), resolved_symfile_path.c_str());
4688#pragma mark CommandObjectTargetSymbols
4697 interpreter,
"target symbols",
4698 "Commands for adding and managing debug symbol files.",
4699 "target symbols <sub-command> ...") {
4713#pragma mark CommandObjectTargetStopHookAdd
4716#define LLDB_OPTIONS_target_stop_hook_add
4717#include "CommandOptions.inc"
4729 return llvm::ArrayRef(g_target_stop_hook_add_options);
4735 const int short_option =
4736 g_target_stop_hook_add_options[option_idx].short_option;
4738 switch (short_option) {
4745 if (option_arg.getAsInteger(0,
m_line_end)) {
4747 "invalid end line number: \"%s\"", option_arg.str().c_str());
4754 bool value, success;
4760 "invalid boolean value '%s' passed for -G option",
4761 option_arg.str().c_str());
4766 "invalid start line number: \"%s\"", option_arg.str().c_str());
4795 "invalid thread id string '%s'", option_arg.str().c_str());
4812 "invalid thread index string '%s'", option_arg.str().c_str());
4822 bool value, success;
4828 "invalid boolean value '%s' passed for -F option",
4829 option_arg.str().c_str());
4833 llvm_unreachable(
"Unimplemented option");
4868 eFunctionNameTypeAuto;
4886 "Add a hook to be executed when the target stops."
4887 "The hook can either be a list of commands or an "
4888 "appropriately defined Python class. You can also "
4889 "add filters so the hook only runs a certain stop "
4891 "target stop-hook add"),
4897Command Based stop-hooks:
4898-------------------------
4899 Stop hooks can run a list of lldb commands by providing one or more
4900 --one-liner options. The commands will get run in the order they are added.
4901 Or you can provide no commands, in which case you will enter a command editor
4902 where you can enter the commands to be run.
4904Python Based Stop Hooks:
4905------------------------
4906 Stop hooks can be implemented with a suitably defined Python class, whose name
4907 is passed in the --python-class option.
4909 When the stop hook is added, the class is initialized by calling:
4911 def __init__(self, target, extra_args, internal_dict):
4913 target: The target that the stop hook is being added to.
4914 extra_args: An SBStructuredData Dictionary filled with the -key -value
4915 option pairs passed to the command.
4916 dict: An implementation detail provided by lldb.
4918 Then when the stop-hook triggers, lldb will run the 'handle_stop' method.
4919 The method has the signature:
4921 def handle_stop(self, exe_ctx, stream):
4923 exe_ctx: An SBExecutionContext for the thread that has stopped.
4924 stream: An SBStream, anything written to this stream will be printed in the
4925 the stop message when the process stops.
4927 Return Value: The method returns "should_stop". If should_stop is false
4928 from all the stop hook executions on threads that stopped
4929 with a reason, then the process will continue. Note that this
4930 will happen only after all the stop hooks are run.
4934 Stop hooks can be set to always run, or to only run when the stopped thread
4935 matches the filter options passed on the command line. The available filter
4936 options include a shared library or a thread or queue specification,
4937 a line range in a source file, a function name or a class name.
4957 "Enter your stop hook command(s). Type 'DONE' to end.\n");
4963 std::string &line)
override {
4969 locked_stream.
Printf(
"error: stop hook #%" PRIu64
4970 " aborted, no commands.\n",
4976 Target::StopHookCommandLine *hook_ptr =
4977 static_cast<Target::StopHookCommandLine *
>(
m_stop_hook_sp.get());
4982 LockedStreamFile locked_stream = output_sp->Lock();
4983 locked_stream.
Printf(
"Stop hook #%" PRIu64
" added.\n",
4992 void DoExecute(Args &command, CommandReturnObject &result)
override {
4998 Target::StopHook::StopHookKind::CommandBased
4999 : Target::StopHook::StopHookKind::ScriptBased);
5002 std::unique_ptr<SymbolContextSpecifier> specifier_up;
5004 specifier_up = std::make_unique<SymbolContextSpecifier>(
5008 specifier_up->AddSpecification(
5014 specifier_up->AddSpecification(
5020 specifier_up->AddSpecification(
m_options.m_file_name.c_str(),
5025 specifier_up->AddLineSpecification(
5031 specifier_up->AddLineSpecification(
5035 if (!
m_options.m_function_name.empty()) {
5036 specifier_up->AddSpecification(
5043 new_hook_sp->SetSpecifier(specifier_up.release());
5046 new_hook_sp->SetRunAtInitialStop(
m_options.m_at_initial_stop);
5051 ThreadSpec *thread_spec =
new ThreadSpec();
5066 new_hook_sp->SetThreadSpecifier(thread_spec);
5076 new_hook_sp->GetID());
5079 Target::StopHookScripted *hook_ptr =
5080 static_cast<Target::StopHookScripted *
>(new_hook_sp.get());
5084 if (
error.Success())
5086 new_hook_sp->GetID());
5110#pragma mark CommandObjectTargetStopHookDelete
5118 "Delete a stop-hook.",
5119 "target stop-hook delete [<idx>]") {
5138 if (num_args == 0) {
5139 if (!
m_interpreter.Confirm(
"Delete all stop hooks?",
true)) {
5146 for (
size_t i = 0; i < num_args; i++) {
5164#pragma mark CommandObjectTargetStopHookEnableDisable
5171 bool enable,
const char *name,
5172 const char *help,
const char *syntax)
5194 if (num_args == 0) {
5197 for (
size_t i = 0; i < num_args; i++) {
5219#pragma mark CommandObjectTargetStopHookList
5227 "List all stop-hooks.",
"target stop-hook list") {}
5236 if (num_hooks == 0) {
5239 for (
size_t i = 0; i < num_hooks; i++) {
5251#pragma mark CommandObjectMultiwordTargetStopHooks
5259 interpreter,
"target stop-hook",
5260 "Commands for operating on debugger target stop-hooks.",
5261 "target stop-hook <subcommand> [<subcommand-options>]") {
5269 interpreter,
false,
"target stop-hook disable [<id>]",
5270 "Disable a stop-hook.",
"target stop-hook disable")));
5273 interpreter,
true,
"target stop-hook enable [<id>]",
5274 "Enable a stop-hook.",
"target stop-hook enable")));
5282#pragma mark CommandObjectTargetDumpTypesystem
5289 interpreter,
"target dump typesystem",
5290 "Dump the state of the target's internal type system. Intended to "
5291 "be used for debugging LLDB itself.",
5292 nullptr, eCommandRequiresTarget) {}
5308#pragma mark CommandObjectTargetDumpSectionLoadList
5315 interpreter,
"target dump section-load-list",
5316 "Dump the state of the target's internal section load list. "
5317 "Intended to be used for debugging LLDB itself.",
5318 nullptr, eCommandRequiresTarget) {}
5330#pragma mark CommandObjectTargetDump
5338 interpreter,
"target dump",
5339 "Commands for dumping information about the target.",
5340 "target dump [typesystem|section-load-list]") {
5352#pragma mark CommandObjectMultiwordTarget
5359 "Commands for operating on debugger targets.",
5360 "target <subcommand> [<subcommand-options>]") {
static bool GetSeparateDebugInfoList(StructuredData::Array &list, Module *module, bool errors_only, bool load_all_debug_info)
static uint32_t DumpTargetList(TargetList &target_list, bool show_stopped_process_status, Stream &strm)
static void DumpModuleUUID(Stream &strm, Module *module)
static void DumpModuleSections(CommandInterpreter &interpreter, Stream &strm, Module *module)
static void DumpModuleArchitecture(Stream &strm, Module *module, bool full_triple, uint32_t width)
static bool LookupAddressInModule(CommandInterpreter &interpreter, Stream &strm, Module *module, uint32_t resolve_mask, lldb::addr_t raw_addr, lldb::addr_t offset, bool verbose, bool all_ranges)
static void DumpTargetInfo(uint32_t target_idx, Target *target, const char *prefix_cstr, bool show_stopped_process_status, Stream &strm)
static void DumpDirectory(Stream &strm, const FileSpec *file_spec_ptr, uint32_t width)
static uint32_t LookupSymbolInModule(CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, bool verbose, bool all_ranges)
static size_t LookupTypeInModule(Target *target, CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name_cstr, bool name_is_regex)
static bool DumpModuleSymbolFile(Stream &strm, Module *module)
static void DumpFullpath(Stream &strm, const FileSpec *file_spec_ptr, uint32_t width)
static void DumpDwoFilesTable(Stream &strm, StructuredData::Array &dwo_listings)
static size_t LookupFunctionInModule(CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, const ModuleFunctionSearchOptions &options, bool verbose, bool all_ranges)
static size_t LookupTypeHere(Target *target, CommandInterpreter &interpreter, Stream &strm, Module &module, const char *name_cstr, bool name_is_regex)
static uint32_t DumpCompileUnitLineTable(CommandInterpreter &interpreter, Stream &strm, Module *module, const FileSpec &file_spec, lldb::DescriptionLevel desc_level)
static void DumpBasename(Stream &strm, const FileSpec *file_spec_ptr, uint32_t width)
static size_t DumpModuleObjfileHeaders(Stream &strm, ModuleList &module_list)
static uint32_t LookupFileAndLineInModule(CommandInterpreter &interpreter, Stream &strm, Module *module, const FileSpec &file_spec, uint32_t line, bool check_inlines, bool verbose, bool all_ranges)
static void DumpSymbolContextList(ExecutionContextScope *exe_scope, Stream &strm, const SymbolContextList &sc_list, bool verbose, bool all_ranges, std::optional< Stream::HighlightSettings > settings=std::nullopt)
static void DumpOsoFilesTable(Stream &strm, StructuredData::Array &oso_listings)
static size_t FindModulesByName(Target *target, const char *module_name, ModuleList &module_list, bool check_global_list)
static void DumpModuleSymtab(CommandInterpreter &interpreter, Stream &strm, Module *module, SortOrder sort_order, Mangled::NamePreference name_preference)
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.
#define LLDB_LOGF(log,...)
#define LLDB_SCOPED_TIMERF(...)
~CommandObjectMultiwordTargetStopHooks() override=default
CommandObjectMultiwordTargetStopHooks(CommandInterpreter &interpreter)
OptionGroupString m_label
OptionGroupPlatform m_platform_options
~CommandObjectTargetCreate() override=default
Options * GetOptions() override
OptionGroupFile m_symbol_file
OptionGroupFile m_remote_file
OptionGroupOptions m_option_group
OptionGroupArchitecture m_arch_option
CommandObjectTargetCreate(CommandInterpreter &interpreter)
OptionGroupDependents m_add_dependents
OptionGroupFile m_core_file
void DoExecute(Args &command, CommandReturnObject &result) override
OptionGroupBoolean m_cleanup_option
OptionGroupOptions m_option_group
void DoExecute(Args &args, CommandReturnObject &result) override
CommandObjectTargetDelete(CommandInterpreter &interpreter)
OptionGroupBoolean m_all_option
~CommandObjectTargetDelete() override=default
Options * GetOptions() override
Dumps the SectionLoadList of the selected Target.
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetDumpSectionLoadList() override=default
CommandObjectTargetDumpSectionLoadList(CommandInterpreter &interpreter)
Dumps the TypeSystem of the selected Target.
CommandObjectTargetDumpTypesystem(CommandInterpreter &interpreter)
~CommandObjectTargetDumpTypesystem() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
Multi-word command for 'target dump'.
CommandObjectTargetDump(CommandInterpreter &interpreter)
~CommandObjectTargetDump() override=default
CommandObjectTargetList(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
~CommandObjectTargetList() override=default
OptionGroupOptions m_option_group
OptionGroupFile m_symbol_file
CommandObjectTargetModulesAdd(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
OptionGroupUUID m_uuid_option_group
~CommandObjectTargetModulesAdd() override=default
Options * GetOptions() override
CommandObjectTargetModulesDumpClangAST(CommandInterpreter &interpreter)
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
OptionGroupString m_filter
~CommandObjectTargetModulesDumpClangAST() override=default
OptionGroupOptions m_option_group
~CommandObjectTargetModulesDumpClangPCMInfo() override=default
CommandObjectTargetModulesDumpClangPCMInfo(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
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
~CommandObjectTargetModulesDumpLineTable() override=default
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectTargetModulesDumpLineTable(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetModulesDumpObjfile() override=default
CommandObjectTargetModulesDumpObjfile(CommandInterpreter &interpreter)
CommandObjectTargetModulesDumpSections(CommandInterpreter &interpreter)
~CommandObjectTargetModulesDumpSections() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
OptionValueBoolean m_errors_only
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
OptionValueBoolean m_json
OptionValueBoolean m_load_all_debug_info
~CommandObjectTargetModulesDumpSeparateDebugInfoFiles() override=default
CommandObjectTargetModulesDumpSeparateDebugInfoFiles(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
CommandObjectTargetModulesDumpSymfile(CommandInterpreter &interpreter)
~CommandObjectTargetModulesDumpSymfile() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandOptions() override=default
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
OptionValueBoolean m_prefer_mangled
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectTargetModulesDumpSymtab(CommandInterpreter &interpreter)
~CommandObjectTargetModulesDumpSymtab() override=default
~CommandObjectTargetModulesDump() override=default
CommandObjectTargetModulesDump(CommandInterpreter &interpreter)
CommandObjectTargetModulesImageSearchPaths(CommandInterpreter &interpreter)
~CommandObjectTargetModulesImageSearchPaths() override=default
bool m_use_global_module_list
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
FormatWidthCollection m_format_array
std::vector< std::pair< char, uint32_t > > FormatWidthCollection
~CommandOptions() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
lldb::addr_t m_module_addr
CommandObjectTargetModulesList(CommandInterpreter &interpreter)
~CommandObjectTargetModulesList() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void PrintModule(Target &target, Module *module, int indent, Stream &strm)
Options * GetOptions() override
OptionGroupBoolean m_pc_option
OptionGroupUInt64 m_slide_option
OptionGroupBoolean m_load_option
void DoExecute(Args &args, CommandReturnObject &result) override
Options * GetOptions() override
OptionGroupUUID m_uuid_option_group
~CommandObjectTargetModulesLoad() override=default
OptionGroupOptions m_option_group
CommandObjectTargetModulesLoad(CommandInterpreter &interpreter)
OptionGroupString m_file_option
~CommandOptions() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
Status OptionParsingFinished(ExecutionContext *execution_context) 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
bool LookupInModule(CommandInterpreter &interpreter, Module *module, CommandReturnObject &result, bool &syntax_error)
Options * GetOptions() override
~CommandObjectTargetModulesLookup() override=default
@ eLookupTypeFunctionOrSymbol
void DoExecute(Args &command, CommandReturnObject &result) override
bool LookupHere(CommandInterpreter &interpreter, CommandReturnObject &result, bool &syntax_error)
CommandObjectTargetModulesLookup(CommandInterpreter &interpreter)
CommandObjectTargetModulesModuleAutoComplete(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, uint32_t flags=0)
~CommandObjectTargetModulesModuleAutoComplete() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandObjectTargetModulesSearchPathsAdd() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectTargetModulesSearchPathsAdd(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetModulesSearchPathsClear() override=default
CommandObjectTargetModulesSearchPathsClear(CommandInterpreter &interpreter)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandObjectTargetModulesSearchPathsInsert() override=default
CommandObjectTargetModulesSearchPathsInsert(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetModulesSearchPathsList() override=default
CommandObjectTargetModulesSearchPathsList(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetModulesSearchPathsQuery() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectTargetModulesSearchPathsQuery(CommandInterpreter &interpreter)
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
@ eLookupTypeFunctionOrSymbol
CommandObjectTargetModulesShowUnwind(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
~CommandObjectTargetModulesShowUnwind() override=default
CommandObjectTargetModulesSourceFileAutoComplete(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, uint32_t flags)
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
~CommandObjectTargetModulesSourceFileAutoComplete() override=default
~CommandObjectTargetModules() override=default
const CommandObjectTargetModules & operator=(const CommandObjectTargetModules &)=delete
CommandObjectTargetModules(const CommandObjectTargetModules &)=delete
CommandObjectTargetModules(CommandInterpreter &interpreter)
~CommandObjectTargetSelect() override=default
void DoExecute(Args &args, CommandReturnObject &result) override
CommandObjectTargetSelect(CommandInterpreter &interpreter)
CommandObjectTargetShowLaunchEnvironment(CommandInterpreter &interpreter)
void DoExecute(Args &args, CommandReturnObject &result) override
~CommandObjectTargetShowLaunchEnvironment() override=default
uint32_t m_func_name_type_mask
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
std::string m_function_name
std::vector< std::string > m_one_liner
~CommandOptions() override=default
std::string m_thread_name
void OptionParsingStarting(ExecutionContext *execution_context) override
std::string m_module_name
OptionGroupOptions m_all_options
Target::StopHookSP m_stop_hook_sp
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override
CommandObjectTargetStopHookAdd(CommandInterpreter &interpreter)
void IOHandlerInputComplete(IOHandler &io_handler, std::string &line) override
Called when a line or lines have been retrieved.
~CommandObjectTargetStopHookAdd() override=default
Options * GetOptions() override
OptionGroupPythonClassWithDict m_python_class_options
void DoExecute(Args &command, CommandReturnObject &result) 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,...
CommandObjectTargetStopHookDelete(CommandInterpreter &interpreter)
~CommandObjectTargetStopHookDelete() override=default
~CommandObjectTargetStopHookEnableDisable() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectTargetStopHookEnableDisable(CommandInterpreter &interpreter, bool enable, const char *name, const char *help, const char *syntax)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetStopHookList() override=default
CommandObjectTargetStopHookList(CommandInterpreter &interpreter)
bool AddSymbolsForUUID(CommandReturnObject &result, bool &flush)
bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, CommandReturnObject &result, bool &flush)
bool AddSymbolsForStack(CommandReturnObject &result, bool &flush)
OptionGroupBoolean m_current_stack_option
OptionGroupBoolean m_current_frame_option
CommandObjectTargetSymbolsAdd(CommandInterpreter &interpreter)
bool AddSymbolsForFrame(CommandReturnObject &result, bool &flush)
OptionGroupOptions m_option_group
~CommandObjectTargetSymbolsAdd() override=default
Options * GetOptions() override
void DoExecute(Args &args, CommandReturnObject &result) override
OptionGroupFile m_file_option
OptionGroupUUID m_uuid_option_group
bool AddModuleSymbols(Target *target, ModuleSpec &module_spec, bool &flush, CommandReturnObject &result)
bool AddSymbolsForFile(CommandReturnObject &result, bool &flush)
const CommandObjectTargetSymbols & operator=(const CommandObjectTargetSymbols &)=delete
CommandObjectTargetSymbols(CommandInterpreter &interpreter)
~CommandObjectTargetSymbols() override=default
CommandObjectTargetSymbols(const CommandObjectTargetSymbols &)=delete
OptionGroupFormat m_option_format
void DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, const VariableList &variable_list, CommandReturnObject &result)
void DumpValueObject(Stream &s, VariableSP &var_sp, ValueObjectSP &valobj_sp, const char *root_name)
static size_t GetVariableCallback(void *baton, const char *name, VariableList &variable_list)
static const uint32_t SHORT_OPTION_SHLB
CommandObjectTargetVariable(CommandInterpreter &interpreter)
OptionGroupFileList m_option_shared_libraries
void DoExecute(Args &args, CommandReturnObject &result) override
Options * GetOptions() override
OptionGroupFileList m_option_compile_units
static const uint32_t SHORT_OPTION_FILE
OptionGroupVariable m_option_variable
OptionGroupValueObjectDisplay m_varobj_options
OptionGroupOptions m_option_group
~CommandObjectTargetVariable() override=default
~OptionGroupDependents() override=default
OptionGroupDependents()=default
LoadDependentFiles m_load_dependent_files
OptionGroupDependents(const OptionGroupDependents &)=delete
const OptionGroupDependents & operator=(const OptionGroupDependents &)=delete
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t, const char *, ExecutionContext *)=delete
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
virtual lldb::addr_t FixCodeAddress(lldb::addr_t pc)
Some targets might use bits in a code address to indicate a mode switch.
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
@ DumpStyleFileAddress
Display as the file address (if any).
@ DumpStyleSectionNameOffset
Display as the section name + offset.
@ DumpStyleDetailedSymbolContext
Detailed symbol context information for an address for all symbol context members.
@ DumpStyleInvalid
Invalid dump style.
@ DumpStyleModuleWithFileAddress
Display as the file address with the module name prepended (if any).
@ DumpStyleResolvedDescription
Display the details about what an address resolves to.
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX, bool all_ranges=false, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
Dump a description of this object to a Stream.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetFileAddress() const
Get the file address.
bool IsValid() const
Check if the object state is valid.
An architecture specification class.
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
bool IsValid() const
Tests if this ArchSpec is valid.
void DumpTriple(llvm::raw_ostream &s) const
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
A command line argument class.
void Shift()
Shifts the first argument C string value of the array off the argument array.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
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.
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
ExecutionContext GetExecutionContext() const
CommandObjectMultiwordTarget(CommandInterpreter &interpreter)
~CommandObjectMultiwordTarget() 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)
std::vector< CommandArgumentData > CommandArgumentEntry
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
ExecutionContext m_exe_ctx
std::vector< CommandArgumentEntry > m_arguments
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
virtual void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector)
The default version handles argument definitions that have only one argument type,...
void void AppendError(llvm::StringRef in_string)
const ValueObjectList & GetValueObjectList() const
void AppendWarningWithFormat(const char *format,...) __attribute__((format(printf
Stream & GetErrorStream()
void SetStatus(lldb::ReturnStatus status)
void SetError(Status error)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
void void AppendWarning(llvm::StringRef in_string)
void AppendErrorWithFormatv(const char *format, Args &&...args)
Stream & GetOutputStream()
A class that describes a compilation unit.
lldb::VariableListSP GetVariableList(bool can_create)
Get the variable list for a compile unit.
const FileSpec & GetPrimaryFile() const
Return the primary source spec associated with this compile unit.
"lldb/Utility/ArgCompletionRequest.h"
void TryCompleteCurrentArg(llvm::StringRef completion, llvm::StringRef description="")
Adds a possible completion string if the completion would complete the current argument.
size_t GetCursorIndex() const
A uniqued constant string class.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
void Dump(Stream *s, const char *value_if_empty=nullptr) const
Dump the object description to a stream.
bool IsEmpty() const
Test for empty string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
const char * GetCString() const
Get the string value as a C string.
A class to manage flag bits.
TargetList & GetTargetList()
Get accessor for the target list.
llvm::StringRef GetRegexMatchAnsiSuffix() const
llvm::StringRef GetRegexMatchAnsiPrefix() const
DumpValueObjectOptions & SetRootValueObjectName(const char *name=nullptr)
DumpValueObjectOptions & SetFormat(lldb::Format format=lldb::eFormatDefault)
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
ExecutionContextScope * GetBestExecutionContextScope() const
Target * GetTargetPtr() const
Returns a pointer to the target object.
const FileSpec & GetFileSpecAtIndex(size_t idx) const
Get file at index.
size_t GetSize() const
Get the number of files in the file list.
void SetFile(llvm::StringRef path, Style style)
Change the file specified with a new path.
void SetDirectory(ConstString directory)
Directory string set accessor.
const ConstString & GetFilename() const
Filename string const get accessor.
const ConstString & GetDirectory() const
Directory string const get accessor.
ConstString GetFileNameStrippingExtension() const
Return the filename without the extension part.
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
void Dump(llvm::raw_ostream &s) const
Dump this object to a Stream.
llvm::StringRef GetFileNameExtension() const
Extract the extension of the file.
void SetFilename(ConstString filename)
Filename string set accessor.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
bool ResolveExecutableLocation(FileSpec &file_spec)
Call into the Host to see if it can help find the file.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
int Open(const char *path, int flags, int mode=0600)
Wraps open in a platform-independent way.
static FileSystem & Instance()
IOHandlerDelegateMultiline(llvm::StringRef end_line, Completion completion=Completion::None)
A delegate class for use with IOHandler subclasses.
lldb::LockableStreamFileSP GetErrorStreamFileSP()
lldb::LockableStreamFileSP GetOutputStreamFileSP()
void GetDescription(Stream *s, Target *target, lldb::DescriptionLevel level)
A collection class for Module objects.
void FindFunctions(ConstString name, lldb::FunctionNameType name_type_mask, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list) const
ModuleIterableNoLocking ModulesNoLocking() const
static bool ModuleIsInCache(const Module *module_ptr)
void FindGlobalVariables(ConstString name, size_t max_matches, VariableList &variable_list) const
Find global and static variables by name.
std::recursive_mutex & GetMutex() const
lldb::ModuleSP FindFirstModule(const ModuleSpec &module_spec) const
Finds the first module whose file specification matches module_spec.
lldb::ModuleSP GetModuleAtIndexUnlocked(size_t idx) const
Get the module shared pointer for the module at index idx without acquiring the ModuleList mutex.
void FindCompileUnits(const FileSpec &path, SymbolContextList &sc_list) const
Find compile units by partial or full path.
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
Module * GetModulePointerAtIndex(size_t idx) const
Get the module pointer for the module at index idx.
void FindModules(const ModuleSpec &module_spec, ModuleList &matching_module_list) const
Finds modules whose file specification matches module_spec.
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
static size_t RemoveOrphanSharedModules(bool mandatory)
static void FindSharedModules(const ModuleSpec &module_spec, ModuleList &matching_module_list)
ModuleIterable Modules() const
size_t GetSize() const
Gets the size of the module list.
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const
bool FindMatchingModuleSpec(const ModuleSpec &module_spec, ModuleSpec &match_module_spec) const
FileSpec & GetPlatformFileSpec()
ArchSpec & GetArchitecture()
FileSpec * GetFileSpecPtr()
FileSpec & GetSymbolFileSpec()
A class that describes an executable image and its associated object and symbol files.
const lldb_private::UUID & GetUUID()
Get a reference to the UUID value contained in this object.
virtual SymbolFile * GetSymbolFile(bool can_create=true, Stream *feedback_strm=nullptr)
Get the module's symbol file.
static Module * GetAllocatedModuleAtIndex(size_t idx)
static std::recursive_mutex & GetAllocationModuleCollectionMutex()
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
Symtab * GetSymtab(bool can_create=true)
Get the module's symbol table.
bool MatchesModuleSpec(const ModuleSpec &module_ref)
static size_t GetNumberAllocatedModules()
const ArchSpec & GetArchitecture() const
Get const accessor for the module architecture.
std::string GetSpecificationDescription() const
Get the module path and object name.
const FileSpec & GetFileSpec() const
Get const accessor for the module file specification.
const llvm::sys::TimePoint & GetModificationTime() const
A plug-in interface definition class for object file parsers.
virtual void Dump(Stream *s)=0
Dump a description of this object to a Stream.
virtual std::vector< LoadableData > GetLoadableData(Target &target)
Loads this objfile to memory.
virtual lldb_private::Address GetEntryPointAddress()
Returns the address of the Entry Point in this object file - if the object file doesn't have an entry...
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
virtual lldb_private::Address GetBaseAddress()
Returns base address of this object file.
static size_t GetModuleSpecifications(const FileSpec &file, lldb::offset_t file_offset, lldb::offset_t file_size, ModuleSpecList &specs, lldb::DataBufferSP data_sp=lldb::DataBufferSP())
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
void Insert(llvm::StringRef path, llvm::StringRef replacement, uint32_t insert_idx, bool notify)
void Append(llvm::StringRef path, llvm::StringRef replacement, bool notify)
bool RemapPath(ConstString path, ConstString &new_path) const
bool GetPathsAtIndex(uint32_t idx, ConstString &path, ConstString &new_path) const
void Dump(Stream *s, int pair_index=-1)
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec, Status &error, bool force_lookup=true, bool copy_executable=true)
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
A plug-in interface definition class for debugging a process.
ThreadList & GetThreadList()
void Flush()
Flush all data in the process.
lldb::StateType GetState()
Get accessor for the current process state.
const lldb::ABISP & GetABI()
bool IsValid() const
Test if this object contains a valid regular expression.
lldb::SectionSP FindSectionByName(ConstString section_dstr) const
void Dump(llvm::raw_ostream &s, unsigned indent, Target *target, bool show_header, uint32_t depth) const
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
uint32_t GetFrameIndex() const
Query this frame to find what frame it is in this Thread's StackFrameList.
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
const char * GetData() const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Indent(llvm::StringRef s="")
Indent the current line in the stream.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
void SetAddressByteSize(uint32_t addr_size)
Set the address size in bytes.
void SetIndentLevel(unsigned level)
Set the current indentation level.
void PutCStringColorHighlighted(llvm::StringRef text, std::optional< HighlightSettings > settings=std::nullopt)
Output a C string to the stream with color highlighting.
size_t EOL()
Output and End of Line character to the stream.
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
void IndentMore(unsigned amount=2)
Increment the current indentation level.
unsigned GetIndentLevel() const
Get the current indentation level.
void AddItem(const ObjectSP &item)
bool ForEach(std::function< bool(Object *object)> const &foreach_callback) const
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
Dictionary * GetAsDictionary()
void Dump(lldb_private::Stream &s, bool pretty_print=true) const
Defines a list of symbol context objects.
uint32_t GetSize() const
Get accessor for a symbol context list size.
void Append(const SymbolContext &sc)
Append a new symbol context to the list.
@ eClassOrNamespaceSpecified
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
void SortTypeList(TypeMap &type_map, TypeList &type_list) const
Sorts the types in TypeMap according to SymbolContext to TypeList.
lldb::ModuleSP module_sp
The Module for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
Symbol * symbol
The Symbol for a given query.
Provides public interface for all SymbolFiles.
virtual ObjectFile * GetObjectFile()=0
bool ValueIsAddress() const
bool GetByteSizeIsValid() const
Address & GetAddressRef()
lldb::addr_t GetByteSize() const
ConstString GetDisplayName() const
uint64_t GetRawValue() const
Get the raw value of the symbol from the symbol table.
Symbol * SymbolAtIndex(size_t idx)
uint32_t AppendSymbolIndexesWithName(ConstString symbol_name, std::vector< uint32_t > &matches)
uint32_t AppendSymbolIndexesMatchingRegExAndType(const RegularExpression ®ex, lldb::SymbolType symbol_type, std::vector< uint32_t > &indexes, Mangled::NamePreference name_preference=Mangled::ePreferDemangled)
lldb::TargetSP GetTargetAtIndex(uint32_t index) const
void SetSelectedTarget(uint32_t index)
bool DeleteTarget(lldb::TargetSP &target_sp)
Delete a Target object from the list.
Status CreateTarget(Debugger &debugger, llvm::StringRef user_exe_path, llvm::StringRef triple_str, LoadDependentFiles get_dependent_modules, const OptionGroupPlatform *platform_options, lldb::TargetSP &target_sp)
Create a new Target.
lldb::TargetSP GetSelectedTarget()
size_t GetNumTargets() const
bool GetUserSpecifiedTrapHandlerNames(Args &args) const
Environment GetEnvironment() const
void SetActionFromString(const std::string &strings)
void SetActionFromStrings(const std::vector< std::string > &strings)
Status SetScriptCallback(std::string class_name, StructuredData::ObjectSP extra_args_sp)
void ModulesDidLoad(ModuleList &module_list)
Module * GetExecutableModulePointer()
StopHookSP CreateStopHook(StopHook::StopHookKind kind)
Add an empty stop hook to the Target's stop hook list, and returns a shared pointer to it in new_hook...
PathMappingList & GetImageSearchPathList()
std::shared_ptr< StopHook > StopHookSP
void SymbolsDidLoad(ModuleList &module_list)
size_t GetNumStopHooks() const
void DumpSectionLoadList(Stream &s)
const lldb::ProcessSP & GetProcessSP() const
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
void UndoCreateStopHook(lldb::user_id_t uid)
If you tried to create a stop hook, and that failed, call this to remove the stop hook,...
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, uint32_t stop_id=SectionLoadHistory::eStopIDNow, bool allow_section_end=false)
bool SetStopHookActiveStateByID(lldb::user_id_t uid, bool active_state)
void SetAllStopHooksActiveState(bool active_state)
void RemoveAllStopHooks()
StopHookSP GetStopHookAtIndex(size_t index)
lldb::PlatformSP GetPlatform()
const ModuleList & GetImages() const
Get accessor for the images for this process.
const ArchSpec & GetArchitecture() const
const std::string & GetLabel() const
lldb::ProcessSP CalculateProcess() override
bool SetSectionLoadAddress(const lldb::SectionSP §ion, lldb::addr_t load_addr, bool warn_multiple=false)
bool RemoveStopHookByID(lldb::user_id_t uid)
lldb::ThreadSP GetSelectedThread()
uint32_t GetSize(bool can_update=true)
lldb::ThreadSP GetThreadAtIndex(uint32_t idx, bool can_update=true)
void SetIndex(uint32_t index)
void SetName(llvm::StringRef name)
void SetTID(lldb::tid_t tid)
void SetQueueName(llvm::StringRef queue_name)
lldb::TypeSP GetTypeAtIndex(uint32_t idx)
A class that contains all state required for type lookups.
This class tracks the state and results of a TypeQuery.
void Dump(Stream &s) const
std::string GetAsString(llvm::StringRef separator="-") const
lldb::FuncUnwindersSP GetFuncUnwindersContainingAddress(const Address &addr, const SymbolContext &sc)
lldb::FuncUnwindersSP GetUncachedFuncUnwindersContainingAddress(const Address &addr, const SymbolContext &sc)
A collection of ValueObject values that.
void Append(const lldb::ValueObjectSP &val_obj_sp)
lldb::ValueObjectSP GetValueObjectAtIndex(size_t idx)
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
lldb::VariableSP GetVariableAtIndex(size_t idx) const
static Status GetValuesForVariableExpressionPath(llvm::StringRef variable_expr_path, ExecutionContextScope *scope, GetVariableCallback callback, void *baton, VariableList &variable_list, ValueObjectList &valobj_list)
#define LLDB_OPT_SET_FROM_TO(A, B)
#define LLDB_INVALID_LINE_NUMBER
#define LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_INDEX32
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_PROCESS_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::vector< OptionArgElement > OptionElementVector
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
void DumpAddress(llvm::raw_ostream &s, uint64_t addr, uint32_t addr_size, const char *prefix=nullptr, const char *suffix=nullptr)
Output an address value to this stream.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
const char * toString(AppleArm64ExceptionClass EC)
std::shared_ptr< lldb_private::TypeSystem > TypeSystemSP
std::shared_ptr< lldb_private::ABI > ABISP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Format
Display format definitions.
std::shared_ptr< lldb_private::Platform > PlatformSP
StateType
Process and Thread States.
std::shared_ptr< lldb_private::FuncUnwinders > FuncUnwindersSP
std::shared_ptr< lldb_private::Type > TypeSP
std::shared_ptr< lldb_private::Process > ProcessSP
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
std::shared_ptr< lldb_private::VariableList > VariableListSP
std::shared_ptr< lldb_private::UnwindPlan > UnwindPlanSP
std::shared_ptr< lldb_private::Variable > VariableSP
std::shared_ptr< lldb_private::LockableStreamFile > LockableStreamFileSP
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
std::shared_ptr< lldb_private::Module > ModuleSP
@ eValueTypeVariableGlobal
globals variable
@ eValueTypeVariableLocal
function local variables
@ eValueTypeVariableArgument
function argument variables
@ eValueTypeVariableStatic
static variable
@ eValueTypeVariableThreadLocal
thread local storage variable
Used to build individual command argument lists.
ArgumentRepetitionType arg_repetition
lldb::CommandArgumentType arg_type
Options used by Module::FindFunctions.
bool include_inlines
Include inlined functions.
bool include_symbols
Include the symbol table.
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)
Struct to store information for color highlighting in the stream.