From ed8a705cea596388aa0860c3e6fc327939716ce1 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 18 Sep 2010 03:37:20 +0000 Subject: [PATCH] General command line help cleanup: - All single character options will now be printed together - Changed all options that contains underscores to contain '-' instead - Made the help come out a little flatter by showing the long and short option on the same line. - Modified the short character for "--ignore-count" options to "-i" llvm-svn: 114265 --- lldb/include/lldb/Symbol/Block.h | 2 +- lldb/include/lldb/Symbol/ObjectFile.h | 2 +- lldb/include/lldb/Target/DynamicLoader.h | 6 +- lldb/include/lldb/Target/Process.h | 2 +- .../Commands/CommandObjectBreakpoint.cpp | 49 ++++------ .../CommandObjectBreakpointCommand.cpp | 2 +- lldb/source/Commands/CommandObjectCall.cpp | 2 +- lldb/source/Commands/CommandObjectFrame.cpp | 9 +- lldb/source/Commands/CommandObjectProcess.cpp | 8 +- .../source/Commands/CommandObjectSettings.cpp | 1 - lldb/source/Commands/CommandObjectSource.cpp | 3 +- lldb/source/Commands/CommandObjectThread.cpp | 22 ++--- lldb/source/Core/DataExtractor.cpp | 2 +- lldb/source/Core/DynamicLoader.cpp | 2 +- lldb/source/Core/ValueObject.cpp | 2 +- lldb/source/Interpreter/Options.cpp | 89 ++++++++++++++++--- .../SymbolFile/DWARF/DWARFDebugInfo.cpp | 2 +- 17 files changed, 128 insertions(+), 77 deletions(-) diff --git a/lldb/include/lldb/Symbol/Block.h b/lldb/include/lldb/Symbol/Block.h index 88d63ea3436c..53fb741dae0f 100644 --- a/lldb/include/lldb/Symbol/Block.h +++ b/lldb/include/lldb/Symbol/Block.h @@ -269,7 +269,7 @@ public: /// @param[in] add_inline_child_block_variables /// If this is \b false, no child variables of child blocks /// that are inlined functions will be gotten. If \b true then - /// all child variables will be added regardless of wether they + /// all child variables will be added regardless of whether they /// come from inlined functions or not. /// /// @return diff --git a/lldb/include/lldb/Symbol/ObjectFile.h b/lldb/include/lldb/Symbol/ObjectFile.h index 9b25b5469372..184e80cb2395 100644 --- a/lldb/include/lldb/Symbol/ObjectFile.h +++ b/lldb/include/lldb/Symbol/ObjectFile.h @@ -270,7 +270,7 @@ public: GetUUID (UUID* uuid) = 0; //------------------------------------------------------------------ - /// Gets wether endian swapping should occur when extracting data + /// Gets whether endian swapping should occur when extracting data /// from this object file. /// /// @return diff --git a/lldb/include/lldb/Target/DynamicLoader.h b/lldb/include/lldb/Target/DynamicLoader.h index 9dc0cb6d9bbb..bed967859729 100644 --- a/lldb/include/lldb/Target/DynamicLoader.h +++ b/lldb/include/lldb/Target/DynamicLoader.h @@ -92,7 +92,7 @@ public: DidLaunch () = 0; //------------------------------------------------------------------ - /// Get wether the process should stop when images change. + /// Get whether the process should stop when images change. /// /// When images (executables and shared libraries) get loaded or /// unloaded, often debug sessions will want to try and resolve or @@ -108,7 +108,7 @@ public: GetStopWhenImagesChange () const; //------------------------------------------------------------------ - /// Set wether the process should stop when images change. + /// Set whether the process should stop when images change. /// /// When images (executables and shared libraries) get loaded or /// unloaded, often debug sessions will want to try and resolve or @@ -117,7 +117,7 @@ public: /// can be overridden using this function callback. /// /// @param[in] stop - /// Boolean value that indicates wether the process should stop + /// Boolean value that indicates whether the process should stop /// when images change. //------------------------------------------------------------------ void diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 257a6cb211f2..5cd9ae9247d8 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -436,7 +436,7 @@ public: //------------------------------------------------------------------ /// Check if a plug-in instance can debug the file in \a module. /// - /// Each plug-in is given a chance to say wether it can debug + /// Each plug-in is given a chance to say whether it can debug /// the file in \a module. If the Process plug-in instance can /// debug a file on the current system, it should return \b true. /// diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index a4ad58ce1d50..f5c64bc0e081 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -74,19 +74,19 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] = { LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "", "Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."}, - { LLDB_OPT_SET_ALL, false, "ignore_count", 'k', required_argument, NULL, 0, "", + { LLDB_OPT_SET_ALL, false, "ignore-count", 'i', required_argument, NULL, 0, "", "Set the number of times this breakpoint is sKipped before stopping." }, - { LLDB_OPT_SET_ALL, false, "thread_index", 'x', required_argument, NULL, NULL, "", - "The breakpoint stops only for the thread whose indeX matches this argument."}, + { LLDB_OPT_SET_ALL, false, "thread-index", 'x', required_argument, NULL, NULL, "", + "The breakpoint stops only for the thread whose index matches this argument."}, - { LLDB_OPT_SET_ALL, false, "thread_id", 't', required_argument, NULL, NULL, "", + { LLDB_OPT_SET_ALL, false, "thread-id", 't', required_argument, NULL, NULL, "", "The breakpoint stops only for the thread whose TID matches this argument."}, - { LLDB_OPT_SET_ALL, false, "thread_name", 'T', required_argument, NULL, NULL, "", + { LLDB_OPT_SET_ALL, false, "thread-name", 'T', required_argument, NULL, NULL, "", "The breakpoint stops only for the thread whose thread name matches this argument."}, - { LLDB_OPT_SET_ALL, false, "queue_name", 'q', required_argument, NULL, NULL, "", + { LLDB_OPT_SET_ALL, false, "queue-name", 'q', required_argument, NULL, NULL, "", "The breakpoint stops only for threads in the queue whose name is given by this argument."}, { LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "", @@ -116,7 +116,7 @@ CommandObjectBreakpointSet::CommandOptions::g_option_table[] = { LLDB_OPT_SET_6, true, "method", 'M', required_argument, NULL, 0, "", "Set the breakpoint by C++ method names." }, - { LLDB_OPT_SET_7, true, "func_regex", 'r', required_argument, NULL, 0, "", + { LLDB_OPT_SET_7, true, "func-regex", 'r', required_argument, NULL, 0, "", "Set the breakpoint by function name, evaluating a regular-expression to find the function name(s)." }, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } @@ -186,7 +186,7 @@ CommandObjectBreakpointSet::CommandOptions::SetOptionValue (int option_idx, cons m_modules.push_back (std::string (option_arg)); break; } - case 'k': + case 'i': { m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0); if (m_ignore_count == UINT32_MAX) @@ -1098,29 +1098,14 @@ CommandObjectBreakpointModify::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectBreakpointModify::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_ALL, false, "ignore_count", 'k', required_argument, NULL, 0, NULL, - "Set the number of times this breakpoint is sKipped before stopping." }, - - { LLDB_OPT_SET_ALL, false, "thread_index", 'x', required_argument, NULL, NULL, "", - "The breakpoint stops only for the thread whose indeX matches this argument."}, - - { LLDB_OPT_SET_ALL, false, "thread_id", 't', required_argument, NULL, NULL, "", - "The breakpoint stops only for the thread whose TID matches this argument."}, - - { LLDB_OPT_SET_ALL, false, "thread_name", 'T', required_argument, NULL, NULL, "", - "The breakpoint stops only for the thread whose thread name matches this argument."}, - - { LLDB_OPT_SET_ALL, false, "queue_name", 'q', required_argument, NULL, NULL, "", - "The breakpoint stops only for threads in the queue whose name is given by this argument."}, - - { LLDB_OPT_SET_1, false, "enable", 'e', no_argument, NULL, NULL, NULL, - "Enable the breakpoint."}, - - { LLDB_OPT_SET_2, false, "disable", 'd', no_argument, NULL, NULL, NULL, - "Disable the breakpoint."}, - - - { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } +{ LLDB_OPT_SET_ALL, false, "ignore-count", 'i', required_argument, NULL, NULL, "", "Set the number of times this breakpoint is skipped before stopping." }, +{ LLDB_OPT_SET_ALL, false, "thread-index", 'x', required_argument, NULL, NULL, "", "The breakpoint stops only for the thread whose indeX matches this argument."}, +{ LLDB_OPT_SET_ALL, false, "thread-id", 't', required_argument, NULL, NULL, "", "The breakpoint stops only for the thread whose TID matches this argument."}, +{ LLDB_OPT_SET_ALL, false, "thread-name", 'T', required_argument, NULL, NULL, "", "The breakpoint stops only for the thread whose thread name matches this argument."}, +{ LLDB_OPT_SET_ALL, false, "queue-name", 'q', required_argument, NULL, NULL, "", "The breakpoint stops only for threads in the queue whose name is given by this argument."}, +{ LLDB_OPT_SET_1, false, "enable", 'e', no_argument, NULL, NULL, NULL, "Enable the breakpoint."}, +{ LLDB_OPT_SET_2, false, "disable", 'd', no_argument, NULL, NULL, NULL, "Disable the breakpoint."}, +{ 0, false, NULL, 0 , 0, NULL, 0, NULL, NULL } }; const lldb::OptionDefinition* @@ -1145,7 +1130,7 @@ CommandObjectBreakpointModify::CommandOptions::SetOptionValue (int option_idx, c m_enable_passed = true; m_enable_value = true; break; - case 'k': + case 'i': { m_ignore_count = Args::StringToUInt32(optarg, UINT32_MAX, 0); if (m_ignore_count == UINT32_MAX) diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index ca39084c3b15..a3c62ebd3941 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -48,7 +48,7 @@ CommandObjectBreakpointCommandAdd::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectBreakpointCommandAdd::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_ALL, false, "one_liner", 'o', required_argument, NULL, 0, "", + { LLDB_OPT_SET_ALL, false, "one-liner", 'o', required_argument, NULL, 0, "", "Specify a one-liner inline." }, { LLDB_OPT_SET_1, true, "script", 's', no_argument, NULL, 0, NULL, diff --git a/lldb/source/Commands/CommandObjectCall.cpp b/lldb/source/Commands/CommandObjectCall.cpp index cedbd7a2ce10..3e938fccaa62 100644 --- a/lldb/source/Commands/CommandObjectCall.cpp +++ b/lldb/source/Commands/CommandObjectCall.cpp @@ -302,7 +302,7 @@ CommandObjectCall::CommandOptions::g_option_table[] = { LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."}, { LLDB_OPT_SET_1, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, { LLDB_OPT_SET_1, false, "noexecute", 'n', no_argument, NULL, 0, "no execute", "Only JIT and copy the wrapper & arguments, but don't execute."}, -{ LLDB_OPT_SET_1, false, "useabi", 'a', no_argument, NULL, 0, NULL, "Use the ABI instead of the JIT to marshall arguments."}, +{ LLDB_OPT_SET_1, false, "use-abi", 'a', no_argument, NULL, 0, NULL, "Use the ABI instead of the JIT to marshall arguments."}, { 0, false, NULL, 0, 0, NULL, NULL, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 04136642f150..fdd47bc73b4a 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -290,7 +290,12 @@ public: CommandObjectFrameVariable (CommandInterpreter &interpreter) : CommandObject (interpreter, "frame variable", - "Show specified argument, local variable, static variable or global variable for the current frame. If none specified, list them all.", + "Show frame variables. All argument and local variables " + "that are in scope will be shown when no arguments are given. " + "If any arguments are specified, they can be names of " + "argument, local, file static and file global variables." + "Children of aggregate variables can be specified such as " + "'var->child.x'.", "frame variable [] [ [...]]") { } @@ -766,7 +771,7 @@ CommandObjectFrameVariable::CommandOptions::g_option_table[] = { LLDB_OPT_SET_1, false, "debug", 'D', no_argument, NULL, 0, NULL, "Enable verbose debug information."}, { LLDB_OPT_SET_1, false, "depth", 'd', required_argument, NULL, 0, "", "Set the max recurse depth when dumping aggregate types (default is infinity)."}, { LLDB_OPT_SET_1, false, "show-globals",'g', no_argument, NULL, 0, NULL, "Show the current frame source file global and static variables."}, -{ LLDB_OPT_SET_1, false, "find-global",'G', required_argument, NULL, 0, NULL, "Find a global variable by name (which might not be in the current stack frame source file)."}, +{ LLDB_OPT_SET_1, false, "find-global",'G', required_argument, NULL, 0, "", "Find a global variable by name (which might not be in the current stack frame source file)."}, { LLDB_OPT_SET_1, false, "location", 'L', no_argument, NULL, 0, NULL, "Show variable location information."}, { LLDB_OPT_SET_1, false, "show-declaration", 'c', no_argument, NULL, 0, NULL, "Show variable declaration information (source file and line where the variable was declared)."}, { LLDB_OPT_SET_1, false, "name", 'n', required_argument, NULL, 0, "", "Lookup a variable by name or regex (--regex) for the current execution context."}, diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index f04f1fa48ff4..cae26a81973b 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -643,10 +643,10 @@ protected: lldb::OptionDefinition CommandObjectProcessAttach::CommandOptions::g_option_table[] = { -{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, "", "Name of the process plugin you want to use."}, -{ LLDB_OPT_SET_1, false, "pid", 'p', required_argument, NULL, 0, "", "The process ID of an existing process to attach to."}, -{ LLDB_OPT_SET_2, false, "name", 'n', required_argument, NULL, 0, "", "The name of the process to attach to."}, -{ LLDB_OPT_SET_2, false, "waitfor", 'w', no_argument, NULL, 0, NULL, "Wait for the the process with to launch."}, +{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, "", "Name of the process plugin you want to use."}, +{ LLDB_OPT_SET_1, false, "pid", 'p', required_argument, NULL, 0, "", "The process ID of an existing process to attach to."}, +{ LLDB_OPT_SET_2, false, "name", 'n', required_argument, NULL, 0, "", "The name of the process to attach to."}, +{ LLDB_OPT_SET_2, false, "waitfor",'w', no_argument, NULL, 0, NULL, "Wait for the the process with to launch."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index ceb5d47579e0..b1bdaaa1b0d1 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -207,7 +207,6 @@ lldb::OptionDefinition CommandObjectSettingsSet::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_1, false, "override", 'o', no_argument, NULL, NULL, NULL, "Causes already existing instances and pending settings to use this new value. This option only makes sense when setting default values." }, - { LLDB_OPT_SET_2, false, "reset", 'r', no_argument, NULL, NULL, NULL, "Causes value to be reset to the original default for this variable. No value needs to be specified when this option is used." }, }; diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 0ca222d772c4..140efe23043e 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -559,8 +559,7 @@ lldb::OptionDefinition CommandObjectSourceList::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_ALL, false, "count", 'c', required_argument, NULL, 0, "", "The number of source lines to display."}, -{ LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "", - "Look up the source file in the given shared library."}, +{ LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "", "Look up the source file in the given shared library."}, { LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "", "The file from which to display source."}, { LLDB_OPT_SET_1, false, "line", 'l', required_argument, NULL, 0, "", "The line number at which to start the display source."}, { LLDB_OPT_SET_2, false, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "", "The name of a function whose source to display."}, diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index bfb32c7f9f27..d5614688a328 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -467,8 +467,8 @@ protected: lldb::OptionDefinition CommandObjectThreadBacktrace::CommandOptions::g_option_table[] = { -{ LLDB_OPT_SET_1, false, "count", 'c', required_argument, NULL, 0, "", "How many frames to display (-1 for all)"}, -{ LLDB_OPT_SET_1, false, "start", 's', required_argument, NULL, 0, "", "Frame in which to start the backtrace"}, +{ LLDB_OPT_SET_1, false, "count", 'c', required_argument, NULL, 0, "", "How many frames to display (-1 for all)"}, +{ LLDB_OPT_SET_1, false, "start", 's', required_argument, NULL, 0, "", "Frame in which to start the backtrace"}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -755,26 +755,26 @@ protected: static lldb::OptionEnumValueElement g_tri_running_mode[] = { -{ eOnlyThisThread, "thisThread", "Run only this thread"}, -{ eAllThreads, "allThreads", "Run all threads"}, -{ eOnlyDuringStepping, "whileStepping", "Run only this thread while stepping"}, +{ eOnlyThisThread, "this-thread", "Run only this thread"}, +{ eAllThreads, "all-threads", "Run all threads"}, +{ eOnlyDuringStepping, "while-stepping", "Run only this thread while stepping"}, { 0, NULL, NULL } }; static lldb::OptionEnumValueElement g_duo_running_mode[] = { -{ eOnlyThisThread, "thisThread", "Run only this thread"}, -{ eAllThreads, "allThreads", "Run all threads"}, +{ eOnlyThisThread, "this-thread", "Run only this thread"}, +{ eAllThreads, "all-threads", "Run all threads"}, { 0, NULL, NULL } }; lldb::OptionDefinition CommandObjectThreadStepWithTypeAndScope::CommandOptions::g_option_table[] = { -{ LLDB_OPT_SET_1, false, "avoid_no_debug", 'a', required_argument, NULL, 0, "", "Should step-in step over functions with no debug information"}, -{ LLDB_OPT_SET_1, false, "run_mode", 'm', required_argument, g_tri_running_mode, 0, "", "Determine how to run other threads while stepping this one"}, -{ LLDB_OPT_SET_1, false, "regexp_to_avoid",'r', required_argument, NULL, 0, "", "Should step-in step over functions matching this regexp"}, +{ LLDB_OPT_SET_1, false, "avoid-no-debug", 'a', required_argument, NULL, 0, "", "A boolean value that sets whether step-in will step over functions with no debug information."}, +{ LLDB_OPT_SET_1, false, "run-mode", 'm', required_argument, g_tri_running_mode, 0, "","Determine how to run other threads while stepping the current thread."}, +{ LLDB_OPT_SET_1, false, "step-over-regexp",'r', required_argument, NULL, 0, "", "A regular expression that defines function names to step over."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -1217,7 +1217,7 @@ CommandObjectThreadUntil::CommandOptions::g_option_table[] = { { LLDB_OPT_SET_1, false, "frame", 'f', required_argument, NULL, 0, "", "Frame index for until operation - defaults to 0"}, { LLDB_OPT_SET_1, false, "thread", 't', required_argument, NULL, 0, "", "Thread index for the thread for until operation"}, -{ LLDB_OPT_SET_1, false, "run_mode",'m', required_argument, g_duo_running_mode, 0, "","Determine how to run other threads while stepping this one"}, +{ LLDB_OPT_SET_1, false, "run-mode",'m', required_argument, g_duo_running_mode, 0, "","Determine how to run other threads while stepping this one"}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index 3840afa9d4bd..3ae4bec76a21 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -262,7 +262,7 @@ DataExtractor::GetByteOrder () const return m_byte_order; } //------------------------------------------------------------------ -// Set wether this object will endian swap values as it extracts +// Set whether this object will endian swap values as it extracts // data. //------------------------------------------------------------------ void diff --git a/lldb/source/Core/DynamicLoader.cpp b/lldb/source/Core/DynamicLoader.cpp index b6b2f27caef5..a207e9f33157 100644 --- a/lldb/source/Core/DynamicLoader.cpp +++ b/lldb/source/Core/DynamicLoader.cpp @@ -58,7 +58,7 @@ DynamicLoader::~DynamicLoader() } //---------------------------------------------------------------------- -// Accessosors to the global setting as to wether to stop at image +// Accessosors to the global setting as to whether to stop at image // (shared library) loading/unloading. //---------------------------------------------------------------------- bool diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index cd087f8b90d7..5d866bc9b9a2 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -111,7 +111,7 @@ ValueObject::UpdateValueIfNeeded (ExecutionContextScope *exe_scope) UpdateValue (exe_scope); // Update the fact that we tried to update the value for this - // value object wether or not we succeed + // value object whether or not we succeed m_update_id = stop_id; bool success = m_error.Success(); SetValueIsValid (success); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 8e7f80896f3d..57e689314431 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -402,6 +402,76 @@ Options::GenerateOptionUsage strm.Printf ("\n"); strm.Indent (name); + // First go through and print all options that take no arguments as + // a single string. If a command has "-a" "-b" and "-c", this will show + // up as [-abc] + + std::set options; + std::set::const_iterator options_pos, options_end; + bool first; + for (i = 0, first = true; i < num_options; ++i) + { + if (full_options_table[i].usage_mask & opt_set_mask) + { + // Add current option to the end of out_stream. + + if (full_options_table[i].required == true && + full_options_table[i].option_has_arg == no_argument) + { + options.insert (full_options_table[i].short_option); + } + } + } + + if (options.empty() == false) + { + // We have some required options with no arguments + strm.PutCString(" -"); + for (i=0; i<2; ++i) + for (options_pos = options.begin(), options_end = options.end(); + options_pos != options_end; + ++options_pos) + { + if (i==0 && ::isupper (*options_pos)) + continue; + if (i==1 && ::islower (*options_pos)) + continue; + strm << *options_pos; + } + } + + for (i = 0, options.clear(); i < num_options; ++i) + { + if (full_options_table[i].usage_mask & opt_set_mask) + { + // Add current option to the end of out_stream. + + if (full_options_table[i].required == false && + full_options_table[i].option_has_arg == no_argument) + { + options.insert (full_options_table[i].short_option); + } + } + } + + if (options.empty() == false) + { + // We have some required options with no arguments + strm.PutCString(" [-"); + for (i=0; i<2; ++i) + for (options_pos = options.begin(), options_end = options.end(); + options_pos != options_end; + ++options_pos) + { + if (i==0 && ::isupper (*options_pos)) + continue; + if (i==1 && ::islower (*options_pos)) + continue; + strm << *options_pos; + } + strm.PutChar(']'); + } + // First go through and print the required options (list them up front). for (i = 0; i < num_options; ++i) @@ -424,8 +494,6 @@ Options::GenerateOptionUsage full_options_table[i].short_option, full_options_table[i].argument_name); } - else - strm.Printf (" -%c", full_options_table[i].short_option); } } } @@ -446,8 +514,6 @@ Options::GenerateOptionUsage else if (full_options_table[i].option_has_arg == optional_argument) strm.Printf (" [-%c [%s]]", full_options_table[i].short_option, full_options_table[i].argument_name); - else - strm.Printf (" [-%c]", full_options_table[i].short_option); } } } @@ -455,8 +521,7 @@ Options::GenerateOptionUsage strm.Printf ("\n\n"); // Now print out all the detailed information about the various options: long form, short form and help text: - // -- long_name - // - short + // --long_name ( -short ) // help text // This variable is used to keep track of which options' info we've printed out, because some options can be in @@ -507,15 +572,13 @@ Options::GenerateOptionUsage strm.EOL(); strm.Indent (); - strm.Printf ("-%c ", full_options_table[i].short_option); + strm.Printf ("--%s", full_options_table[i].long_option); if (full_options_table[i].argument_name != NULL) - strm.PutCString(full_options_table[i].argument_name); - strm.EOL(); - strm.Indent (); - strm.Printf ("--%s ", full_options_table[i].long_option); + strm.Printf (" %s", full_options_table[i].argument_name); + strm.Printf (" ( -%c", full_options_table[i].short_option); if (full_options_table[i].argument_name != NULL) - strm.PutCString(full_options_table[i].argument_name); - strm.EOL(); + strm.Printf (" %s", full_options_table[i].argument_name); + strm.PutCString(" )\n"); strm.IndentMore (5); diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp index abe26ef0b388..b5c4f7ded44b 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp @@ -891,7 +891,7 @@ typedef struct DumpInfo // entry is successfully parsed. // // This function dump DWARF information and obey recurse depth and -// wether a single DIE is to be dumped (or all of the data). +// whether a single DIE is to be dumped (or all of the data). //---------------------------------------------------------------------- static dw_offset_t DumpCallback (