forked from OSchip/llvm-project
Replace pointer to C-array of PropertyDefinition with llvm::ArrayRef
Differential Revision: https://reviews.llvm.org/D52572 llvm-svn: 343181
This commit is contained in:
parent
041e68fe1e
commit
e40db05b27
|
@ -62,7 +62,7 @@ public:
|
|||
void Apropos(llvm::StringRef keyword,
|
||||
std::vector<const Property *> &matching_properties) const;
|
||||
|
||||
void Initialize(const PropertyDefinition *setting_definitions);
|
||||
void Initialize(const PropertyDefinitions &setting_definitions);
|
||||
|
||||
// bool
|
||||
// GetQualifiedName (Stream &strm);
|
||||
|
|
|
@ -32,6 +32,8 @@ struct PropertyDefinition {
|
|||
const char *description;
|
||||
};
|
||||
|
||||
using PropertyDefinitions = llvm::ArrayRef<PropertyDefinition>;
|
||||
|
||||
class Property {
|
||||
public:
|
||||
Property(const PropertyDefinition &definition);
|
||||
|
|
|
@ -278,8 +278,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
{"frame-format-unique", OptionValue::eTypeFormatEntity, true, 0,
|
||||
DEFAULT_FRAME_FORMAT_NO_ARGS, {},
|
||||
"The default frame format string to use when displaying stack frame"
|
||||
"information for threads from thread backtrace unique."},
|
||||
{nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, {}, nullptr}};
|
||||
"information for threads from thread backtrace unique."}};
|
||||
|
||||
enum {
|
||||
ePropertyAutoConfirm = 0,
|
||||
|
|
|
@ -74,8 +74,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
"the UUID of the executable."},
|
||||
{"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
|
||||
{},
|
||||
"The path to the clang modules cache directory (-fmodules-cache-path)."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
"The path to the clang modules cache directory (-fmodules-cache-path)."}};
|
||||
|
||||
enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
|
||||
|
||||
|
|
|
@ -89,8 +89,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
nullptr, {}, "If true, LLDB will stop running a 'command source' "
|
||||
"script upon encountering an error."},
|
||||
{"space-repl-prompts", OptionValue::eTypeBoolean, true, false, nullptr, {},
|
||||
"If true, blank lines will be printed between between REPL submissions."},
|
||||
{nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, {}, nullptr}};
|
||||
"If true, blank lines will be printed between between REPL submissions."}};
|
||||
|
||||
enum {
|
||||
ePropertyExpandRegexAliases = 0,
|
||||
|
|
|
@ -53,9 +53,9 @@ size_t OptionValueProperties::GetNumProperties() const {
|
|||
return m_properties.size();
|
||||
}
|
||||
|
||||
void OptionValueProperties::Initialize(const PropertyDefinition *defs) {
|
||||
for (size_t i = 0; defs[i].name; ++i) {
|
||||
Property property(defs[i]);
|
||||
void OptionValueProperties::Initialize(const PropertyDefinitions &defs) {
|
||||
for (const auto &definition : defs) {
|
||||
Property property(definition);
|
||||
assert(property.IsValid());
|
||||
m_name_to_index.Append(ConstString(property.GetName()), m_properties.size());
|
||||
property.GetValue()->SetParent(shared_from_this());
|
||||
|
|
|
@ -76,8 +76,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
{"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, NULL,
|
||||
OptionEnumValues(g_kaslr_kernel_scan_enum_values),
|
||||
"Control how many reads lldb will make while searching for a Darwin "
|
||||
"kernel on attach."},
|
||||
{NULL, OptionValue::eTypeInvalid, false, 0, NULL, {}, NULL} };
|
||||
"kernel on attach."}};
|
||||
|
||||
enum { ePropertyLoadKexts, ePropertyScanType };
|
||||
|
||||
|
|
|
@ -61,8 +61,7 @@ namespace {
|
|||
|
||||
static constexpr PropertyDefinition g_properties[] = {
|
||||
{"enable-jit-breakpoint", OptionValue::eTypeBoolean, true, true, nullptr,
|
||||
{}, "Enable breakpoint on __jit_debug_register_code."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
{}, "Enable breakpoint on __jit_debug_register_code."}};
|
||||
|
||||
enum { ePropertyEnableJITBreakpoint };
|
||||
|
||||
|
|
|
@ -48,8 +48,7 @@ namespace {
|
|||
|
||||
static constexpr PropertyDefinition g_properties[] = {
|
||||
{"enable", OptionValue::eTypeBoolean, true, true, nullptr, {},
|
||||
"Specify whether goroutines should be treated as threads."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
"Specify whether goroutines should be treated as threads."}};
|
||||
|
||||
enum {
|
||||
ePropertyEnableGoroutines,
|
||||
|
|
|
@ -186,14 +186,13 @@ const char *PlatformDarwinKernel::GetDescriptionStatic() {
|
|||
/// Code to handle the PlatformDarwinKernel settings
|
||||
//------------------------------------------------------------------
|
||||
|
||||
static PropertyDefinition g_properties[] = {
|
||||
static constexpr PropertyDefinition g_properties[] = {
|
||||
{"search-locally-for-kexts", OptionValue::eTypeBoolean, true, true, NULL,
|
||||
{}, "Automatically search for kexts on the local system when doing "
|
||||
"kernel debugging."},
|
||||
{"kext-directories", OptionValue::eTypeFileSpecList, false, 0, NULL, {},
|
||||
"Directories/KDKs to search for kexts in when starting a kernel debug "
|
||||
"session."},
|
||||
{NULL, OptionValue::eTypeInvalid, false, 0, NULL, {}, NULL}};
|
||||
"session."}};
|
||||
|
||||
enum { ePropertySearchForKexts = 0, ePropertyKextDirectories };
|
||||
|
||||
|
|
|
@ -55,10 +55,9 @@ using namespace lldb_private;
|
|||
|
||||
namespace {
|
||||
|
||||
static PropertyDefinition g_properties[] = {
|
||||
static constexpr PropertyDefinition g_properties[] = {
|
||||
{"packet-timeout", OptionValue::eTypeUInt64, true, 5, NULL, {},
|
||||
"Specify the default packet timeout in seconds."},
|
||||
{NULL, OptionValue::eTypeInvalid, false, 0, NULL, {}, NULL}};
|
||||
"Specify the default packet timeout in seconds."}};
|
||||
|
||||
enum { ePropertyPacketTimeout };
|
||||
|
||||
|
|
|
@ -114,8 +114,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
{"packet-timeout", OptionValue::eTypeUInt64, true, 1, NULL, {},
|
||||
"Specify the default packet timeout in seconds."},
|
||||
{"target-definition-file", OptionValue::eTypeFileSpec, true, 0, NULL, {},
|
||||
"The file that provides the description for remote target registers."},
|
||||
{NULL, OptionValue::eTypeInvalid, false, 0, NULL, {}, NULL}};
|
||||
"The file that provides the description for remote target registers."}};
|
||||
|
||||
enum { ePropertyPacketTimeout, ePropertyTargetDefinitionFile };
|
||||
|
||||
|
|
|
@ -133,9 +133,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
"Specify the options to 'plugin structured-data darwin-log enable' "
|
||||
"that should be applied when automatically enabling logging on "
|
||||
"startup/attach." // description
|
||||
},
|
||||
// Last entry sentinel.
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
}};
|
||||
|
||||
enum { ePropertyEnableOnStartup = 0, ePropertyAutoEnableOptions = 1 };
|
||||
|
||||
|
|
|
@ -118,9 +118,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
"links will be resolved at DWARF parse time."},
|
||||
{"ignore-file-indexes", OptionValue::eTypeBoolean, true, 0, nullptr, {},
|
||||
"Ignore indexes present in the object files and always index DWARF "
|
||||
"manually."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr},
|
||||
};
|
||||
"manually."}};
|
||||
|
||||
enum {
|
||||
ePropertySymLinkPaths,
|
||||
|
|
|
@ -71,8 +71,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
{"use-module-cache", OptionValue::eTypeBoolean, true, true, nullptr,
|
||||
{}, "Use module cache."},
|
||||
{"module-cache-directory", OptionValue::eTypeFileSpec, true, 0, nullptr,
|
||||
{}, "Root directory for cached modules."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
{}, "Root directory for cached modules."}};
|
||||
|
||||
enum { ePropertyUseModuleCache, ePropertyModuleCacheDirectory };
|
||||
|
||||
|
|
|
@ -147,8 +147,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
"stepping and variable availability may not behave as expected."},
|
||||
{"stop-on-exec", OptionValue::eTypeBoolean, true, true,
|
||||
nullptr, {},
|
||||
"If true, stop when a shared library is loaded or unloaded."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
"If true, stop when a shared library is loaded or unloaded."}};
|
||||
|
||||
enum {
|
||||
ePropertyDisableMemCache,
|
||||
|
|
|
@ -3352,8 +3352,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
nullptr, {}, "If true, LLDB will show variables that are meant to "
|
||||
"support the operation of a language's runtime support."},
|
||||
{"non-stop-mode", OptionValue::eTypeBoolean, false, 0, nullptr, {},
|
||||
"Disable lock-step debugging, instead control threads independently."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
"Disable lock-step debugging, instead control threads independently."}};
|
||||
|
||||
enum {
|
||||
ePropertyDefaultArch,
|
||||
|
@ -3483,8 +3482,7 @@ static constexpr PropertyDefinition g_experimental_properties[]{
|
|||
"ivars and local variables. "
|
||||
"But it can make expressions run much more slowly."},
|
||||
{"use-modern-type-lookup", OptionValue::eTypeBoolean, true, false, nullptr,
|
||||
{}, "If true, use Clang's modern type lookup infrastructure."},
|
||||
{nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, {}, nullptr}};
|
||||
{}, "If true, use Clang's modern type lookup infrastructure."}};
|
||||
|
||||
enum { ePropertyInjectLocalVars = 0, ePropertyUseModernTypeLookup };
|
||||
|
||||
|
|
|
@ -80,8 +80,7 @@ static constexpr PropertyDefinition g_properties[] = {
|
|||
{"trace-thread", OptionValue::eTypeBoolean, false, false, nullptr, {},
|
||||
"If true, this thread will single-step and log execution."},
|
||||
{"max-backtrace-depth", OptionValue::eTypeUInt64, false, 300000, nullptr,
|
||||
{}, "Maximum number of frames to backtrace."},
|
||||
{nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
|
||||
{}, "Maximum number of frames to backtrace."}};
|
||||
|
||||
enum {
|
||||
ePropertyStepInAvoidsNoDebug,
|
||||
|
|
Loading…
Reference in New Issue