Updated all commands that use a "--format" / "-f" options to use the new

OptionGroupFormat. Updated OptionGroupFormat to be able to also use the
"--size" and "--count" options. Commands that use a OptionGroupFormat instance
can choose which of the options they want by initializing OptionGroupFormat
accordingly. Clients can either get only the "--format", "--format" + "--size",
or "--format" + "--size" + "--count". This is in preparation for upcoming
chnages where there are alternate ways (GDB format specification) to set a
format. 

llvm-svn: 142911
This commit is contained in:
Greg Clayton
2011-10-25 06:44:01 +00:00
parent d4268d91e7
commit 1deb796238
15 changed files with 696 additions and 647 deletions

View File

@@ -28,7 +28,6 @@ g_option_table[] =
{ LLDB_OPT_SET_1, false, "no-locals", 'l', no_argument, NULL, 0, eArgTypeNone, "Omit local variables."},
{ LLDB_OPT_SET_1, false, "show-globals", 'g', no_argument, NULL, 0, eArgTypeNone, "Show the current frame source file global and static variables."},
{ LLDB_OPT_SET_1, false, "show-declaration",'c', no_argument, NULL, 0, eArgTypeNone, "Show variable declaration information (source file and line where the variable was declared)."},
{ LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, eArgTypeExprFormat, "Specify the format that the variable output should use."},
{ LLDB_OPT_SET_1, false, "regex", 'r', no_argument, NULL, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."},
{ LLDB_OPT_SET_1, false, "scope", 's', no_argument, NULL, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."},
{ LLDB_OPT_SET_1, false, "summary", 'y', required_argument, NULL, 0, eArgTypeName, "Specify the summary that the variable output should use."},
@@ -61,7 +60,6 @@ OptionGroupVariable::SetOptionValue (CommandInterpreter &interpreter,
case 'l': show_locals = false; break;
case 'g': show_globals = true; break;
case 'c': show_decl = true; break;
case 'f': error = Args::StringToFormat(option_arg, format, NULL); break;
case 's':
show_scope = true;
break;
@@ -83,7 +81,6 @@ OptionGroupVariable::OptionParsingStarting (CommandInterpreter &interpreter)
show_locals = true; // Frame option only
show_globals = false; // Frame option only
show_decl = false;
format = lldb::eFormatDefault;
use_regex = false;
show_scope = false;
summary = "";