summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp158
1 files changed, 80 insertions, 78 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index b7d71acad18..450d2ef7100 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -3125,16 +3125,19 @@ void Target::StopHook::GetDescription(Stream *s,
// class TargetProperties
//--------------------------------------------------------------
-OptionEnumValueElement lldb_private::g_dynamic_value_types[] = {
+static constexpr OptionEnumValueElement g_dynamic_value_types[] = {
{eNoDynamicValues, "no-dynamic-values",
"Don't calculate the dynamic type of values"},
{eDynamicCanRunTarget, "run-target", "Calculate the dynamic type of values "
"even if you have to run the target."},
{eDynamicDontRunTarget, "no-run-target",
- "Calculate the dynamic type of values, but don't run the target."},
- {0, nullptr, nullptr}};
+ "Calculate the dynamic type of values, but don't run the target."} };
-static OptionEnumValueElement g_inline_breakpoint_enums[] = {
+OptionEnumValues lldb_private::GetDynamicValueTypes() {
+ return OptionEnumValues(g_dynamic_value_types);
+}
+
+static constexpr OptionEnumValueElement g_inline_breakpoint_enums[] = {
{eInlineBreakpointsNever, "never", "Never look for inline breakpoint "
"locations (fastest). This setting "
"should only be used if you know that "
@@ -3145,8 +3148,7 @@ static OptionEnumValueElement g_inline_breakpoint_enums[] = {
"files (default)."},
{eInlineBreakpointsAlways, "always",
"Always look for inline breakpoint locations when setting file and line "
- "breakpoints (slower but most accurate)."},
- {0, nullptr, nullptr}};
+ "breakpoints (slower but most accurate)."} };
typedef enum x86DisassemblyFlavor {
eX86DisFlavorDefault,
@@ -3154,36 +3156,33 @@ typedef enum x86DisassemblyFlavor {
eX86DisFlavorATT
} x86DisassemblyFlavor;
-static OptionEnumValueElement g_x86_dis_flavor_value_types[] = {
+static constexpr OptionEnumValueElement g_x86_dis_flavor_value_types[] = {
{eX86DisFlavorDefault, "default", "Disassembler default (currently att)."},
{eX86DisFlavorIntel, "intel", "Intel disassembler flavor."},
- {eX86DisFlavorATT, "att", "AT&T disassembler flavor."},
- {0, nullptr, nullptr}};
+ {eX86DisFlavorATT, "att", "AT&T disassembler flavor."} };
-static OptionEnumValueElement g_hex_immediate_style_values[] = {
+static constexpr OptionEnumValueElement g_hex_immediate_style_values[] = {
{Disassembler::eHexStyleC, "c", "C-style (0xffff)."},
- {Disassembler::eHexStyleAsm, "asm", "Asm-style (0ffffh)."},
- {0, nullptr, nullptr}};
+ {Disassembler::eHexStyleAsm, "asm", "Asm-style (0ffffh)."} };
-static OptionEnumValueElement g_load_script_from_sym_file_values[] = {
+static constexpr OptionEnumValueElement g_load_script_from_sym_file_values[] = {
{eLoadScriptFromSymFileTrue, "true",
"Load debug scripts inside symbol files"},
{eLoadScriptFromSymFileFalse, "false",
"Do not load debug scripts inside symbol files."},
{eLoadScriptFromSymFileWarn, "warn",
- "Warn about debug scripts inside symbol files but do not load them."},
- {0, nullptr, nullptr}};
+ "Warn about debug scripts inside symbol files but do not load them."} };
-static OptionEnumValueElement g_load_current_working_dir_lldbinit_values[] = {
+static constexpr
+OptionEnumValueElement g_load_current_working_dir_lldbinit_values[] = {
{eLoadCWDlldbinitTrue, "true",
"Load .lldbinit files from current directory"},
{eLoadCWDlldbinitFalse, "false",
"Do not load .lldbinit files from current directory"},
{eLoadCWDlldbinitWarn, "warn",
- "Warn about loading .lldbinit files from current directory"},
- {0, nullptr, nullptr}};
+ "Warn about loading .lldbinit files from current directory"} };
-static OptionEnumValueElement g_memory_module_load_level_values[] = {
+static constexpr OptionEnumValueElement g_memory_module_load_level_values[] = {
{eMemoryModuleLoadLevelMinimal, "minimal",
"Load minimal information when loading modules from memory. Currently "
"this setting loads sections only."},
@@ -3192,28 +3191,27 @@ static OptionEnumValueElement g_memory_module_load_level_values[] = {
"this setting loads sections and function bounds."},
{eMemoryModuleLoadLevelComplete, "complete",
"Load complete information when loading modules from memory. Currently "
- "this setting loads sections and all symbols."},
- {0, nullptr, nullptr}};
+ "this setting loads sections and all symbols."} };
-static PropertyDefinition g_properties[] = {
- {"default-arch", OptionValue::eTypeArch, true, 0, nullptr, nullptr,
+static constexpr PropertyDefinition g_properties[] = {
+ {"default-arch", OptionValue::eTypeArch, true, 0, nullptr, {},
"Default architecture to choose, when there's a choice."},
{"move-to-nearest-code", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Move breakpoints to nearest code."},
+ {}, "Move breakpoints to nearest code."},
{"language", OptionValue::eTypeLanguage, false, eLanguageTypeUnknown,
- nullptr, nullptr,
+ nullptr, {},
"The language to use when interpreting expressions entered in commands."},
- {"expr-prefix", OptionValue::eTypeFileSpec, false, 0, nullptr, nullptr,
+ {"expr-prefix", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
"Path to a file containing expressions to be prepended to all "
"expressions."},
{"prefer-dynamic-value", OptionValue::eTypeEnum, false,
- eDynamicDontRunTarget, nullptr, g_dynamic_value_types,
+ eDynamicDontRunTarget, nullptr, OptionEnumValues(g_dynamic_value_types),
"Should printed values be shown as their dynamic value."},
{"enable-synthetic-value", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Should synthetic values be used by default whenever available."},
- {"skip-prologue", OptionValue::eTypeBoolean, false, true, nullptr, nullptr,
+ {}, "Should synthetic values be used by default whenever available."},
+ {"skip-prologue", OptionValue::eTypeBoolean, false, true, nullptr, {},
"Skip function prologues when setting breakpoints by name."},
- {"source-map", OptionValue::eTypePathMap, false, 0, nullptr, nullptr,
+ {"source-map", OptionValue::eTypePathMap, false, 0, nullptr, {},
"Source path remappings are used to track the change of location between "
"a source file when built, and "
"where it exists on the current system. It consists of an array of "
@@ -3225,66 +3223,67 @@ static PropertyDefinition g_properties[] = {
"Each element of the array is checked in order and the first one that "
"results in a match wins."},
{"exec-search-paths", OptionValue::eTypeFileSpecList, false, 0, nullptr,
- nullptr, "Executable search paths to use when locating executable files "
- "whose paths don't match the local file system."},
+ {}, "Executable search paths to use when locating executable files "
+ "whose paths don't match the local file system."},
{"debug-file-search-paths", OptionValue::eTypeFileSpecList, false, 0,
- nullptr, nullptr,
+ nullptr, {},
"List of directories to be searched when locating debug symbol files."},
{"clang-module-search-paths", OptionValue::eTypeFileSpecList, false, 0,
- nullptr, nullptr,
+ nullptr, {},
"List of directories to be searched when locating modules for Clang."},
{"auto-import-clang-modules", OptionValue::eTypeBoolean, false, true,
- nullptr, nullptr,
+ nullptr, {},
"Automatically load Clang modules referred to by the program."},
{"auto-apply-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Automatically apply fix-it hints to expressions."},
+ {}, "Automatically apply fix-it hints to expressions."},
{"notify-about-fixits", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Print the fixed expression text."},
+ {}, "Print the fixed expression text."},
{"save-jit-objects", OptionValue::eTypeBoolean, false, false, nullptr,
- nullptr, "Save intermediate object files generated by the LLVM JIT"},
+ {}, "Save intermediate object files generated by the LLVM JIT"},
{"max-children-count", OptionValue::eTypeSInt64, false, 256, nullptr,
- nullptr, "Maximum number of children to expand in any level of depth."},
+ {}, "Maximum number of children to expand in any level of depth."},
{"max-string-summary-length", OptionValue::eTypeSInt64, false, 1024,
- nullptr, nullptr,
+ nullptr, {},
"Maximum number of characters to show when using %s in summary strings."},
{"max-memory-read-size", OptionValue::eTypeSInt64, false, 1024, nullptr,
- nullptr, "Maximum number of bytes that 'memory read' will fetch before "
- "--force must be specified."},
+ {}, "Maximum number of bytes that 'memory read' will fetch before "
+ "--force must be specified."},
{"breakpoints-use-platform-avoid-list", OptionValue::eTypeBoolean, false,
- true, nullptr, nullptr, "Consult the platform module avoid list when "
- "setting non-module specific breakpoints."},
- {"arg0", OptionValue::eTypeString, false, 0, nullptr, nullptr,
+ true, nullptr, {}, "Consult the platform module avoid list when "
+ "setting non-module specific breakpoints."},
+ {"arg0", OptionValue::eTypeString, false, 0, nullptr, {},
"The first argument passed to the program in the argument array which can "
"be different from the executable itself."},
- {"run-args", OptionValue::eTypeArgs, false, 0, nullptr, nullptr,
+ {"run-args", OptionValue::eTypeArgs, false, 0, nullptr, {},
"A list containing all the arguments to be passed to the executable when "
"it is run. Note that this does NOT include the argv[0] which is in "
"target.arg0."},
{"env-vars", OptionValue::eTypeDictionary, false, OptionValue::eTypeString,
- nullptr, nullptr, "A list of all the environment variables to be passed "
- "to the executable's environment, and their values."},
- {"inherit-env", OptionValue::eTypeBoolean, false, true, nullptr, nullptr,
+ nullptr, {}, "A list of all the environment variables to be passed "
+ "to the executable's environment, and their values."},
+ {"inherit-env", OptionValue::eTypeBoolean, false, true, nullptr, {},
"Inherit the environment from the process that is running LLDB."},
- {"input-path", OptionValue::eTypeFileSpec, false, 0, nullptr, nullptr,
+ {"input-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
"The file/path to be used by the executable program for reading its "
"standard input."},
- {"output-path", OptionValue::eTypeFileSpec, false, 0, nullptr, nullptr,
+ {"output-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
"The file/path to be used by the executable program for writing its "
"standard output."},
- {"error-path", OptionValue::eTypeFileSpec, false, 0, nullptr, nullptr,
+ {"error-path", OptionValue::eTypeFileSpec, false, 0, nullptr, {},
"The file/path to be used by the executable program for writing its "
"standard error."},
{"detach-on-error", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "debugserver will detach (rather than killing) a process if it "
+ {}, "debugserver will detach (rather than killing) a process if it "
"loses connection with lldb."},
- {"preload-symbols", OptionValue::eTypeBoolean, false, true, nullptr, nullptr,
+ {"preload-symbols", OptionValue::eTypeBoolean, false, true, nullptr, {},
"Enable loading of symbol tables before they are needed."},
- {"disable-aslr", OptionValue::eTypeBoolean, false, true, nullptr, nullptr,
+ {"disable-aslr", OptionValue::eTypeBoolean, false, true, nullptr, {},
"Disable Address Space Layout Randomization (ASLR)"},
- {"disable-stdio", OptionValue::eTypeBoolean, false, false, nullptr, nullptr,
+ {"disable-stdio", OptionValue::eTypeBoolean, false, false, nullptr, {},
"Disable stdin/stdout for process (e.g. for a GUI application)"},
{"inline-breakpoint-strategy", OptionValue::eTypeEnum, false,
- eInlineBreakpointsAlways, nullptr, g_inline_breakpoint_enums,
+ eInlineBreakpointsAlways, nullptr,
+ OptionEnumValues(g_inline_breakpoint_enums),
"The strategy to use when settings breakpoints by file and line. "
"Breakpoint locations can end up being inlined by the compiler, so that a "
"compile unit 'a.c' might contain an inlined function from another source "
@@ -3304,25 +3303,29 @@ static PropertyDefinition g_properties[] = {
// FIXME: This is the wrong way to do per-architecture settings, but we
// don't have a general per architecture settings system in place yet.
{"x86-disassembly-flavor", OptionValue::eTypeEnum, false,
- eX86DisFlavorDefault, nullptr, g_x86_dis_flavor_value_types,
+ eX86DisFlavorDefault, nullptr,
+ OptionEnumValues(g_x86_dis_flavor_value_types),
"The default disassembly flavor to use for x86 or x86-64 targets."},
{"use-hex-immediates", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Show immediates in disassembly as hexadecimal."},
+ {}, "Show immediates in disassembly as hexadecimal."},
{"hex-immediate-style", OptionValue::eTypeEnum, false,
- Disassembler::eHexStyleC, nullptr, g_hex_immediate_style_values,
+ Disassembler::eHexStyleC, nullptr,
+ OptionEnumValues(g_hex_immediate_style_values),
"Which style to use for printing hexadecimal disassembly values."},
{"use-fast-stepping", OptionValue::eTypeBoolean, false, true, nullptr,
- nullptr, "Use a fast stepping algorithm based on running from branch to "
- "branch rather than instruction single-stepping."},
+ {}, "Use a fast stepping algorithm based on running from branch to "
+ "branch rather than instruction single-stepping."},
{"load-script-from-symbol-file", OptionValue::eTypeEnum, false,
- eLoadScriptFromSymFileWarn, nullptr, g_load_script_from_sym_file_values,
+ eLoadScriptFromSymFileWarn, nullptr,
+ OptionEnumValues(g_load_script_from_sym_file_values),
"Allow LLDB to load scripting resources embedded in symbol files when "
"available."},
{"load-cwd-lldbinit", OptionValue::eTypeEnum, false, eLoadCWDlldbinitWarn,
- nullptr, g_load_current_working_dir_lldbinit_values,
+ nullptr, OptionEnumValues(g_load_current_working_dir_lldbinit_values),
"Allow LLDB to .lldbinit files from the current directory automatically."},
{"memory-module-load-level", OptionValue::eTypeEnum, false,
- eMemoryModuleLoadLevelComplete, nullptr, g_memory_module_load_level_values,
+ eMemoryModuleLoadLevelComplete, nullptr,
+ OptionEnumValues(g_memory_module_load_level_values),
"Loading modules from memory can be slow as reading the symbol tables and "
"other data can take a long time depending on your connection to the "
"debug target. "
@@ -3338,20 +3341,19 @@ static PropertyDefinition g_properties[] = {
"symbols, but should rarely be used as stack frames in these memory "
"regions will be inaccurate and not provide any context (fastest). "},
{"display-expression-in-crashlogs", OptionValue::eTypeBoolean, false, false,
- nullptr, nullptr, "Expressions that crash will show up in crash logs if "
- "the host system supports executable specific crash log "
- "strings and this setting is set to true."},
+ nullptr, {}, "Expressions that crash will show up in crash logs if "
+ "the host system supports executable specific crash log "
+ "strings and this setting is set to true."},
{"trap-handler-names", OptionValue::eTypeArray, true,
- OptionValue::eTypeString, nullptr, nullptr,
+ OptionValue::eTypeString, nullptr, {},
"A list of trap handler function names, e.g. a common Unix user process "
"one is _sigtramp."},
{"display-runtime-support-values", OptionValue::eTypeBoolean, false, false,
- nullptr, 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, nullptr,
+ 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, nullptr}};
+ {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, {}, nullptr}};
enum {
ePropertyDefaultArch,
@@ -3473,16 +3475,16 @@ protected:
//----------------------------------------------------------------------
// TargetProperties
//----------------------------------------------------------------------
-static PropertyDefinition g_experimental_properties[]{
+static constexpr PropertyDefinition g_experimental_properties[]{
{"inject-local-vars", OptionValue::eTypeBoolean, true, true, nullptr,
- nullptr,
+ {},
"If true, inject local variables explicitly into the expression text. "
"This will fix symbol resolution when there are name collisions between "
"ivars and local variables. "
"But it can make expressions run much more slowly."},
{"use-modern-type-lookup", OptionValue::eTypeBoolean, true, false, nullptr,
- nullptr, "If true, use Clang's modern type lookup infrastructure."},
- {nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, nullptr, nullptr}};
+ {}, "If true, use Clang's modern type lookup infrastructure."},
+ {nullptr, OptionValue::eTypeInvalid, true, 0, nullptr, {}, nullptr}};
enum { ePropertyInjectLocalVars = 0, ePropertyUseModernTypeLookup };
OpenPOWER on IntegriCloud