15#include "lldb/Host/Config.h"
36#include "llvm/ADT/STLExtras.h"
84 for (
auto entry : llvm::enumerate(command.
entries().drop_back())) {
85 if (entry.value().ref() !=
"unsigned")
87 auto next = command.
entries()[entry.index() + 1].ref();
88 if (next ==
"int" || next ==
"short" || next ==
"char" || next ==
"long") {
90 "unsigned %s being treated as two types. if you meant the combined "
92 "name use quotes, as in \"unsigned %s\"\n",
93 next.str().c_str(), next.str().c_str());
108 return "synthetic child provider";
113 llvm_unreachable(
"Fully covered switch above!");
116#define LLDB_OPTIONS_type_summary_add
117#include "CommandOptions.inc"
134 return llvm::ArrayRef(g_type_summary_add_options);
163 static const char *g_summary_addreader_instructions =
164 "Enter your Python command(s). Type 'DONE' to end.\n"
165 "def function (valobj,internal_dict):\n"
166 " \"\"\"valobj: an SBValue which you want to provide a summary "
168 " internal_dict: an LLDB support object not to be used\"\"\"\n";
171 if (output_sp && interactive) {
172 output_sp->PutCString(g_summary_addreader_instructions);
178 std::string &data)
override {
181#if LLDB_ENABLE_PYTHON
196 std::string funct_name_str;
199 if (funct_name_str.empty()) {
200 error_sp->Printf(
"unable to obtain a valid function name from "
201 "the script interpreter.\n");
208 script_format = std::make_shared<ScriptSummaryFormat>(
209 options->m_flags, funct_name_str.c_str(),
214 for (
const std::string &type_name : options->m_target_types) {
216 options->m_match_type, options->m_category,
219 error_sp->Printf(
"error: %s",
error.AsCString());
224 if (options->m_name) {
226 options->m_name, script_format, &
error);
229 options->m_name, script_format, &
error);
231 error_sp->Printf(
"error: %s",
error.AsCString());
235 error_sp->Printf(
"error: %s",
error.AsCString());
239 if (
error.AsCString()) {
240 error_sp->Printf(
"error: %s",
error.AsCString());
246 error_sp->Printf(
"error: unable to generate a function.\n");
250 error_sp->Printf(
"error: no script interpreter.\n");
254 error_sp->Printf(
"error: internal synchronization information "
255 "missing or invalid.\n");
259 error_sp->Printf(
"error: empty function, didn't add python command.\n");
264 "error: script interpreter missing, didn't add python command.\n");
283 "Enter your Python command(s). Type 'DONE' to end.\n"
284 "You must define a Python class with these methods:\n"
285 " def __init__(self, valobj, internal_dict):\n"
286 " def num_children(self):\n"
287 " def get_child_at_index(self, index):\n"
288 " def get_child_index(self, name):\n"
289 " def update(self):\n"
291 "class synthProvider:\n";
293#define LLDB_OPTIONS_type_synth_add
294#include "CommandOptions.inc"
311 switch (short_option) {
315 error.SetErrorStringWithFormat(
"invalid value for cascade: %s",
316 option_arg.str().c_str());
336 error.SetErrorString(
337 "can't use --regex and --recognizer-function at the same time");
343 error.SetErrorString(
344 "can't use --regex and --recognizer-function at the same time");
349 llvm_unreachable(
"Unimplemented option");
367 return llvm::ArrayRef(g_type_synth_add_options);
400 result.
AppendError(
"must either provide a children list, a Python class "
401 "name, or use -P and type a Python class "
408 if (output_sp && interactive) {
415 std::string &data)
override {
418#if LLDB_ENABLE_PYTHON
433 std::string class_name_str;
435 if (class_name_str.empty()) {
437 "error: unable to obtain a proper name for the class.\n");
444 synth_provider = std::make_shared<ScriptedSyntheticChildren>(
446 .SetCascades(options->m_cascade)
449 class_name_str.c_str());
453 ConstString(options->m_category.c_str()), category);
457 for (
const std::string &type_name : options->m_target_types) {
458 if (!type_name.empty()) {
460 options->m_match_type, options->m_category,
462 error_sp->Printf(
"error: %s\n",
error.AsCString());
467 error_sp->Printf(
"error: invalid type name.\n");
474 error_sp->Printf(
"error: unable to generate a class.\n");
478 error_sp->Printf(
"error: no script interpreter.\n");
482 error_sp->Printf(
"error: internal synchronization data missing.\n");
486 error_sp->Printf(
"error: empty function, didn't add python command.\n");
491 "error: script interpreter missing, didn't add python command.\n");
511#define LLDB_OPTIONS_type_format_add
512#include "CommandOptions.inc"
523 return llvm::ArrayRef(g_type_format_add_options);
538 const int short_option =
539 g_type_format_add_options[option_idx].short_option;
542 switch (short_option) {
546 error.SetErrorStringWithFormat(
"invalid value for cascade: %s",
547 option_value.str().c_str());
565 llvm_unreachable(
"Unimplemented option");
590 "Add a new formatting style for a type.", nullptr),
596The following examples of 'type format add' refer to this code snippet for context:
599 typedef float Afloat;
601 typedef Afloat Bfloat;
609Adding default formatting:
611(lldb) type format add -f hex AInt
612(lldb) frame variable iy
615 " Produces hexadecimal display of iy, because no formatter is available for Bint and \
616the one for Aint is used instead."
619To prevent this use the cascade option '-C no' to prevent evaluation of typedef chains:
622(lldb) type format add -f hex -C no AInt
624Similar reasoning applies to this:
626(lldb) type format add -f hex -C no float -p
629 " All float values and float references are now formatted as hexadecimal, but not \
630pointers to floats. Nor will it change the default display for Afloat and Bfloat objects.");
663 entry = std::make_shared<TypeFormatImpl_Format>(
669 entry = std::make_shared<TypeFormatImpl_EnumType>(
686 for (
auto &arg_entry : command.
entries()) {
687 if (arg_entry.ref().empty()) {
696 if (!typeRX.IsValid()) {
698 "regex format error (maybe this is not really a regex?)");
702 category_sp->AddTypeFormat(arg_entry.ref(), match_type, entry);
709#define LLDB_OPTIONS_type_formatter_delete
710#include "CommandOptions.inc"
725 switch (short_option) {
736 llvm_unreachable(
"Unimplemented option");
749 return llvm::ArrayRef(g_type_formatter_delete_options);
765 "Delete an existing %s for a type.";
768 "Delete an existing %s for a type. Unless you specify a "
769 "specific category or all categories, only the "
770 "'default' category is searched. The names must be exactly as "
771 "shown in the 'type %s list' output";
791 s.
Printf(
"type %s delete", short_kind);
839 bool delete_category =
false;
840 bool extra_deletion =
false;
858 if (delete_category || extra_deletion) {
866#define LLDB_OPTIONS_type_formatter_clear
867#include "CommandOptions.inc"
882 switch (short_option) {
887 llvm_unreachable(
"Unimplemented option");
898 return llvm::ArrayRef(g_type_formatter_clear_options);
913 const char *name,
const char *help)
968 "Delete all existing format styles.") {}
971#define LLDB_OPTIONS_type_formatter_list
972#include "CommandOptions.inc"
974template <
typename FormatterType>
991 switch (short_option) {
1002 llvm_unreachable(
"Unimplemented option");
1014 return llvm::ArrayRef(g_type_formatter_list_options);
1029 const char *name,
const char *help)
1047 return regex ==
nullptr || s == regex->
GetText() || regex->
Execute(s);
1053 std::unique_ptr<RegularExpression> category_regex;
1054 std::unique_ptr<RegularExpression> formatter_regex;
1057 category_regex = std::make_unique<RegularExpression>(
1059 if (!category_regex->IsValid()) {
1061 "syntax error in category regular expression '%s'",
1069 formatter_regex = std::make_unique<RegularExpression>(arg);
1070 if (!formatter_regex->IsValid()) {
1077 bool any_printed =
false;
1079 auto category_closure =
1080 [&result, &formatter_regex,
1083 "-----------------------\nCategory: %s%s\n-----------------------\n",
1084 category->GetName(), category->IsEnabled() ?
"" :
" (disabled)");
1087 [&result, &formatter_regex,
1091 formatter_regex.get())) {
1094 "%s: %s\n", type_matcher.GetMatchString().GetCString(),
1095 format_sp->GetDescription().c_str());
1099 category->ForEach(print_formatter);
1107 category_closure(category_sp);
1110 [&category_regex, &category_closure](
1113 category_closure(category);
1137 "Show a list of current formats.") {}
1141 uint32_t option_idx, llvm::StringRef option_arg,
1147 switch (short_option) {
1151 error.SetErrorStringWithFormat(
"invalid value for cascade: %s",
1152 option_arg.str().c_str());
1177 error.SetErrorString(
1178 "can't use --regex and --recognizer-function at the same time");
1184 error.SetErrorString(
1185 "can't use --regex and --recognizer-function at the same time");
1210 llvm_unreachable(
"Unimplemented option");
1218 m_flags.
Clear().SetCascades().SetDontShowChildren().SetDontShowValue(
false);
1219 m_flags.SetShowMembersOneLiner(
false)
1220 .SetSkipPointers(
false)
1221 .SetSkipReferences(
false)
1222 .SetHideItemNames(
false);
1226 m_python_script =
"";
1227 m_python_function =
"";
1228 m_format_string =
"";
1229 m_is_add_script =
false;
1230 m_category =
"default";
1233#if LLDB_ENABLE_PYTHON
1251 if (!funct_name || !funct_name[0]) {
1259 script_format = std::make_shared<ScriptSummaryFormat>(
1266 "The provided function \"%s\" does not exist - "
1267 "please define it before attempting to use this summary.\n",
1274 result.
AppendError(
"script interpreter missing - unable to generate "
1275 "function wrapper.\n");
1280 std::string funct_name_str;
1282 result.
AppendError(
"unable to generate function wrapper.\n");
1285 if (funct_name_str.empty()) {
1287 "script interpreter failed to generate a valid function name.\n");
1293 script_format = std::make_shared<ScriptSummaryFormat>(
1297 auto options = std::make_unique<ScriptAddOptions>(
1301 for (
auto &entry : command.
entries()) {
1302 if (entry.ref().empty()) {
1303 result.
AppendError(
"empty typenames not allowed");
1307 options->m_target_types << std::string(entry.ref());
1325 for (
auto &entry : command.
entries()) {
1338 result.
AppendError(
"added to types, but not given a name");
1360 result.
AppendError(
"empty summary strings not allowed");
1369 if (strcmp(format_cstr,
"${var%S}") == 0) {
1370 result.
AppendError(
"recursive summary not allowed");
1374 std::unique_ptr<StringSummaryFormat> string_format(
1376 if (!string_format) {
1380 if (string_format->m_error.Fail()) {
1382 string_format->m_error.AsCString(
"<unknown>"));
1389 for (
auto &arg_entry : command.
entries()) {
1390 if (arg_entry.ref().empty()) {
1391 result.
AppendError(
"empty typenames not allowed");
1409 result.
AppendError(
"added to types, but not given a name");
1421 "Add a new summary style for a type.", nullptr),
1427The following examples of 'type summary add' refer to this code snippet for context:
1433 JustADemo(int p = 1, float v = 0.1) : ptr(new int(p)), value(v) {}
1435 JustADemo demo_instance(42, 3.14);
1437 typedef JustADemo NewDemo;
1438 NewDemo new_demo_instance(42, 3.14);
1440(lldb) type summary add --summary-string "the answer is ${*var.ptr}" JustADemo
1442 Subsequently displaying demo_instance with 'frame variable' or 'expression' will display "the answer is 42"
1444(lldb) type summary add --summary-string "the answer is ${*var.ptr}, and the question is ${var.value}" JustADemo
1446 Subsequently displaying demo_instance with 'frame variable' or 'expression' will display "the answer is 42 and the question is 3.14"
1449 "Alternatively, you could define formatting for all pointers to integers and \
1450rely on that when formatting JustADemo to obtain the same result:"
1453(lldb) type summary add --summary-string "${var%V} -> ${*var}" "int *"
1454(lldb) type summary add --summary-string "the answer is ${var.ptr}, and the question is ${var.value}" JustADemo
1457 "Type summaries are automatically applied to derived typedefs, so the examples \
1458above apply to both JustADemo and NewDemo. The cascade option can be used to \
1459suppress this behavior:"
1462(lldb) type summary add --summary-string "${var.ptr}, ${var.value},{${var.byte}}" JustADemo -C no
1464 The summary will now be used for values of JustADemo but not NewDemo.
1467 "By default summaries are shown for pointers and references to values of the \
1468specified type. To suppress formatting for pointers use the -p option, or apply \
1469the corresponding -r option to suppress formatting for references:"
1472(lldb) type summary add -p -r --summary-string "${var.ptr}, ${var.value},{${var.byte}}" JustADemo
1475 "One-line summaries including all fields in a type can be inferred without supplying an \
1476explicit summary string by passing the -c option:"
1479(lldb) type summary add -c JustADemo
1480(lldb) frame variable demo_instance
1481(ptr=<address>, value=3.14)
1484 "Type summaries normally suppress the nested display of individual fields. To \
1485supply a summary to supplement the default structure add the -e option:"
1488(lldb) type summary add -e --summary-string "*ptr = ${*var.ptr}" JustADemo
1491 "Now when displaying JustADemo values the int* is displayed, followed by the \
1492standard LLDB sequence of children, one per line:"
1501 "You can also add summaries written in Python. These scripts use lldb public API to \
1502gather information from your variables and produce a meaningful summary. To start a \
1503multi-line script use the -P option. The function declaration will be displayed along with \
1504a comment describing the two arguments. End your script with the word 'DONE' on a line by \
1508(lldb) type summary add JustADemo -P
1509def function (valobj,internal_dict):
"""valobj: an SBValue which you want to provide a summary for
1510internal_dict: an LLDB support object not to be used"""
1511 value = valobj.GetChildMemberWithName('value');
1512 return 'My value is ' + value.GetValue();
1515Alternatively, the -o option can be used when providing a simple one-line Python script:
1517(lldb) type summary add JustADemo -o "value = valobj.GetChildMemberWithName('value'); return 'My value is ' + value.GetValue();")");
1525#if LLDB_ENABLE_PYTHON
1539 if (type_name_ref.ends_with(
"[]")) {
1540 std::string type_name_str(type_name.
GetCString());
1541 type_name_str.resize(type_name_str.length() - 2);
1542 if (type_name_str.back() !=
' ')
1543 type_name_str.append(
" ?\\[[0-9]+\\]");
1545 type_name_str.append(
"\\[[0-9]+\\]");
1563 std::string category_name,
1577 if (!typeRX.IsValid()) {
1579 error->SetErrorString(
1580 "regex format error (maybe this is not really a regex?)");
1586 const char *function_name = type_name.
AsCString();
1589 error->SetErrorStringWithFormat(
1590 "The provided recognizer function \"%s\" does not exist - "
1591 "please define it before attempting to use this summary.\n",
1596 category->AddTypeSummary(type_name.
GetStringRef(), match_type, entry);
1622 "type summary clear",
1623 "Delete all existing summaries.") {}
1638 "Show a list of current summaries.") {}
1649 summary_sp->GetDescription().c_str());
1659#define LLDB_OPTIONS_type_category_define
1660#include "CommandOptions.inc"
1663 class CommandOptions :
public Options {
1676 switch (short_option) {
1684 llvm_unreachable(
"Unimplemented option");
1696 return llvm::ArrayRef(g_type_category_define_options);
1712 "Define a new category as a source of formatters.",
1729 for (
auto &entry : command.
entries()) {
1746#define LLDB_OPTIONS_type_category_enable
1747#include "CommandOptions.inc"
1750 class CommandOptions :
public Options {
1761 switch (short_option) {
1763 if (!option_arg.empty()) {
1766 error.SetErrorStringWithFormat(
"unrecognized language '%s'",
1767 option_arg.str().c_str());
1771 llvm_unreachable(
"Unimplemented option");
1782 return llvm::ArrayRef(g_type_category_enable_options);
1797 "Enable a category as a source of formatters.",
1816 }
else if (argc > 0) {
1817 for (
int i = argc - 1; i >= 0; i--) {
1822 result.
AppendError(
"empty category name not allowed");
1828 if (cate->GetCount() == 0) {
1848 "Delete a category and all associated formatters.",
1865 bool success =
true;
1868 for (
int i = argc - 1; i >= 0; i--) {
1873 result.
AppendError(
"empty category name not allowed");
1888#define LLDB_OPTIONS_type_category_disable
1889#include "CommandOptions.inc"
1892 class CommandOptions :
public Options {
1903 switch (short_option) {
1905 if (!option_arg.empty()) {
1908 error.SetErrorStringWithFormat(
"unrecognized language '%s'",
1909 option_arg.str().c_str());
1913 llvm_unreachable(
"Unimplemented option");
1924 return llvm::ArrayRef(g_type_category_disable_options);
1939 "Disable a category as a source of formatters.",
1958 }
else if (argc > 0) {
1960 for (
int i = argc - 1; i >= 0; i--) {
1965 result.
AppendError(
"empty category name not allowed");
1985 "Provide a list of all existing categories.",
2006 std::unique_ptr<RegularExpression> regex;
2010 regex = std::make_unique<RegularExpression>(arg);
2011 if (!regex->IsValid()) {
2013 "syntax error in category regular expression '%s'", arg);
2016 }
else if (argc != 0) {
2026 if (regex->GetText() == category_sp->GetName()) {
2028 }
else if (regex->Execute(category_sp->GetName())) {
2037 "Category: %s\n", category_sp->GetDescription().c_str());
2053 "Show a list of current filters.") {}
2063 interpreter,
"type synthetic list",
2064 "Show a list of current synthetic providers.") {}
2096 "type filter clear",
2097 "Delete all existing filter.") {}
2107 "Delete all existing synthetic providers.") {}
2112 auto options = std::make_unique<SynthAddOptions>(
2116 for (
auto &entry : command.
entries()) {
2117 if (entry.ref().empty()) {
2118 result.
AppendError(
"empty typenames not allowed");
2122 options->m_target_types << std::string(entry.ref());
2146 "directly input Python code.\n",
2166 result.
AppendWarning(
"The provided class does not exist - please define it "
2167 "before attempting to use this synthetic provider");
2177 for (
auto &arg_entry : command.
entries()) {
2178 if (arg_entry.ref().empty()) {
2179 result.
AppendError(
"empty typenames not allowed");
2198 "Add a new synthetic provider for a type.", nullptr),
2206 std::string category_name,
2229 error->SetErrorStringWithFormat(
"cannot add synthetic for type %s when "
2230 "filter is defined in same category!",
2238 if (!typeRX.IsValid()) {
2240 error->SetErrorString(
2241 "regex format error (maybe this is not really a regex?)");
2247 const char *function_name = type_name.
AsCString();
2250 error->SetErrorStringWithFormat(
2251 "The provided recognizer function \"%s\" does not exist - "
2252 "please define it before attempting to use this summary.\n",
2258 category->AddTypeSynthetic(type_name.
GetStringRef(), match_type, entry);
2262#define LLDB_OPTIONS_type_filter_add
2263#include "CommandOptions.inc"
2281 switch (short_option) {
2285 error.SetErrorStringWithFormat(
"invalid value for cascade: %s",
2286 option_arg.str().c_str());
2305 llvm_unreachable(
"Unimplemented option");
2322 return llvm::ArrayRef(g_type_filter_add_options);
2370 error->SetErrorStringWithFormat(
"cannot add filter for type %s when "
2371 "synthetic is defined in same "
2384 error->SetErrorString(
2385 "regex format error (maybe this is not really a regex?)");
2389 category->AddTypeFilter(type_name.
GetStringRef(), match_type, entry);
2396 "Add a new filter for a type.", nullptr) {
2401The following examples of 'type filter add' refer to this code snippet for context:
2416Adding a simple filter:
2418(lldb) type filter add --child a --child g Foo
2419(lldb) frame variable my_foo
2422 "Produces output where only a and g are displayed. Other children of my_foo \
2423(b, c, d, e, f, h and i) are available by asking for them explicitly:"
2426(lldb) frame variable my_foo.b my_foo.c my_foo.i
2429 "The formatting option --raw on frame variable bypasses the filter, showing \
2430all children of my_foo as if no filter was defined:"
2433(lldb) frame variable my_foo --raw)");
2465 entry->AddExpressionPath(*begin);
2477 for (
auto &arg_entry : command.
entries()) {
2478 if (arg_entry.ref().empty()) {
2479 result.
AppendError(
"empty typenames not allowed");
2497#define LLDB_OPTIONS_type_lookup
2498#include "CommandOptions.inc"
2529 return llvm::ArrayRef(g_type_lookup_options);
2536 const int short_option = g_type_lookup_options[option_idx].short_option;
2538 switch (short_option) {
2548 llvm_unreachable(
"Unimplemented option");
2571 "Lookup types and declarations in the current target, "
2572 "following language-specific naming conventions.",
2573 "type lookup <type-specifier>",
2574 eCommandRequiresTarget) {
2590 stream.
Printf(
"%s\n", help);
2598 void DoExecute(llvm::StringRef raw_command_line,
2600 if (raw_command_line.empty()) {
2602 "type lookup cannot be invoked without a type name as argument");
2610 const char *name_of_type = args.GetRawPart().c_str();
2619 bool any_found =
false;
2621 std::vector<Language *> languages;
2623 bool is_global_search =
false;
2626 if ((is_global_search =
2629 languages.push_back(lang);
2643 languages.begin(), languages.end(),
2645 if (!lang1 || !lang2)
2647 LanguageType lt1 = lang1->GetLanguageType();
2648 LanguageType lt2 = lang2->GetLanguageType();
2649 if (lt1 == guessed_language)
2651 if (lt2 == guessed_language)
2658 bool is_first_language =
true;
2664 if (
auto scavenger = language->GetTypeScavenger()) {
2666 if (scavenger->Find(best_scope, name_of_type, search_results) > 0) {
2667 for (
const auto &search_result : search_results) {
2668 if (search_result && search_result->IsValid()) {
2671 this->m_command_options.m_show_help);
2677 if (any_found && is_global_search)
2679 else if (is_first_language && is_global_search &&
2681 is_first_language =
false;
2683 "no type was found in the current language %s matching '%s'; "
2684 "performing a global search across all languages\n",
2698template <
typename FormatterType>
2701 typedef std::function<
typename FormatterType::SharedPointer(
ValueObject &)>
2704 const char *formatter_name,
2710 name.
Printf(
"type %s info", formatter_name);
2713 help.
Printf(
"This command evaluates the provided expression and shows "
2714 "which %s is applied to the resulting value (if any).",
2718 syntax.
Printf(
"type %s info <expr>", formatter_name);
2739 command, frame_sp.get(), result_valobj_sp, options);
2742 result_valobj_sp->GetQualifiedRepresentationIfAvailable(
2743 target_sp->GetPreferDynamicValue(),
2744 target_sp->GetEnableSyntheticValue());
2745 typename FormatterType::SharedPointer formatter_sp =
2748 std::string description(formatter_sp->GetDescription());
2751 << result_valobj_sp->GetDisplayTypeName().AsCString(
"<unknown>")
2752 <<
") " << command <<
" is: " << description <<
"\n";
2757 << result_valobj_sp->GetDisplayTypeName().AsCString(
"<unknown>")
2758 <<
") " << command <<
"\n";
2762 result.
AppendError(
"failed to evaluate expression");
2775 interpreter,
"type format",
2776 "Commands for customizing value display formats.",
2777 "type format [<sub-command-options>] ") {
2788 interpreter,
"format",
2801 interpreter,
"type synthetic",
2802 "Commands for operating on synthetic type representations.",
2803 "type synthetic [<sub-command-options>] ") {
2815 interpreter,
"synthetic",
2828 "Commands for operating on type filters.",
2829 "type filter [<sub-command-options>] ") {
2847 "Commands for operating on type categories.",
2848 "type category [<sub-command-options>] ") {
2872 interpreter,
"type summary",
2873 "Commands for editing variable summary display options.",
2874 "type summary [<sub-command-options>] ") {
2885 interpreter,
"summary",
2898 "Commands for operating on the type system.",
2899 "type [<sub-command-options>]") {
static const char * g_synth_addreader_instructions
static bool WarnOnPotentialUnquotedUnsignedType(Args &command, CommandReturnObject &result)
const char * FormatCategoryToString(FormatCategoryItem item, bool long_name)
static bool FixArrayTypeNameWithRegex(ConstString &type_name)
static llvm::raw_ostream & error(Stream &strm)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
OptionValueLanguage m_cate_language
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
OptionValueBoolean m_define_enabled
Options * GetOptions() override
~CommandObjectTypeCategoryDefine() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTypeCategoryDelete() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
lldb::LanguageType m_language
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
~CommandOptions() override=default
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTypeCategoryDisable() override=default
~CommandOptions() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
lldb::LanguageType m_language
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTypeCategoryEnable() override=default
Options * GetOptions() 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,...
~CommandObjectTypeCategoryList() override=default
~CommandObjectTypeCategory() override=default
option_vector m_expr_paths
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
std::vector< std::string > option_vector
option_vector::iterator ExpressionPathsIterator
~CommandOptions() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandObjectTypeFilterAdd() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
bool AddFilter(ConstString type_name, TypeFilterImplSP entry, FilterFormatType type, std::string category_name, Status *error)
~CommandObjectTypeFilterDelete() override=default
~CommandObjectTypeFilter() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
lldb::LanguageType m_language
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override
OptionGroupOptions m_option_group
void DoExecute(llvm::StringRef raw_command_line, CommandReturnObject &result) override
lldb::LanguageType GuessLanguage(StackFrame *frame)
~CommandObjectTypeLookup() override=default
llvm::StringRef GetHelpLong() override
Options * GetOptions() override
CommandOptions m_command_options
void OptionParsingStarting(ExecutionContext *execution_context) override
std::string m_python_script
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
std::string m_python_function
~CommandOptions() override=default
CommandOptions(CommandInterpreter &interpreter)
TypeSummaryImpl::Flags m_flags
FormatterMatchType m_match_type
std::string m_format_string
~CommandObjectTypeSummaryAdd() override=default
Options * GetOptions() override
bool Execute_ScriptSummary(Args &command, CommandReturnObject &result)
void DoExecute(Args &command, CommandReturnObject &result) override
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override
bool Execute_StringSummary(Args &command, CommandReturnObject &result)
CommandObjectTypeSummaryAdd(CommandInterpreter &interpreter)
void IOHandlerInputComplete(IOHandler &io_handler, std::string &data) override
Called when a line or lines have been retrieved.
bool AddNamedSummary(ConstString summary_name, lldb::TypeSummaryImplSP entry, Status *error=nullptr)
bool AddSummary(ConstString type_name, lldb::TypeSummaryImplSP entry, FormatterMatchType match_type, std::string category, Status *error=nullptr)
void FormatterSpecificDeletion() override
~CommandObjectTypeSummaryDelete() override=default
bool FormatterSpecificDeletion(ConstString typeCS) override
bool FormatterSpecificList(CommandReturnObject &result) override
~CommandObjectTypeSummary() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
FormatterMatchType m_match_type
void IOHandlerInputComplete(IOHandler &io_handler, std::string &data) override
Called when a line or lines have been retrieved.
CommandObjectTypeSynthAdd(CommandInterpreter &interpreter)
bool Execute_PythonClass(Args &command, CommandReturnObject &result)
bool AddSynth(ConstString type_name, lldb::SyntheticChildrenSP entry, FormatterMatchType match_type, std::string category_name, Status *error)
Options * GetOptions() override
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectTypeSynthAdd() override=default
bool Execute_HandwritePython(Args &command, CommandReturnObject &result)
~CommandObjectTypeSynthDelete() override=default
~CommandObjectTypeSynth() override=default
StringList m_target_types
std::shared_ptr< ScriptAddOptions > SharedPointer
TypeSummaryImpl::Flags m_flags
ScriptAddOptions(const TypeSummaryImpl::Flags &flags, FormatterMatchType match_type, ConstString name, std::string catg)
FormatterMatchType m_match_type
FormatterMatchType m_match_type
StringList m_target_types
std::shared_ptr< SynthAddOptions > SharedPointer
SynthAddOptions(bool sptr, bool sref, bool casc, FormatterMatchType match_type, std::string catg)
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
llvm::ArrayRef< ArgEntry > entries() const
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
ExecutionContext GetExecutionContext() const
void GetPythonCommandsFromIOHandler(const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr)
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectType(CommandInterpreter &interpreter)
~CommandObjectType() override
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result, OptionGroupOptions &group_options, ExecutionContext &exe_ctx)
ExecutionContext m_exe_ctx
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
Thread * GetDefaultThread()
std::string m_cmd_help_long
void SetSyntax(llvm::StringRef str)
void SetCommandName(llvm::StringRef name)
virtual void SetHelp(llvm::StringRef str)
void void AppendError(llvm::StringRef in_string)
void AppendWarningWithFormat(const char *format,...) __attribute__((format(printf
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendWarning(llvm::StringRef in_string)
Stream & GetOutputStream()
"lldb/Utility/ArgCompletionRequest.h"
size_t GetCursorIndex() const
A uniqued constant string class.
void SetCString(const char *cstr)
Set the C string value.
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
void SetString(llvm::StringRef s)
const char * GetCString() const
Get the string value as a C string.
static bool Delete(ConstString category)
static void Disable(ConstString category)
static void DisableStar()
static void ForEach(TypeCategoryMap::ForEachCallback callback)
static void Enable(ConstString category, TypeCategoryMap::Position=TypeCategoryMap::Default)
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
lldb::TargetSP GetSelectedTarget()
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
"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.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
ValueType Clear(ValueType mask=~static_cast< ValueType >(0))
Clear one or more flags.
lldb::StreamFileSP GetErrorStreamFileSP()
lldb::StreamFileSP GetOutputStreamFileSP()
std::set< std::unique_ptr< Result > > ResultSet
static Language * FindPlugin(lldb::LanguageType language)
static const char * GetNameForLanguageType(lldb::LanguageType language)
virtual const char * GetLanguageSpecificTypeLookupHelp()
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
static void ForEach(std::function< bool(Language *)> callback)
lldb::LanguageType GuessLanguage() const
Try to guess the language from the mangling.
void Append(OptionGroup *group)
Append options from a OptionGroup class.
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
bool GetCurrentValue() const
lldb::LanguageType GetCurrentValue() const
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
llvm::StringRef GetCurrentValueAsRef() const
Status SetCurrentValue(llvm::StringRef value)
bool OptionWasSet() const
A pair of an option list with a 'raw' string as a suffix.
A command line option parsing protocol class.
void NotifyOptionParsingStarting(ExecutionContext *execution_context)
std::vector< Option > m_getopt_table
bool IsValid() const
Test if this object contains a valid regular expression.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
llvm::StringRef GetText() const
Access the regular expression text.
virtual bool GenerateTypeScriptFunction(const char *oneliner, std::string &output, const void *name_token=nullptr)
virtual bool GenerateTypeSynthClass(StringList &input, std::string &output, const void *name_token=nullptr)
virtual bool CheckObjectExists(const char *name)
const char * GetPythonClassName()
This base class provides an interface to stack frames.
SourceLanguage GuessLanguage()
Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information i...
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
const char * GetData() const
llvm::StringRef GetString() const
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.
std::string CopyList(const char *item_preamble=nullptr, const char *items_sep="\n") const
size_t SplitIntoLines(const std::string &lines)
Symbol * symbol
The Symbol for a given query.
Flags & SetSkipReferences(bool value=true)
Flags & SetSkipPointers(bool value=true)
std::shared_ptr< SyntheticChildren > SharedPointer
lldb::StackFrameSP GetSelectedFrame(SelectMostRelevant select_most_relevant)
static const Position Default
Class for matching type names.
ConstString GetMatchString() const
Returns the underlying match string for this TypeMatcher.
Flags & SetCascades(bool value=true)
Flags & SetHideEmptyAggregates(bool value=true)
bool GetShowMembersOneLiner() const
Flags & SetSkipPointers(bool value=true)
Flags & SetHideItemNames(bool value=true)
Flags & SetDontShowChildren(bool value=true)
Flags & SetSkipReferences(bool value=true)
Flags & SetShowMembersOneLiner(bool value=true)
Flags & SetDontShowValue(bool value=true)
std::shared_ptr< TypeSummaryImpl > SharedPointer
lldb::TypeFormatImplSP GetValueFormat()
lldb::TypeSummaryImplSP GetSummaryFormat()
lldb::SyntheticChildrenSP GetSyntheticChildren()
@ DoNoSelectMostRelevantFrame
A class that represents a running process on the host machine.
std::vector< OptionArgElement > OptionElementVector
FormatCategoryItem
Format category entry types.
@ eFormatCategoryItemFormat
@ eFormatCategoryItemSynth
@ eFormatCategoryItemSummary
@ eFormatCategoryItemFilter
@ eTypeCategoryNameCompletion
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::TypeFormatImpl > TypeFormatImplSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Format
Display format definitions.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
FormatterMatchType
Type of match to be performed when looking for a formatter for a data type.
@ eFormatterMatchCallback
ExpressionResults
The results of expression evaluation.
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
std::shared_ptr< lldb_private::StreamFile > StreamFileSP
std::shared_ptr< lldb_private::SyntheticChildren > SyntheticChildrenSP
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
std::shared_ptr< lldb_private::TypeFilterImpl > TypeFilterImplSP
std::shared_ptr< lldb_private::Target > TargetSP
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)
lldb::LanguageType AsLanguageType() const