62#include "clang/Frontend/CompilerInstance.h"
63#include "clang/Frontend/CompilerInvocation.h"
64#include "clang/Frontend/FrontendActions.h"
65#include "clang/Serialization/ObjectFilePCHContainerReader.h"
66#include "llvm/ADT/ScopeExit.h"
67#include "llvm/ADT/StringRef.h"
68#include "llvm/Support/FileSystem.h"
69#include "llvm/Support/FormatAdapters.h"
76 const char *prefix_cstr,
77 bool show_stopped_process_status,
Stream &strm) {
82 bool exe_valid =
false;
87 ::strcpy(exe_path,
"<none>");
89 std::string formatted_label =
"";
90 const std::string &label = target->
GetLabel();
92 formatted_label =
" (" + label +
")";
95 strm.
Printf(
"%starget #%u%s: %s", prefix_cstr ? prefix_cstr :
"", target_idx,
96 formatted_label.data(), exe_path);
98 uint32_t properties = 0;
106 strm.
Format(
"{0}platform={1}", properties++ > 0 ?
", " :
" ( ",
107 platform_sp->GetName());
110 bool show_process_status =
false;
113 StateType state = process_sp->GetState();
114 if (show_stopped_process_status)
118 strm.
Printf(
"%spid=%" PRIu64, properties++ > 0 ?
", " :
" ( ", pid);
119 strm.
Printf(
"%sstate=%s", properties++ > 0 ?
", " :
" ( ", state_cstr);
125 if (show_process_status) {
126 const bool only_threads_with_stop_reason =
true;
127 const uint32_t start_frame = 0;
128 const uint32_t num_frames = 1;
129 const uint32_t num_frames_with_source = 1;
130 const bool stop_format =
false;
131 process_sp->GetStatus(strm);
132 process_sp->GetThreadStatus(strm, only_threads_with_stop_reason,
133 start_frame, num_frames, num_frames_with_source,
139 bool show_stopped_process_status,
Stream &strm) {
144 for (uint32_t i = 0; i < num_targets; ++i) {
147 bool is_selected = target_sp.get() == selected_target_sp.get();
149 show_stopped_process_status, strm);
156#define LLDB_OPTIONS_target_dependents
157#include "CommandOptions.inc"
166 return llvm::ArrayRef(g_target_dependents_options);
174 if (option_value.empty()) {
179 const char short_option =
180 g_target_dependents_options[option_idx].short_option;
181 if (short_option ==
'd') {
184 option_value, g_target_dependents_options[option_idx].enum_values, 0,
189 error.SetErrorStringWithFormat(
"unrecognized short option '%c'",
210#pragma mark CommandObjectTargetCreate
216 interpreter,
"target create",
217 "Create a target using the argument as the main executable.",
221 "Fullpath to a core file to use for this target."),
223 "Optional name for this target.", nullptr),
226 "Fullpath to a stand alone debug "
227 "symbols file for when debug symbols "
228 "are not in the executable."),
231 "Fullpath to the file on the remote host if debugging remotely.") {
262 llvm::toString(file.takeError()));
267 if (argc == 1 || core_file || remote_file) {
276 llvm::toString(file.takeError()));
284 bool must_set_platform_path =
false;
291 debugger, file_path, arch_cstr,
300 const llvm::StringRef label =
302 if (!label.empty()) {
303 if (
auto E = target_sp->SetLabel(label))
308 auto on_error = llvm::make_scope_exit(
310 target_list.DeleteTarget(target_sp);
317 PlatformSP platform_sp = target_sp->GetPlatform();
321 file_spec.
SetFile(file_path, FileSpec::Style::native);
326 if (platform_sp && platform_sp->IsHost() &&
336 if (!platform_sp->GetFileExists(remote_file)) {
337 Status err = platform_sp->PutFile(file_spec, remote_file);
351 Status err = platform_sp->GetFile(remote_file, file_spec);
365 if (platform_sp->IsHost()) {
366 result.
AppendError(
"Supply a local file, not a remote file, "
367 "when debugging on the host.");
370 if (platform_sp->IsConnected() && !platform_sp->GetFileExists(remote_file)) {
371 result.
AppendError(
"remote --> local transfer without local "
372 "path is not implemented yet");
379 target_sp->SetProcessLaunchInfo(launch_info);
383 result.
AppendError(
"no platform found for target");
388 if (symfile || remote_file) {
389 ModuleSP module_sp(target_sp->GetExecutableModule());
392 module_sp->SetSymbolFileFileSpec(symfile);
394 std::string remote_path = remote_file.
GetPath();
395 target_sp->SetArg0(remote_path.c_str());
396 module_sp->SetPlatformFileSpec(remote_file);
401 if (must_set_platform_path) {
404 target_sp->GetOrCreateModule(main_module_spec,
true );
406 module_sp->SetPlatformFileSpec(remote_file);
412 target_sp->AppendExecutableSearchPaths(core_file_dir);
414 ProcessSP process_sp(target_sp->CreateProcess(
415 GetDebugger().GetListener(), llvm::StringRef(), &core_file,
false));
420 error = process_sp->LoadCore();
427 "Core file '{0}' ({1}) was loaded.\n", core_file.
GetPath(),
428 target_sp->GetArchitecture().GetArchitectureName());
438 "Current executable set to '%s' (%s).\n",
440 target_sp->GetArchitecture().GetArchitectureName());
446 "argument, or use the --core option.\n",
462#pragma mark CommandObjectTargetList
468 interpreter,
"target list",
469 "List all current targets in the current debug session.", nullptr) {
478 bool show_stopped_process_status =
false;
480 show_stopped_process_status, strm) == 0) {
487#pragma mark CommandObjectTargetSelect
493 interpreter,
"target select",
494 "Select a target as the current target by target index.", nullptr) {
507 if (llvm::to_integer(target_identifier, target_idx)) {
508 if (target_idx < num_targets) {
511 bool show_stopped_process_status =
false;
515 if (num_targets > 0) {
517 "index %u is out of range, valid target indexes are 0 - %u\n",
518 target_idx, num_targets - 1);
521 "index %u is out of range since there are no active targets\n",
526 for (
size_t i = 0; i < num_targets; i++) {
528 const std::string &label = target_sp->GetLabel();
529 if (!label.empty() && label == target_identifier) {
539 bool show_stopped_process_status =
false;
549 "'target select' takes a single argument: a target index\n");
554#pragma mark CommandObjectTargetDelete
560 "Delete one or more targets by target index.",
566 "Perform extra cleanup to minimize memory consumption after "
567 "deleting the target. "
568 "By default, LLDB will keep in memory any modules previously "
569 "loaded by the target as well "
570 "as all of its debug info. Specifying --clean will unload all of "
571 "these shared modules and "
572 "cause them to be reparsed again the next time the target is run",
587 std::vector<TargetSP> delete_target_list;
594 }
else if (argc > 0) {
597 if (num_targets == 0) {
602 for (
auto &entry : args.
entries()) {
604 if (entry.ref().getAsInteger(0, target_idx)) {
609 if (target_idx < num_targets) {
612 delete_target_list.push_back(target_sp);
618 "target indexes are 0 - %u\n",
619 target_idx, num_targets - 1);
622 "target index %u is out of range, the only valid index is 0\n",
633 delete_target_list.push_back(target_sp);
636 const size_t num_targets_to_delete = delete_target_list.size();
637 for (
size_t idx = 0; idx < num_targets_to_delete; ++idx) {
638 target_sp = delete_target_list[idx];
640 target_sp->Destroy();
645 const bool mandatory =
true;
649 (uint32_t)num_targets_to_delete);
664 interpreter,
"target show-launch-environment",
665 "Shows the environment being passed to the process when launched, "
666 "taking info account 3 settings: target.env-vars, "
667 "target.inherit-env and target.unset-env-vars.",
668 nullptr, eCommandRequiresTarget) {}
677 std::vector<Environment::value_type *> env_vector;
678 env_vector.reserve(env.size());
680 env_vector.push_back(&KV);
681 std::sort(env_vector.begin(), env_vector.end(),
682 [](Environment::value_type *a, Environment::value_type *b) {
683 return a->first() < b->first();
687 for (
auto &KV : env_vector)
688 strm.
Format(
"{0}={1}\n", KV->first(), KV->second);
694#pragma mark CommandObjectTargetVariable
703 "Read global variables for the current target, "
704 "before or while running a process.",
705 nullptr, eCommandRequiresTarget),
710 "A basename or fullpath to a file that contains "
711 "global variables. This option can be "
712 "specified multiple times."),
716 "A basename or fullpath to a shared library to use in the search "
718 "variables. This option can be specified multiple times.") {
737 const char *root_name) {
740 if (!valobj_sp->GetTargetSP()->GetDisplayRuntimeSupportValues() &&
741 valobj_sp->IsRuntimeSupportValue())
744 switch (var_sp->GetScope()) {
775 bool show_fullpaths =
false;
776 bool show_module =
true;
777 if (var_sp->DumpDeclaration(&s, show_fullpaths, show_module))
787 if (llvm::Error
error = valobj_sp->Dump(s, options))
793 size_t old_size = variable_list.
GetSize();
798 return variable_list.
GetSize() - old_size;
807 if (variable_list.
Empty())
811 s.
Format(
"Global variables for {0} in {1}:\n",
814 s.
Printf(
"Global variables for %s\n",
815 sc.
module_sp->GetFileSpec().GetPath().c_str());
843 bool use_var_name =
false;
848 "error: invalid regular expression: '%s'\n", arg.c_str());
854 matches = variable_list.
GetSize();
859 matches = variable_list.
GetSize();
867 for (uint32_t global_idx = 0; global_idx < matches; ++global_idx) {
878 use_var_name ? var_sp->GetName().GetCString()
890 const size_t num_compile_units = compile_units.
GetSize();
891 const size_t num_shlibs = shlibs.
GetSize();
892 if (num_compile_units == 0 && num_shlibs == 0) {
893 bool success =
false;
900 const bool can_create =
true;
903 if (comp_unit_varlist_sp) {
904 size_t count = comp_unit_varlist_sp->GetSize();
916 "no global variables in current compile unit: {0}\n",
920 "no debug information for frame %u\n",
923 result.
AppendError(
"'target variable' takes one or more global "
924 "variable names as arguments\n");
929 if (num_shlibs > 0) {
930 for (
size_t shlib_idx = 0; shlib_idx < num_shlibs; ++shlib_idx) {
937 if (num_compile_units > 0) {
938 for (
size_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
939 module_sp->FindCompileUnits(
949 "target doesn't contain the specified shared library: %s\n",
950 module_file.
GetPath().c_str());
956 for (
size_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx)
963 const bool can_create =
true;
965 sc.comp_unit->GetVariableList(can_create));
966 if (comp_unit_varlist_sp)
968 }
else if (sc.module_sp) {
971 llvm::StringRef(
"."));
973 sc.module_sp->FindGlobalVariables(all_globals_regex,
UINT32_MAX,
993#pragma mark CommandObjectTargetModulesSearchPathsAdd
999 "Add new image search paths substitution pairs to "
1000 "the current target.",
1001 nullptr, eCommandRequiresTarget) {
1020 arg.push_back(old_prefix_arg);
1021 arg.push_back(new_prefix_arg);
1033 result.
AppendError(
"add requires an even number of arguments\n");
1035 for (
size_t i = 0; i < argc; i += 2) {
1039 if (from[0] && to[0]) {
1043 "target modules search path adding ImageSearchPath "
1044 "pair: '%s' -> '%s'",
1047 bool last_pair = ((argc - i) == 2);
1049 from, to, last_pair);
1053 result.
AppendError(
"<path-prefix> can't be empty\n");
1055 result.
AppendError(
"<new-path-prefix> can't be empty\n");
1062#pragma mark CommandObjectTargetModulesSearchPathsClear
1068 "Clear all current image search path substitution "
1069 "pairs from the current target.",
1070 "target modules search-paths clear",
1071 eCommandRequiresTarget) {}
1084#pragma mark CommandObjectTargetModulesSearchPathsInsert
1090 "Insert a new image search path substitution pair "
1091 "into the current target at the specified index.",
1092 nullptr, eCommandRequiresTarget) {
1104 arg1.push_back(index_arg);
1120 arg2.push_back(old_prefix_arg);
1121 arg2.push_back(new_prefix_arg);
1138 const size_t num = list.
GetSize();
1140 for (
size_t i = 0; i < num; ++i) {
1144 strm << old_path <<
" -> " << new_path;
1154 if (argc >= 3 && argc & 1) {
1155 uint32_t insert_idx;
1159 "<index> parameter is not an integer: '%s'.\n",
1168 for (uint32_t i = 0; i < argc; i += 2, ++insert_idx) {
1172 if (from[0] && to[0]) {
1173 bool last_pair = ((argc - i) == 2);
1179 result.
AppendError(
"<path-prefix> can't be empty\n");
1181 result.
AppendError(
"<new-path-prefix> can't be empty\n");
1186 result.
AppendError(
"insert requires at least three arguments\n");
1191#pragma mark CommandObjectTargetModulesSearchPathsList
1197 "List all current image search path substitution "
1198 "pairs in the current target.",
1199 "target modules search-paths list",
1200 eCommandRequiresTarget) {}
1212#pragma mark CommandObjectTargetModulesSearchPathsQuery
1218 interpreter,
"target modules search-paths query",
1219 "Transform a path using the first applicable image search path.",
1220 nullptr, eCommandRequiresTarget) {
1230 result.
AppendError(
"query requires one argument\n");
1247 bool full_triple, uint32_t width) {
1255 std::string arch_str = std::string(arch_strm.
GetString());
1258 strm.
Printf(
"%-*s", width, arch_str.c_str());
1275 uint32_t num_matches = 0;
1279 file_spec, 0,
false, eSymbolContextCompUnit, sc_list);
1281 bool first_module =
true;
1286 strm <<
"Line table for " << sc.comp_unit->GetPrimaryFile() <<
" in `"
1288 LineTable *line_table = sc.comp_unit->GetLineTable();
1294 strm <<
"No line table";
1296 first_module =
false;
1304 if (file_spec_ptr) {
1306 std::string fullpath = file_spec_ptr->
GetPath();
1307 strm.
Printf(
"%-*s", width, fullpath.c_str());
1316 strm.
Printf(
"%-*s", width,
"");
1321 if (file_spec_ptr) {
1330 strm.
Printf(
"%-*s", width,
"");
1335 if (file_spec_ptr) {
1344 strm.
Printf(
"%-*s", width,
"");
1348 std::lock_guard<std::recursive_mutex> guard(module_list.
GetMutex());
1349 const size_t num_modules = module_list.
GetSize();
1350 if (num_modules == 0)
1353 size_t num_dumped = 0;
1354 strm.
Format(
"Dumping headers for {0} module(s).\n", num_modules);
1358 if (num_dumped++ > 0) {
1362 ObjectFile *objfile = module_sp->GetObjectFile();
1364 objfile->
Dump(&strm);
1366 strm.
Format(
"No object file for module: {0:F}\n",
1367 module_sp->GetFileSpec());
1382 sort_order, name_preference);
1390 strm.
Printf(
"Sections for '%s' (%s):\n",
1403 symbol_file->Dump(strm);
1411 Module *module,
bool errors_only) {
1415 if (symbol_file->GetSeparateDebugInfo(d, errors_only)) {
1417 std::make_shared<StructuredData::Dictionary>(std::move(d)));
1430 "------------------ --- -----------------------------------------");
1439 strm.
Printf(
"0x%16.16" PRIx64
" ", dwo_id);
1441 strm.
Printf(
"0x???????????????? ");
1443 llvm::StringRef
error;
1445 strm <<
"E " <<
error;
1447 llvm::StringRef resolved_dwo_path;
1448 if (dict->GetValueForKeyAsString(
"resolved_dwo_path",
1449 resolved_dwo_path)) {
1450 strm <<
" " << resolved_dwo_path;
1451 if (resolved_dwo_path.ends_with(
".dwp")) {
1452 llvm::StringRef dwo_name;
1453 if (dict->GetValueForKeyAsString(
"dwo_name", dwo_name))
1454 strm <<
"(" << dwo_name <<
")";
1467 strm.
PutCString(
"------------------ --- ---------------------");
1474 uint32_t oso_mod_time;
1476 strm.
Printf(
"0x%16.16" PRIx32
" ", oso_mod_time);
1478 llvm::StringRef
error;
1480 strm <<
"E " <<
error;
1482 llvm::StringRef oso_path;
1483 if (dict->GetValueForKeyAsString(
"oso_path", oso_path))
1484 strm <<
" " << oso_path;
1493 bool verbose,
bool all_ranges,
Stream &strm,
1494 std::optional<Stream::HighlightSettings> settings = std::nullopt) {
1496 strm.
Indent(
" Address: ");
1501 strm.
Indent(
" Summary: ");
1517 Module *module, uint32_t resolve_mask,
1519 bool verbose,
bool all_ranges) {
1528 else if (so_addr.
GetModule().get() != module)
1537 DumpAddress(exe_scope, so_addr, verbose, all_ranges, strm);
1546 const char *name,
bool name_is_regex,
1547 bool verbose,
bool all_ranges) {
1557 std::vector<uint32_t> match_indexes;
1559 uint32_t num_matches = 0;
1560 if (name_is_regex) {
1569 if (num_matches > 0) {
1571 strm.
Printf(
"%u symbols match %s'%s' in ", num_matches,
1572 name_is_regex ?
"the regular expression " :
"", name);
1579 for (uint32_t i = 0; i < num_matches; ++i) {
1586 use_color && name_is_regex
1587 ? std::optional<Stream::HighlightSettings>{settings}
1595 use_color && name_is_regex
1596 ? std::optional<Stream::HighlightSettings>{settings}
1617 std::optional<Stream::HighlightSettings> settings = std::nullopt) {
1619 bool first_module =
true;
1626 sc.GetAddressRange(eSymbolContextEverything, 0,
true, range);
1630 first_module =
false;
1637 const char *name,
bool name_is_regex,
1639 bool verbose,
bool all_ranges) {
1640 if (module && name && name[0]) {
1642 size_t num_matches = 0;
1643 if (name_is_regex) {
1645 module->
FindFunctions(function_name_regex, options, sc_list);
1649 eFunctionNameTypeAuto, options, sc_list);
1651 num_matches = sc_list.
GetSize();
1654 strm.
Printf(
"%" PRIu64
" match%s found in ", (uint64_t)num_matches,
1655 num_matches > 1 ?
"es" :
"");
1660 strm, sc_list, verbose, all_ranges);
1669 Module *module,
const char *name_cstr,
1670 bool name_is_regex) {
1671 if (module && name_cstr && name_cstr[0]) {
1679 sc.
module_sp = module->shared_from_this();
1683 if (type_list.
Empty())
1686 const uint64_t num_matches = type_list.
GetSize();
1689 strm.
Printf(
"%" PRIu64
" match%s found in ", num_matches,
1690 num_matches > 1 ?
"es" :
"");
1698 type_sp->GetFullCompilerType();
1701 TypeSP typedef_type_sp(type_sp);
1702 TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
1703 while (typedefed_type_sp) {
1705 strm.
Printf(
" typedef '%s': ",
1706 typedef_type_sp->GetName().GetCString());
1707 typedefed_type_sp->GetFullCompilerType();
1710 typedef_type_sp = typedefed_type_sp;
1711 typedefed_type_sp = typedef_type_sp->GetTypedefType();
1722 const char *name_cstr,
bool name_is_regex) {
1728 sc.
module_sp = module.shared_from_this();
1730 if (type_list.
Empty())
1742 type_sp->GetFullCompilerType();
1745 TypeSP typedef_type_sp(type_sp);
1746 TypeSP typedefed_type_sp(typedef_type_sp->GetTypedefType());
1747 while (typedefed_type_sp) {
1749 strm.
Printf(
" typedef '%s': ",
1750 typedef_type_sp->GetName().GetCString());
1751 typedefed_type_sp->GetFullCompilerType();
1754 typedef_type_sp = typedefed_type_sp;
1755 typedefed_type_sp = typedef_type_sp->GetTypedefType();
1765 uint32_t line,
bool check_inlines,
1766 bool verbose,
bool all_ranges) {
1767 if (module && file_spec) {
1770 file_spec, line, check_inlines, eSymbolContextEverything, sc_list);
1771 if (num_matches > 0) {
1773 strm.
Printf(
"%u match%s found in ", num_matches,
1774 num_matches > 1 ?
"es" :
"");
1777 strm.
Printf(
":%u", line);
1783 strm, sc_list, verbose, all_ranges);
1792 bool check_global_list) {
1793 FileSpec module_file_spec(module_name);
1796 const size_t initial_size = module_list.
GetSize();
1798 if (check_global_list) {
1800 std::lock_guard<std::recursive_mutex> guard(
1804 for (
size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
1809 module_sp = module->shared_from_this();
1817 const size_t num_matches = module_list.
GetSize();
1821 if (num_matches == 0) {
1830 return module_list.
GetSize() - initial_size;
1833#pragma mark CommandObjectTargetModulesModuleAutoComplete
1860#pragma mark CommandObjectTargetModulesSourceFileAutoComplete
1870 const char *syntax, uint32_t flags)
1885#pragma mark CommandObjectTargetModulesDumpObjfile
1892 interpreter,
"target modules dump objfile",
1893 "Dump the object file headers from one or more target modules.",
1894 nullptr, eCommandRequiresTarget) {}
1906 size_t num_dumped = 0;
1911 if (num_dumped == 0) {
1912 result.
AppendError(
"the target has no associated executable images");
1917 const char *arg_cstr;
1918 for (
int arg_idx = 0;
1921 size_t num_matched =
1923 if (num_matched == 0) {
1925 "Unable to find an image that matches '%s'.\n", arg_cstr);
1933 if (num_dumped > 0) {
1936 result.
AppendError(
"no matching executable images found");
1941#define LLDB_OPTIONS_target_modules_dump_symtab
1942#include "CommandOptions.inc"
1949 interpreter,
"target modules dump symtab",
1950 "Dump the symbol table from one or more target modules.", nullptr,
1951 eCommandRequiresTarget) {}
1968 switch (short_option) {
1981 llvm_unreachable(
"Unimplemented option");
1992 return llvm::ArrayRef(g_target_modules_dump_symtab_options);
2002 uint32_t num_dumped = 0;
2014 std::lock_guard<std::recursive_mutex> guard(module_list.
GetMutex());
2015 const size_t num_modules = module_list.
GetSize();
2016 if (num_modules > 0) {
2018 "Dumping symbol table for {0} modules.\n", num_modules);
2020 if (num_dumped > 0) {
2025 "Interrupted in dump all symtabs with {0} "
2026 "of {1} dumped.", num_dumped, num_modules))
2035 result.
AppendError(
"the target has no associated executable images");
2040 const char *arg_cstr;
2041 for (
int arg_idx = 0;
2045 const size_t num_matches =
2047 if (num_matches > 0) {
2050 if (num_dumped > 0) {
2055 "Interrupted in dump symtab list with {0} of {1} dumped.",
2056 num_dumped, num_matches))
2067 "Unable to find an image that matches '%s'.\n", arg_cstr);
2074 result.
AppendError(
"no matching executable images found");
2081#pragma mark CommandObjectTargetModulesDumpSections
2090 interpreter,
"target modules dump sections",
2091 "Dump the sections from one or more target modules.",
2093 nullptr, eCommandRequiresTarget) {}
2100 uint32_t num_dumped = 0;
2109 if (num_modules == 0) {
2110 result.
AppendError(
"the target has no associated executable images");
2116 for (
size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
2118 "Interrupted in dump all sections with {0} of {1} dumped",
2119 image_idx, num_modules))
2129 const char *arg_cstr;
2130 for (
int arg_idx = 0;
2134 const size_t num_matches =
2136 if (num_matches > 0) {
2137 for (
size_t i = 0; i < num_matches; ++i) {
2139 "Interrupted in dump section list with {0} of {1} dumped.",
2152 std::lock_guard<std::recursive_mutex> guard(
2156 "Unable to find an image that matches '%s'.\n", arg_cstr);
2164 result.
AppendError(
"no matching executable images found");
2173 interpreter,
"target modules dump pcm-info",
2174 "Dump information about the given clang module (pcm).") {
2192 if (pcm_file.GetFileNameExtension() !=
".pcm") {
2193 result.
AppendError(
"file must have a .pcm extension");
2202 clang::CompilerInstance compiler;
2203 compiler.createDiagnostics();
2205 const char *clang_args[] = {
"clang", pcm_path};
2206 compiler.setInvocation(clang::createInvocation(clang_args));
2210 std::shared_ptr<llvm::raw_ostream> Out(
2212 clang::DumpModuleInfoAction dump_module_info(Out);
2214 compiler.getPCHContainerOperations()->registerReader(
2215 std::make_unique<clang::ObjectFilePCHContainerReader>());
2217 if (compiler.ExecuteAction(dump_module_info))
2222#pragma mark CommandObjectTargetModulesDumpClangAST
2231 interpreter,
"target modules dump ast",
2232 "Dump the clang ast for a given module's symbol file.",
2234 nullptr, eCommandRequiresTarget) {}
2243 const size_t num_modules = module_list.
GetSize();
2244 if (num_modules == 0) {
2245 result.
AppendError(
"the target has no associated executable images");
2256 if (
SymbolFile *sf = module_sp->GetSymbolFile())
2266 const size_t num_matches =
2268 if (num_matches == 0) {
2270 std::lock_guard<std::recursive_mutex> guard(
2274 "Unable to find an image that matches '%s'.\n", arg.c_str());
2278 for (
size_t i = 0; i < num_matches; ++i) {
2280 "Interrupted in dump clang ast list with {0} of {1} dumped.",
2293#pragma mark CommandObjectTargetModulesDumpSymfile
2302 interpreter,
"target modules dump symfile",
2303 "Dump the debug symbol file for one or more target modules.",
2305 nullptr, eCommandRequiresTarget) {}
2312 uint32_t num_dumped = 0;
2321 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2322 const size_t num_modules = target_modules.
GetSize();
2323 if (num_modules == 0) {
2324 result.
AppendError(
"the target has no associated executable images");
2328 "Dumping debug symbols for {0} modules.\n", num_modules);
2331 "debug symbols with {0} of {1} modules dumped",
2332 num_dumped, num_modules))
2340 const char *arg_cstr;
2341 for (
int arg_idx = 0;
2345 const size_t num_matches =
2347 if (num_matches > 0) {
2348 for (
size_t i = 0; i < num_matches; ++i) {
2350 "of {1} requested modules",
2361 "Unable to find an image that matches '%s'.\n", arg_cstr);
2368 result.
AppendError(
"no matching executable images found");
2373#pragma mark CommandObjectTargetModulesDumpLineTable
2374#define LLDB_OPTIONS_target_modules_dump
2375#include "CommandOptions.inc"
2384 interpreter,
"target modules dump line-table",
2385 "Dump the line table for one or more compilation units.", nullptr,
2386 eCommandRequiresTarget) {}
2395 uint32_t total_num_dumped = 0;
2402 result.
AppendError(
"file option must be specified.");
2406 const char *arg_cstr;
2407 for (
int arg_idx = 0;
2413 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2414 size_t num_modules = target_modules.
GetSize();
2415 if (num_modules > 0) {
2416 uint32_t num_dumped = 0;
2419 "Interrupted in dump all line tables with "
2420 "{0} of {1} dumped", num_dumped,
2431 if (num_dumped == 0)
2433 "No source filenames matched '%s'.\n", arg_cstr);
2435 total_num_dumped += num_dumped;
2440 if (total_num_dumped > 0)
2443 result.
AppendError(
"no source filenames matched any command arguments");
2453 assert(option_idx == 0 &&
"We only have one option.");
2464 return llvm::ArrayRef(g_target_modules_dump_options);
2473#pragma mark CommandObjectTargetModulesDumpSeparateDebugInfoFiles
2474#define LLDB_OPTIONS_target_modules_dump_separate_debug_info
2475#include "CommandOptions.inc"
2485 interpreter,
"target modules dump separate-debug-info",
2486 "List the separate debug info symbol files for one or more target "
2488 nullptr, eCommandRequiresTarget) {}
2505 switch (short_option) {
2515 llvm_unreachable(
"Unimplemented option");
2526 return llvm::ArrayRef(g_target_modules_dump_separate_debug_info_options);
2536 uint32_t num_dumped = 0;
2546 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
2547 const size_t num_modules = target_modules.
GetSize();
2548 if (num_modules == 0) {
2549 result.
AppendError(
"the target has no associated executable images");
2555 "Interrupted in dumping all "
2556 "separate debug info with {0} of {1} modules dumped",
2557 num_dumped, num_modules))
2567 const char *arg_cstr;
2568 for (
int arg_idx = 0;
2572 const size_t num_matches =
2574 if (num_matches > 0) {
2575 for (
size_t i = 0; i < num_matches; ++i) {
2577 "Interrupted dumping {0} "
2578 "of {1} requested modules",
2588 "Unable to find an image that matches '%s'.\n", arg_cstr);
2592 if (num_dumped > 0) {
2597 separate_debug_info_lists_by_module.
Dump(strm,
2601 separate_debug_info_lists_by_module.
ForEach(
2611 if (!separate_debug_info_list) {
2615 llvm::StringRef type;
2616 llvm::StringRef symfile;
2623 "separate-debug-info-files", files))) {
2627 strm <<
"Symbol file: " << symfile;
2629 strm <<
"Type: \"" << type <<
"\"";
2631 if (type ==
"dwo") {
2633 }
else if (type ==
"oso") {
2637 "Found unsupported debug info type '%s'.\n",
2638 type.str().c_str());
2645 result.
AppendError(
"no matching executable images found");
2652#pragma mark CommandObjectTargetModulesDump
2661 interpreter,
"target modules dump",
2662 "Commands for dumping information about one or more target "
2664 "target modules dump "
2665 "[objfile|symtab|sections|ast|symfile|line-table|pcm-info|separate-"
2667 "[<file1> <file2> ...]") {
2703 "Add a new module to the current target's modules.",
2704 "target modules add [<module>]",
2705 eCommandRequiresTarget),
2708 "Fullpath to a stand alone debug "
2709 "symbols file for when debug symbols "
2710 "are not in the executable.") {
2754 "Unable to create the executable or symbol file with "
2755 "UUID %s with path %s and symbol file %s",
2760 "Unable to create the executable or symbol file with "
2761 "UUID %s with path %s",
2767 "or symbol file with UUID %s",
2776 "Unable to locate the executable or symbol file with UUID %s",
2783 "one or more executable image paths must be specified");
2787 for (
auto &entry : args.
entries()) {
2788 if (entry.ref().empty())
2806 const char *error_cstr =
error.AsCString();
2818 std::string resolved_path = file_spec.
GetPath();
2819 if (resolved_path != entry.ref()) {
2821 "invalid module path '%s' with resolved path '%s'\n",
2822 entry.ref().str().c_str(), resolved_path.c_str());
2845 interpreter,
"target modules load",
2846 "Set the load addresses for one or more sections in a target "
2848 "target modules load [--file <module> --uuid <uuid>] <sect-name> "
2849 "<address> [<sect-name> <address> ....]",
2850 eCommandRequiresTarget),
2852 "Fullpath or basename for module to load.",
""),
2854 "Write file contents to the memory.", false, true),
2856 "Set PC to the entry point."
2857 " Only applicable with '--load' option.",
2860 "Set the load address for all sections to be the "
2861 "virtual address in the file plus the offset.",
2884 bool search_using_module_spec =
false;
2891 if (module_list.
GetSize() == 1) {
2892 search_using_module_spec =
true;
2900 search_using_module_spec =
true;
2902 const bool use_global_module_list =
true;
2905 &target, arg_cstr, module_list, use_global_module_list);
2906 if (num_matches == 1) {
2909 }
else if (num_matches > 1) {
2910 search_using_module_spec =
false;
2912 "more than 1 module matched by name '%s'\n", arg_cstr);
2914 search_using_module_spec =
false;
2921 search_using_module_spec =
true;
2926 if (search_using_module_spec) {
2929 const size_t num_matches = matching_modules.
GetSize();
2932 if (num_matches == 1) {
2939 bool changed =
false;
2944 const bool slide_is_offset =
true;
2948 result.
AppendError(
"one or more section name + load "
2949 "address pair must be specified");
2954 result.
AppendError(
"The \"--slide <offset>\" option can't "
2955 "be used in conjunction with setting "
2956 "section load addresses.\n");
2960 for (
size_t i = 0; i < argc; i += 2) {
2963 if (sect_name && load_addr_cstr) {
2966 if (llvm::to_integer(load_addr_cstr, load_addr)) {
2970 if (section_sp->IsThreadSpecific()) {
2972 "thread specific sections are not yet "
2973 "supported (section '%s')\n",
2978 section_sp, load_addr))
2981 "section '%s' loaded at 0x%" PRIx64
"\n",
2982 sect_name, load_addr);
2986 "matches the section "
2993 "invalid load address string '%s'\n", load_addr_cstr);
2998 result.
AppendError(
"section names must be followed by "
2999 "a load address.\n");
3001 result.
AppendError(
"one or more section name + load "
3002 "address pair must be specified.\n");
3021 if (set_pc && !file_entry.
IsValid()) {
3022 result.
AppendError(
"No entry address in object file");
3025 std::vector<ObjectFile::LoadableData> loadables(
3027 if (loadables.size() == 0) {
3031 Status error = process->WriteObjectFile(std::move(loadables));
3037 ThreadList &thread_list = process->GetThreadList();
3041 if (!reg_context->SetPC(file_entry_addr)) {
3060 if (module_spec_file) {
3061 module_spec_file->
GetPath(path,
sizeof(path));
3067 std::string uuid_str;
3076 if (num_matches > 1) {
3078 "multiple modules match%s%s%s%s:\n", path[0] ?
" file=" :
"",
3079 path, !uuid_str.empty() ?
" uuid=" :
"", uuid_str.c_str());
3080 for (
size_t i = 0; i < num_matches; ++i) {
3088 "no modules were found that match%s%s%s%s.\n",
3089 path[0] ?
" file=" :
"", path, !uuid_str.empty() ?
" uuid=" :
"",
3094 result.
AppendError(
"either the \"--file <module>\" or the \"--uuid "
3095 "<uuid>\" option must be specified.\n");
3107#pragma mark CommandObjectTargetModulesList
3109#define LLDB_OPTIONS_target_modules_list
3110#include "CommandOptions.inc"
3125 if (short_option ==
'g') {
3127 }
else if (short_option ==
'a') {
3131 unsigned long width = 0;
3132 option_arg.getAsInteger(0, width);
3145 return llvm::ArrayRef(g_target_modules_list_options);
3157 interpreter,
"target modules list",
3158 "List current executable and dependent shared library images.") {
3189 "Couldn't find module matching address: 0x%" PRIx64
".",
3194 "Couldn't find module containing address: 0x%" PRIx64
".",
3200 size_t num_modules = 0;
3206 std::unique_lock<std::recursive_mutex> guard(
3212 if (use_global_module_list) {
3222 &target, arg.c_str(), module_list, use_global_module_list);
3223 if (num_matches == 0) {
3232 module_list_ptr = &module_list;
3235 std::unique_lock<std::recursive_mutex> lock;
3236 if (module_list_ptr !=
nullptr) {
3238 std::unique_lock<std::recursive_mutex>(module_list_ptr->
GetMutex());
3240 num_modules = module_list_ptr->
GetSize();
3243 if (num_modules > 0) {
3244 for (uint32_t image_idx = 0; image_idx < num_modules; ++image_idx) {
3247 if (module_list_ptr) {
3249 module = module_sp.get();
3252 module_sp = module->shared_from_this();
3255 const size_t indent = strm.
Printf(
"[%3u] ", image_idx);
3261 if (use_global_module_list)
3263 "the global module list has no matching modules");
3265 result.
AppendError(
"the target has no matching modules");
3267 if (use_global_module_list)
3268 result.
AppendError(
"the global module list is empty");
3271 "the target has no associated executable images");
3278 if (module ==
nullptr) {
3283 bool dump_object_name =
false;
3291 bool print_space =
false;
3292 for (
size_t i = 0; i < num_entries; ++i) {
3298 switch (format_char) {
3309 dump_object_name =
true;
3318 dump_object_name =
true;
3325 uint32_t addr_nibble_width =
3335 base_addr.
Dump(&strm, &target,
3339 if (format_char ==
'o') {
3341 strm.
Printf(
"0x%*.*" PRIx64, addr_nibble_width,
3346 strm.
Printf(
"0x%*.*" PRIx64, addr_nibble_width,
3347 addr_nibble_width, load_addr);
3358 strm.
Printf(
"%*s", addr_nibble_width + 2,
"");
3363 size_t ref_count = 0;
3364 char in_shared_cache =
'Y';
3366 ModuleSP module_sp(module->shared_from_this());
3368 in_shared_cache =
'N';
3371 ref_count = module_sp.use_count() - 1;
3374 strm.
Printf(
"{%c %*" PRIu64
"}", in_shared_cache, width, (uint64_t)ref_count);
3376 strm.
Printf(
"{%c %" PRIu64
"}", in_shared_cache, (uint64_t)ref_count);
3383 symbol_file->GetObjectFile()->GetFileSpec();
3384 if (format_char ==
'S') {
3386 if (!symfile_spec || symfile_spec == module->
GetFileSpec()) {
3387 print_space =
false;
3391 strm.
Printf(
"\n%*s", indent,
"");
3394 dump_object_name =
true;
3397 strm.
Printf(
"%.*s", width,
"<NONE>");
3402 llvm::AlignStyle::Left, width));
3406 strm.
Printf(
"%p",
static_cast<void *
>(module));
3417 if (dump_object_name) {
3420 strm.
Printf(
"(%s)", object_name);
3428#pragma mark CommandObjectTargetModulesShowUnwind
3431#define LLDB_OPTIONS_target_modules_show_unwind
3432#include "CommandOptions.inc"
3457 switch (short_option) {
3459 m_str = std::string(option_arg);
3464 error.SetErrorStringWithFormat(
"invalid address string '%s'",
3465 option_arg.str().c_str());
3470 m_str = std::string(option_arg);
3475 llvm_unreachable(
"Unimplemented option");
3488 return llvm::ArrayRef(g_target_modules_show_unwind_options);
3501 interpreter,
"target modules show-unwind",
3502 "Show synthesized unwind instructions for a function.", nullptr,
3503 eCommandRequiresTarget | eCommandRequiresProcess |
3504 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {}
3516 abi = process->
GetABI().get();
3518 if (process ==
nullptr) {
3520 "You must have a process running to use this command.");
3526 result.
AppendError(
"The process must be paused to use this command.");
3532 result.
AppendError(
"The process must be paused to use this command.");
3544 function_options, sc_list);
3551 module_sp->ResolveSymbolContextForAddress(addr,
3552 eSymbolContextEverything, sc);
3559 "address-expression or function name option must be specified.");
3570 if (sc.symbol ==
nullptr && sc.function ==
nullptr)
3572 if (!sc.module_sp || sc.module_sp->GetObjectFile() ==
nullptr)
3575 if (!sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, 0,
3588 sc.module_sp->GetUnwindTable()
3589 .GetUncachedFuncUnwindersContainingAddress(start_addr, sc));
3590 if (!func_unwinders_sp)
3594 "UNWIND PLANS for %s`%s (start addr 0x%" PRIx64
")\n",
3595 sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(),
3601 for (
size_t i = 0; i < count; i++) {
3603 if (strcmp(funcname.
GetCString(), trap_func_name) == 0)
3606 "treated as a trap handler function via user setting.\n");
3610 const std::vector<ConstString> trap_handler_names(
3611 platform_sp->GetTrapHandlerSymbolNames());
3612 for (
ConstString trap_name : trap_handler_names) {
3613 if (trap_name == funcname) {
3616 "name is listed by the platform as a trap handler.\n");
3624 func_unwinders_sp->GetUnwindPlanAtNonCallSite(*target, *thread);
3625 if (non_callsite_unwind_plan) {
3627 "Asynchronous (not restricted to call-sites) UnwindPlan is '%s'\n",
3628 non_callsite_unwind_plan->GetSourceName().AsCString());
3631 func_unwinders_sp->GetUnwindPlanAtCallSite(*target, *thread);
3632 if (callsite_unwind_plan) {
3634 "Synchronous (restricted to call-sites) UnwindPlan is '%s'\n",
3635 callsite_unwind_plan->GetSourceName().AsCString());
3638 func_unwinders_sp->GetUnwindPlanFastUnwind(*target, *thread);
3639 if (fast_unwind_plan) {
3641 "Fast UnwindPlan is '%s'\n",
3642 fast_unwind_plan->GetSourceName().AsCString());
3648 func_unwinders_sp->GetAssemblyUnwindPlan(*target, *thread);
3651 "Assembly language inspection UnwindPlan:\n");
3658 func_unwinders_sp->GetObjectFileUnwindPlan(*target);
3667 func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target, *thread);
3668 if (of_unwind_augmented_sp) {
3676 func_unwinders_sp->GetEHFrameUnwindPlan(*target);
3685 func_unwinders_sp->GetEHFrameAugmentedUnwindPlan(*target, *thread);
3686 if (ehframe_augmented_sp) {
3694 func_unwinders_sp->GetDebugFrameUnwindPlan(*target)) {
3702 func_unwinders_sp->GetDebugFrameAugmentedUnwindPlan(*target,
3711 func_unwinders_sp->GetArmUnwindUnwindPlan(*target);
3712 if (arm_unwind_sp) {
3720 func_unwinders_sp->GetSymbolFileUnwindPlan(*thread)) {
3728 func_unwinders_sp->GetCompactUnwindUnwindPlan(*target);
3729 if (compact_unwind_sp) {
3736 if (fast_unwind_plan) {
3746 if (abi_sp->CreateDefaultUnwindPlan(arch_default)) {
3754 if (abi_sp->CreateFunctionEntryUnwindPlan(arch_entry)) {
3756 "Arch default at entry point UnwindPlan:\n");
3771#define LLDB_OPTIONS_target_modules_lookup
3772#include "CommandOptions.inc"
3799 switch (short_option) {
3807 if (option_arg.getAsInteger(0,
m_offset))
3808 error.SetErrorStringWithFormat(
"invalid offset string '%s'",
3809 option_arg.str().c_str());
3813 m_str = std::string(option_arg);
3828 error.SetErrorStringWithFormat(
"invalid line number string '%s'",
3829 option_arg.str().c_str());
3831 error.SetErrorString(
"zero is an invalid line number");
3836 m_str = std::string(option_arg);
3841 m_str = std::string(option_arg);
3846 m_str = std::string(option_arg);
3866 llvm_unreachable(
"Unimplemented option");
3890 "conjunction with --verbose.");
3896 return llvm::ArrayRef(g_target_modules_lookup_options);
3917 "Look up information within executable and "
3918 "dependent shared library images.",
3919 nullptr, eCommandRequiresTarget) {
3928 bool &syntax_error) {
3946 const SymbolContext &sym_ctx(frame->GetSymbolContext(eSymbolContextModule));
3976 eSymbolContextEverything |
3978 ?
static_cast<int>(eSymbolContextVariable)
4047 syntax_error =
true;
4058 bool syntax_error =
false;
4060 uint32_t num_successful_lookups = 0;
4074 num_successful_lookups++;
4084 std::lock_guard<std::recursive_mutex> guard(target_modules.
GetMutex());
4085 if (target_modules.
GetSize() == 0) {
4086 result.
AppendError(
"the target has no associated executable images");
4091 if (module_sp != current_module &&
4095 num_successful_lookups++;
4100 const char *arg_cstr;
4105 const size_t num_matches =
4107 if (num_matches > 0) {
4108 for (
size_t j = 0; j < num_matches; ++j) {
4113 num_successful_lookups++;
4119 "Unable to find an image that matches '%s'.\n", arg_cstr);
4123 if (num_successful_lookups > 0)
4132#pragma mark CommandObjectMultiwordImageSearchPaths
4141 interpreter,
"target modules search-paths",
4142 "Commands for managing module search paths for a target.",
4143 "target modules search-paths <subcommand> [<subcommand-options>]") {
4165#pragma mark CommandObjectTargetModules
4174 "Commands for accessing information for one or "
4175 "more target modules.",
4176 "target modules <sub-command> ...") {
4210 interpreter,
"target symbols add",
4211 "Add a debug symbol file to one of the target's current modules by "
4212 "specifying a path to a debug symbols file or by using the options "
4213 "to specify a module.",
4214 "target symbols add <cmd-options> [<symfile>]",
4215 eCommandRequiresTarget),
4219 "Locate the debug symbols for the shared library specified by "
4223 "Locate the debug symbols for the currently selected frame.", false,
4226 "Locate the debug symbols for every frame in "
4227 "the current call stack.",
4250 if (!symbol_fspec) {
4252 "one or more executable image paths must be specified");
4257 symbol_fspec.
GetPath(symfile_path,
sizeof(symfile_path));
4271 0, 0, symfile_module_specs)) {
4277 symfile_module_spec)) {
4281 symfile_uuid_module_spec.
GetUUID() = symfile_module_spec.
GetUUID();
4287 if (matching_modules.
IsEmpty()) {
4290 const size_t num_symfile_module_specs = symfile_module_specs.
GetSize();
4292 i < num_symfile_module_specs && matching_modules.
IsEmpty(); ++i) {
4294 i, symfile_module_spec)) {
4298 symfile_uuid_module_spec.
GetUUID() =
4299 symfile_module_spec.
GetUUID();
4310 if (matching_modules.
IsEmpty())
4313 while (matching_modules.
IsEmpty()) {
4317 if (!filename_no_extension)
4329 if (matching_modules.
GetSize() > 1) {
4331 "use the --uuid option to resolve the "
4337 if (matching_modules.
GetSize() == 1) {
4343 module_sp->SetSymbolFileFileSpec(symbol_fspec);
4349 if (object_file && object_file->
GetFileSpec() == symbol_fspec) {
4351 const FileSpec &module_fs = module_sp->GetFileSpec();
4353 "symbol file '%s' has been added to '%s'\n", symfile_path,
4359 module_list.
Append(module_sp);
4366 module_sp->LoadScriptingResourceInTarget(target,
error,
4370 "unable to load scripting data for module %s - error "
4372 module_sp->GetFileSpec()
4373 .GetFileNameStrippingExtension()
4376 else if (feedback_stream.
GetSize())
4385 module_sp->SetSymbolFileFileSpec(
FileSpec());
4390 ss_symfile_uuid <<
" (";
4392 ss_symfile_uuid <<
')';
4395 "symbol file '%s'%s does not match any existing module%s\n",
4396 symfile_path, ss_symfile_uuid.
GetData(),
4397 !llvm::sys::fs::is_regular_file(symbol_fspec.
GetPath())
4398 ?
"\n please specify the full path to the symbol file"
4425 error_strm.
PutCString(
"unable to find debug symbols for UUID ");
4444 module_spec.
GetFileSpec() = module_sp->GetFileSpec();
4446 module_spec.
GetUUID() = module_sp->GetUUID();
4455 "unable to find debug symbols for the executable file ");
4470 "a process must exist in order to use the --frame option");
4489 if (!frame_module_sp) {
4495 module_spec.
GetUUID() = frame_module_sp->GetUUID();
4497 module_spec.
GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4500 result.
AppendError(
"unable to find debug symbols for the current frame");
4513 "a process must exist in order to use the --stack option");
4530 bool symbols_found =
false;
4532 for (uint32_t i = 0; i < frame_count; ++i) {
4536 frame_sp->GetSymbolContext(eSymbolContextModule).module_sp);
4537 if (!frame_module_sp)
4541 module_spec.
GetUUID() = frame_module_sp->GetUUID();
4542 module_spec.
GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
4545 bool current_frame_flush =
false;
4547 symbols_found =
true;
4548 flush |= current_frame_flush;
4551 if (!symbols_found) {
4553 "unable to find debug symbols in the current call stack");
4565 const bool uuid_option_set =
4568 const bool frame_option_set =
4570 const bool stack_option_set =
4575 if (uuid_option_set)
4577 else if (file_option_set)
4579 else if (frame_option_set)
4581 else if (stack_option_set)
4584 result.
AppendError(
"one or more symbol file paths must be specified, "
4585 "or options must be specified");
4587 if (uuid_option_set) {
4588 result.
AppendError(
"specify either one or more paths to symbol files "
4589 "or use the --uuid option without arguments");
4590 }
else if (frame_option_set) {
4591 result.
AppendError(
"specify either one or more paths to symbol files "
4592 "or use the --frame option without arguments");
4593 }
else if (file_option_set && argc > 1) {
4594 result.
AppendError(
"specify at most one symbol file path when "
4595 "--shlib option is set");
4599 for (
auto &entry : args.
entries()) {
4600 if (!entry.ref().empty()) {
4602 symbol_file_spec.
SetFile(entry.ref(), FileSpec::Style::native);
4604 if (file_option_set) {
4611 ->ResolveSymbolFile(*target, module_spec, symfile_spec)
4616 bool symfile_exists =
4619 if (symfile_exists) {
4623 std::string resolved_symfile_path =
4625 if (resolved_symfile_path != entry.ref()) {
4627 "invalid module path '%s' with resolved path '%s'\n",
4628 entry.c_str(), resolved_symfile_path.c_str());
4654#pragma mark CommandObjectTargetSymbols
4663 interpreter,
"target symbols",
4664 "Commands for adding and managing debug symbol files.",
4665 "target symbols <sub-command> ...") {
4679#pragma mark CommandObjectTargetStopHookAdd
4682#define LLDB_OPTIONS_target_stop_hook_add
4683#include "CommandOptions.inc"
4695 return llvm::ArrayRef(g_target_stop_hook_add_options);
4701 const int short_option =
4702 g_target_stop_hook_add_options[option_idx].short_option;
4704 switch (short_option) {
4711 if (option_arg.getAsInteger(0,
m_line_end)) {
4712 error.SetErrorStringWithFormat(
"invalid end line number: \"%s\"",
4713 option_arg.str().c_str());
4720 bool value, success;
4725 error.SetErrorStringWithFormat(
4726 "invalid boolean value '%s' passed for -G option",
4727 option_arg.str().c_str());
4731 error.SetErrorStringWithFormat(
"invalid start line number: \"%s\"",
4732 option_arg.str().c_str());
4760 error.SetErrorStringWithFormat(
"invalid thread id string '%s'",
4761 option_arg.str().c_str());
4777 error.SetErrorStringWithFormat(
"invalid thread index string '%s'",
4778 option_arg.str().c_str());
4788 llvm_unreachable(
"Unimplemented option");
4822 eFunctionNameTypeAuto;
4839 "Add a hook to be executed when the target stops."
4840 "The hook can either be a list of commands or an "
4841 "appropriately defined Python class. You can also "
4842 "add filters so the hook only runs a certain stop "
4844 "target stop-hook add"),
4850Command Based stop-hooks:
4851-------------------------
4852 Stop hooks can run a list of lldb commands by providing one or more
4853 --one-line-command options. The commands will get run in the order they are
4854 added. Or you can provide no commands, in which case you will enter a
4855 command editor where you can enter the commands to be run.
4857Python Based Stop Hooks:
4858------------------------
4859 Stop hooks can be implemented with a suitably defined Python class, whose name
4860 is passed in the --python-class option.
4862 When the stop hook is added, the class is initialized by calling:
4864 def __init__(self, target, extra_args, internal_dict):
4866 target: The target that the stop hook is being added to.
4867 extra_args: An SBStructuredData Dictionary filled with the -key -value
4868 option pairs passed to the command.
4869 dict: An implementation detail provided by lldb.
4871 Then when the stop-hook triggers, lldb will run the 'handle_stop' method.
4872 The method has the signature:
4874 def handle_stop(self, exe_ctx, stream):
4876 exe_ctx: An SBExecutionContext for the thread that has stopped.
4877 stream: An SBStream, anything written to this stream will be printed in the
4878 the stop message when the process stops.
4880 Return Value: The method returns "should_stop". If should_stop is false
4881 from all the stop hook executions on threads that stopped
4882 with a reason, then the process will continue. Note that this
4883 will happen only after all the stop hooks are run.
4887 Stop hooks can be set to always run, or to only run when the stopped thread
4888 matches the filter options passed on the command line. The available filter
4889 options include a shared library or a thread or queue specification,
4890 a line range in a source file, a function name or a class name.
4906 if (output_sp && interactive) {
4907 output_sp->PutCString(
4908 "Enter your stop hook command(s). Type 'DONE' to end.\n");
4914 std::string &line)
override {
4919 error_sp->Printf(
"error: stop hook #%" PRIu64
4920 " aborted, no commands.\n",
4933 output_sp->Printf(
"Stop hook #%" PRIu64
" added.\n",
4949 Target::StopHook::StopHookKind::CommandBased
4950 : Target::StopHook::StopHookKind::ScriptBased);
4953 std::unique_ptr<SymbolContextSpecifier> specifier_up;
4955 specifier_up = std::make_unique<SymbolContextSpecifier>(
4959 specifier_up->AddSpecification(
4965 specifier_up->AddSpecification(
4976 specifier_up->AddLineSpecification(
4982 specifier_up->AddLineSpecification(
4987 specifier_up->AddSpecification(
4994 new_hook_sp->SetSpecifier(specifier_up.release());
5014 new_hook_sp->SetThreadSpecifier(thread_spec);
5024 new_hook_sp->GetID());
5032 if (
error.Success())
5034 new_hook_sp->GetID());
5058#pragma mark CommandObjectTargetStopHookDelete
5066 "Delete a stop-hook.",
5067 "target stop-hook delete [<idx>]") {
5086 if (num_args == 0) {
5094 for (
size_t i = 0; i < num_args; i++) {
5112#pragma mark CommandObjectTargetStopHookEnableDisable
5119 bool enable,
const char *name,
5120 const char *help,
const char *syntax)
5142 if (num_args == 0) {
5145 for (
size_t i = 0; i < num_args; i++) {
5167#pragma mark CommandObjectTargetStopHookList
5175 "List all stop-hooks.",
"target stop-hook list") {}
5184 if (num_hooks == 0) {
5187 for (
size_t i = 0; i < num_hooks; i++) {
5199#pragma mark CommandObjectMultiwordTargetStopHooks
5207 interpreter,
"target stop-hook",
5208 "Commands for operating on debugger target stop-hooks.",
5209 "target stop-hook <subcommand> [<subcommand-options>]") {
5217 interpreter,
false,
"target stop-hook disable [<id>]",
5218 "Disable a stop-hook.",
"target stop-hook disable")));
5221 interpreter,
true,
"target stop-hook enable [<id>]",
5222 "Enable a stop-hook.",
"target stop-hook enable")));
5230#pragma mark CommandObjectTargetDumpTypesystem
5237 interpreter,
"target dump typesystem",
5238 "Dump the state of the target's internal type system. Intended to "
5239 "be used for debugging LLDB itself.",
5240 nullptr, eCommandRequiresTarget) {}
5255#pragma mark CommandObjectTargetDumpSectionLoadList
5262 interpreter,
"target dump section-load-list",
5263 "Dump the state of the target's internal section load list. "
5264 "Intended to be used for debugging LLDB itself.",
5265 nullptr, eCommandRequiresTarget) {}
5277#pragma mark CommandObjectTargetDump
5285 interpreter,
"target dump",
5286 "Commands for dumping information about the target.",
5287 "target dump [typesystem|section-load-list]") {
5299#pragma mark CommandObjectMultiwordTarget
5306 "Commands for operating on debugger targets.",
5307 "target <subcommand> [<subcommand-options>]") {
static bool GetSeparateDebugInfoList(StructuredData::Array &list, Module *module, bool errors_only)
static void DumpAddress(ExecutionContextScope *exe_scope, const Address &so_addr, bool verbose, bool all_ranges, Stream &strm, std::optional< Stream::HighlightSettings > settings=std::nullopt)
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)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTargetModulesDumpClangAST() override=default
~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
~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
@ eLookupTypeFunctionOrSymbol
~CommandObjectTargetModulesLookup() override=default
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 DumpValueObject(Stream &s, VariableSP &var_sp, ValueObjectSP &valobj_sp, const char *root_name)
void DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, const VariableList &variable_list, Stream &s)
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 range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
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)
bool Confirm(llvm::StringRef message, bool default_answer)
ExecutionContext GetExecutionContext() const
void GetLLDBCommandsFromIOHandler(const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr)
void PrintWarningsIfNecessary(Stream &s, const std::string &cmd_name)
CommandObjectMultiwordTarget(CommandInterpreter &interpreter)
~CommandObjectMultiwordTarget() override
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
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 AppendErrorWithFormatv(const char *format, Args &&... args)
void void AppendError(llvm::StringRef in_string)
void AppendWarningWithFormat(const char *format,...) __attribute__((format(printf
Stream & GetErrorStream()
void SetStatus(lldb::ReturnStatus status)
void void AppendMessageWithFormatv(const char *format, Args &&... args)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendWarning(llvm::StringRef in_string)
void SetError(const Status &error, const char *fallback_error_cstr=nullptr)
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.
Represents a generic declaration context in a program.
"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
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Target * GetTargetPtr() const
Returns a pointer to the target object.
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
Process * GetProcessPtr() const
Returns a pointer to the process object.
Thread * GetThreadPtr() const
Returns a pointer to the thread 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 Clear()
Clears the object state.
void Dump(llvm::raw_ostream &s) const
Dump this object to a Stream.
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()
A delegate class for use with IOHandler subclasses.
lldb::StreamFileSP GetErrorStreamFileSP()
lldb::StreamFileSP 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
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 the first module whose file specification matches file_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 ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
virtual SymbolFile * GetSymbolFile(bool can_create=true, Stream *feedback_strm=nullptr)
Get the module's symbol file.
ConstString GetObjectName() const
static Module * GetAllocatedModuleAtIndex(size_t idx)
static std::recursive_mutex & GetAllocationModuleCollectionMutex()
bool SetLoadAddress(Target &target, lldb::addr_t value, bool value_is_offset, bool &changed)
Set the load address for all sections in a module to be the file address plus slide.
bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr)
void FindFunctions(const LookupInfo &lookup_info, const CompilerDeclContext &parent_decl_ctx, const ModuleFunctionSearchOptions &options, SymbolContextList &sc_list)
Find functions by lookup info.
bool MatchesModuleSpec(const ModuleSpec &module_ref)
static size_t GetNumberAllocatedModules()
const ArchSpec & GetArchitecture() const
Get const accessor for the module architecture.
virtual SectionList * GetSectionList()
Get the unified section list for the module.
uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, uint32_t line, bool check_inlines, lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list)
Resolve items in the symbol context for a given file and line.
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
void FindTypes(const TypeQuery &query, TypeResults &results)
Find types using a type-matching object that contains all search parameters.
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())
llvm::StringRef GetArchitectureName() const
OptionValueBoolean & GetOptionValue()
OptionValueFileSpecList & GetOptionValue()
OptionValueFileSpec & GetOptionValue()
void Append(OptionGroup *group)
Append options from a OptionGroup class.
const std::string & GetName()
const StructuredData::DictionarySP GetStructuredData()
OptionValueString & GetOptionValue()
OptionValueUInt64 & GetOptionValue()
const OptionValueUUID & GetOptionValue() const
DumpValueObjectOptions GetAsDumpOptions(LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity=eLanguageRuntimeDescriptionDisplayVerbosityFull, lldb::Format format=lldb::eFormatDefault, lldb::TypeSummaryImplSP summary_sp=lldb::TypeSummaryImplSP())
void SetCurrentValue(bool value)
bool GetCurrentValue() const
FileSpecList GetCurrentValue() const
FileSpec & GetCurrentValue()
llvm::StringRef GetCurrentValueAsRef() const
const char * GetCurrentValue() const
uint64_t GetCurrentValue() const
bool OptionWasSet() const
A command line option parsing protocol class.
void GenerateOptionUsage(Stream &strm, CommandObject &cmd, uint32_t screen_width)
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
void Dump(Stream &s, Target *target)
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
bool SetSectionLoadAddress(const lldb::SectionSP §ion_sp, lldb::addr_t load_addr, bool warn_multiple=false)
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.
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.
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
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)
SectionLoadList & GetSectionLoadList()
size_t GetNumStopHooks() const
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 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 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)
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual uint32_t GetStackFrameCount()
GetStackFrameCount can be expensive.
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
void Dump(Stream &s, Thread *thread, lldb::addr_t base_addr) const
A collection of ValueObject values that.
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.
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::StreamFile > StreamFileSP
std::shared_ptr< lldb_private::Variable > VariableSP
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
@ eRegisterKindGeneric
insn ptr reg, stack ptr reg, etc not specific to any particular target
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.