LLDB  mainline
Classes | Functions | Variables
CommandObjectType.cpp File Reference
#include "CommandObjectType.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/IOHandler.h"
#include "lldb/DataFormatters/DataVisualization.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/OptionValueLanguage.h"
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadList.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
#include <cctype>
#include <functional>
#include <memory>
Include dependency graph for CommandObjectType.cpp:

Go to the source code of this file.

Classes

class  ScriptAddOptions
 
class  SynthAddOptions
 
class  CommandObjectTypeSummaryAdd
 
class  CommandObjectTypeSynthAdd
 
class  CommandObjectTypeFormatAdd
 
class  CommandObjectTypeFormatterDelete
 
class  CommandObjectTypeFormatterDelete::CommandOptions
 
class  CommandObjectTypeFormatterClear
 
class  CommandObjectTypeFormatDelete
 
class  CommandObjectTypeFormatClear
 
class  CommandObjectTypeFormatterList< FormatterType >
 
class  CommandObjectTypeFormatList
 
class  CommandObjectTypeSummaryDelete
 
class  CommandObjectTypeSummaryClear
 
class  CommandObjectTypeSummaryList
 
class  CommandObjectTypeCategoryDefine
 
class  CommandObjectTypeCategoryEnable
 
class  CommandObjectTypeCategoryDelete
 
class  CommandObjectTypeCategoryDisable
 
class  CommandObjectTypeCategoryList
 
class  CommandObjectTypeFilterList
 
class  CommandObjectTypeSynthList
 
class  CommandObjectTypeFilterDelete
 
class  CommandObjectTypeSynthDelete
 
class  CommandObjectTypeFilterClear
 
class  CommandObjectTypeSynthClear
 
class  CommandObjectTypeFilterAdd
 
class  CommandObjectTypeLookup
 
class  CommandObjectTypeLookup::CommandOptions
 
class  CommandObjectFormatterInfo< FormatterType >
 
class  CommandObjectTypeFormat
 
class  CommandObjectTypeSynth
 
class  CommandObjectTypeFilter
 
class  CommandObjectTypeCategory
 
class  CommandObjectTypeSummary
 

Functions

static bool WarnOnPotentialUnquotedUnsignedType (Args &command, CommandReturnObject &result)
 
static bool FixArrayTypeNameWithRegex (ConstString &type_name)
 

Variables

static constexpr OptionDefinition g_type_summary_add_options []
 
static const char * g_synth_addreader_instructions
 
static constexpr OptionDefinition g_type_synth_add_options []
 
static constexpr OptionDefinition g_type_format_add_options []
 
static constexpr OptionDefinition g_type_formatter_delete_options []
 
static constexpr OptionDefinition g_type_formatter_clear_options []
 
static constexpr OptionDefinition g_type_formatter_list_options []
 
static constexpr OptionDefinition g_type_category_define_options []
 
static constexpr OptionDefinition g_type_category_enable_options []
 
OptionDefinition constexpr g_type_category_disable_options []
 
static constexpr OptionDefinition g_type_filter_add_options []
 
static constexpr OptionDefinition g_type_lookup_options []
 

Function Documentation

◆ FixArrayTypeNameWithRegex()

static bool FixArrayTypeNameWithRegex ( ConstString type_name)
static

◆ WarnOnPotentialUnquotedUnsignedType()

static bool WarnOnPotentialUnquotedUnsignedType ( Args command,
CommandReturnObject result 
)
static

Variable Documentation

◆ g_synth_addreader_instructions

const char* g_synth_addreader_instructions
static
Initial value:
=
"Enter your Python command(s). Type 'DONE' to end.\n"
"You must define a Python class with these methods:\n"
" def __init__(self, valobj, dict):\n"
" def num_children(self):\n"
" def get_child_at_index(self, index):\n"
" def get_child_index(self, name):\n"
" def update(self):\n"
" '''Optional'''\n"
"class synthProvider:\n"

Definition at line 289 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeSynthAdd::IOHandlerActivated().

◆ g_type_category_define_options

constexpr OptionDefinition g_type_category_define_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "enabled", 'e', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "If specified, this category will be created enabled." },
{ LLDB_OPT_SET_ALL, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Specify the language that this category is supported for." }
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 1769 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeSummaryList::FormatterSpecificList().

◆ g_type_category_disable_options

OptionDefinition constexpr g_type_category_disable_options[]
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Enable the category for this language." }
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 2047 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeCategoryDelete::DoExecute().

◆ g_type_category_enable_options

constexpr OptionDefinition g_type_category_enable_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Enable the category for this language." },
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 1874 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeCategoryDefine::DoExecute().

◆ g_type_filter_add_options

constexpr OptionDefinition g_type_filter_add_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "cascade", 'C', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, cascade through typedef chains." },
{ LLDB_OPT_SET_ALL, false, "skip-pointers", 'p', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for pointers-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "skip-references", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for references-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "category", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Add this to the given category instead of the default one." },
{ LLDB_OPT_SET_ALL, false, "child", 'c', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeExpressionPath, "Include this expression path in the synthetic view." },
{ LLDB_OPT_SET_ALL, false, "regex", 'x', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Type names are actually regular expressions." }
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 2457 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeSynthAdd::AddSynth().

◆ g_type_format_add_options

constexpr OptionDefinition g_type_format_add_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "category", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Add this to the given category instead of the default one." },
{ LLDB_OPT_SET_ALL, false, "cascade", 'C', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, cascade through typedef chains." },
{ LLDB_OPT_SET_ALL, false, "skip-pointers", 'p', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for pointers-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "skip-references", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for references-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "regex", 'x', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Type names are actually regular expressions." },
{ LLDB_OPT_SET_2, false, "type", 't', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Format variables as if they were of this type." }
}
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 528 of file CommandObjectType.cpp.

◆ g_type_formatter_clear_options

constexpr OptionDefinition g_type_formatter_clear_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "all", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Clear every category." }
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 893 of file CommandObjectType.cpp.

◆ g_type_formatter_delete_options

constexpr OptionDefinition g_type_formatter_delete_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_1, false, "all", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Delete from every category." },
{ LLDB_OPT_SET_2, false, "category", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Delete from given category." },
{ LLDB_OPT_SET_3, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Delete from given language's category." }
}
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 751 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeFormatterDelete::CommandOptions::GetDefinitions().

◆ g_type_formatter_list_options

constexpr OptionDefinition g_type_formatter_list_options[]
static
Initial value:
= {
{LLDB_OPT_SET_1, false, "category-regex", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Only show categories matching this filter."},
{LLDB_OPT_SET_2, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Only show the category for a specific language."}
}
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 1007 of file CommandObjectType.cpp.

◆ g_type_lookup_options

constexpr OptionDefinition g_type_lookup_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "show-help", 'h', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Display available help for types" },
{ LLDB_OPT_SET_ALL, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeLanguage, "Which language's types should the search scope be" }
}
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 2710 of file CommandObjectType.cpp.

Referenced by CommandObjectTypeFilterAdd::DoExecute().

◆ g_type_summary_add_options

constexpr OptionDefinition g_type_summary_add_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "category", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Add this to the given category instead of the default one." },
{ LLDB_OPT_SET_ALL, false, "cascade", 'C', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, cascade through typedef chains." },
{ LLDB_OPT_SET_ALL, false, "no-value", 'v', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't show the value, just show the summary, for this type." },
{ LLDB_OPT_SET_ALL, false, "skip-pointers", 'p', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for pointers-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "skip-references", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for references-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "regex", 'x', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Type names are actually regular expressions." },
{ LLDB_OPT_SET_1, true, "inline-children", 'c', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "If true, inline all child values into summary string." },
{ LLDB_OPT_SET_1, false, "omit-names", 'O', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "If true, omit value names in the summary display." },
{ LLDB_OPT_SET_2, true, "summary-string", 's', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeSummaryString, "Summary string used to display text and object contents." },
{ LLDB_OPT_SET_3, false, "python-script", 'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonScript, "Give a one-liner Python script as part of the command." },
{ LLDB_OPT_SET_3, false, "python-function", 'F', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonFunction, "Give the name of a Python function to use for this type." },
{ LLDB_OPT_SET_3, false, "input-python", 'P', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Input Python code to use for this type manually." },
{ LLDB_OPT_SET_2 | LLDB_OPT_SET_3, false, "expand", 'e', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Expand aggregate data types to show children on separate lines." },
{ LLDB_OPT_SET_2 | LLDB_OPT_SET_3, false, "hide-empty", 'h', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Do not expand aggregate data types with no children." },
{ LLDB_OPT_SET_2 | LLDB_OPT_SET_3, false, "name", 'n', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "A name for this summary string." }
}
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110
#define LLDB_OPT_SET_1
Definition: lldb-defines.h:111

Definition at line 98 of file CommandObjectType.cpp.

◆ g_type_synth_add_options

constexpr OptionDefinition g_type_synth_add_options[]
static
Initial value:
= {
{ LLDB_OPT_SET_ALL, false, "cascade", 'C', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeBoolean, "If true, cascade through typedef chains." },
{ LLDB_OPT_SET_ALL, false, "skip-pointers", 'p', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for pointers-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "skip-references", 'r', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Don't use this format for references-to-type objects." },
{ LLDB_OPT_SET_ALL, false, "category", 'w', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeName, "Add this to the given category instead of the default one." },
{ LLDB_OPT_SET_2, false, "python-class", 'l', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypePythonClass, "Use this Python class to produce synthetic children." },
{ LLDB_OPT_SET_3, false, "input-python", 'P', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Type Python code to generate a class that provides synthetic children." },
{ LLDB_OPT_SET_ALL, false, "regex", 'x', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Type names are actually regular expressions." }
}
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_OPT_SET_ALL
Definition: lldb-defines.h:110

Definition at line 300 of file CommandObjectType.cpp.