diff options
author | Jim Ingham <jingham@apple.com> | 2011-05-04 03:43:18 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-05-04 03:43:18 +0000 |
commit | 2837b766f594f6aa0ec17c96bc8d257e2569d65e (patch) | |
tree | 3333316451bc06a2e495379451073b94abe38f9e /lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp | |
parent | 3d57441e56104b2bd93d85b4d19af1f5f40dbf82 (diff) | |
download | llvm-2837b766f594f6aa0ec17c96bc8d257e2569d65e.zip llvm-2837b766f594f6aa0ec17c96bc8d257e2569d65e.tar.gz llvm-2837b766f594f6aa0ec17c96bc8d257e2569d65e.tar.bz2 |
Change "frame var" over to using OptionGroups (and thus the OptionGroupVariableObjectDisplay).
Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target,
and dynamic with running target.
llvm-svn: 130832
Diffstat (limited to 'lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp index dac44b1..3150ea7 100644 --- a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp +++ b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp @@ -13,6 +13,8 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Target/Target.h" +#include "lldb/Interpreter/CommandInterpreter.h" using namespace lldb; using namespace lldb_private; @@ -28,6 +30,8 @@ OptionGroupValueObjectDisplay::~OptionGroupValueObjectDisplay () static OptionDefinition g_option_table[] = { + { LLDB_OPT_SET_1, false, "dynamic-type", 'd', required_argument, TargetInstanceSettings::g_dynamic_value_types, + 0, eArgTypeNone, "Show the object as its full dynamic type, not its static type, if available."}, { LLDB_OPT_SET_1, false, "depth", 'D', required_argument, NULL, 0, eArgTypeCount, "Set the max recurse depth when dumping aggregate types (default is infinity)."}, { LLDB_OPT_SET_1, false, "flat", 'F', no_argument, NULL, 0, eArgTypeNone, "Display results in a flat format that uses expression paths for each variable or member."}, { LLDB_OPT_SET_1, false, "location", 'L', no_argument, NULL, 0, eArgTypeNone, "Show variable location information."}, @@ -64,6 +68,17 @@ OptionGroupValueObjectDisplay::SetOptionValue (CommandInterpreter &interpreter, switch (short_option) { + case 'd': + { + bool success; + int32_t result; + result = Args::StringToOptionEnum (option_arg, TargetInstanceSettings::g_dynamic_value_types, 2, &success); + if (!success) + error.SetErrorStringWithFormat("Invalid dynamic value setting: \"%s\".\n", option_arg); + else + use_dynamic = (lldb::DynamicValueType) result; + } + break; case 'T': show_types = true; break; case 'Y': show_summary = false; break; case 'L': show_location= true; break; @@ -99,5 +114,13 @@ OptionGroupValueObjectDisplay::OptionParsingStarting (CommandInterpreter &interp use_objc = false; max_depth = UINT32_MAX; ptr_depth = 0; -} - + + Target *target = interpreter.GetExecutionContext().target; + if (target != NULL) + use_dynamic = target->GetPreferDynamicValue(); + else + { + // If we don't have any targets, then dynamic values won't do us much good. + use_dynamic = lldb::eNoDynamicValues; + } +}
\ No newline at end of file |