Index: include/lldb/lldb-enumerations.h =================================================================== --- include/lldb/lldb-enumerations.h +++ include/lldb/lldb-enumerations.h @@ -454,7 +454,7 @@ eAccessPackage }; - enum CommandArgumentType + enum CommandArgumentType { eArgTypeAddress = 0, eArgTypeAddressOrExpression, @@ -539,7 +539,8 @@ eArgTypeWatchpointID, eArgTypeWatchpointIDRange, eArgTypeWatchType, - eArgTypeLastArg // Always keep this entry as the last entry in this enumeration!! + eArgRawInput, + eArgTypeLastArg // Always keep this entry as the last entry in this enumeration!! }; //---------------------------------------------------------------------- Index: source/Commands/CommandObjectApropos.cpp =================================================================== --- source/Commands/CommandObjectApropos.cpp +++ source/Commands/CommandObjectApropos.cpp @@ -25,11 +25,8 @@ // CommandObjectApropos //------------------------------------------------------------------------- -CommandObjectApropos::CommandObjectApropos (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "apropos", - "Find a list of debugger commands related to a particular word/subject.", - nullptr) +CommandObjectApropos::CommandObjectApropos(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "apropos", "List debugger commands related to a word or subject.", nullptr) { CommandArgumentEntry arg; CommandArgumentData search_word_arg; Index: source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- source/Commands/CommandObjectBreakpoint.cpp +++ source/Commands/CommandObjectBreakpoint.cpp @@ -1294,18 +1294,20 @@ class CommandObjectBreakpointDisable : public CommandObjectParsed { public: - CommandObjectBreakpointDisable (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "breakpoint disable", - "Disable the specified breakpoint(s) without removing them. If none are specified, disable all breakpoints.", - nullptr) + CommandObjectBreakpointDisable(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "breakpoint disable", "Disable the specified breakpoint(s) without deleting " + "them. If none are specified, disable all " + "breakpoints.", + nullptr) { - SetHelpLong( -"Disable the specified breakpoint(s) without removing them. \ -If none are specified, disable all breakpoints." R"( + SetHelpLong("Disable the specified breakpoint(s) without deleting them. \ +If none are specified, disable all breakpoints." + R"( -)" "Note: disabling a breakpoint will cause none of its locations to be hit \ -regardless of whether they are enabled or disabled. After the sequence:" R"( +)" + "Note: disabling a breakpoint will cause none of its locations to be hit \ +regardless of whether individual locations are enabled or disabled. After the sequence:" + R"( (lldb) break disable 1 (lldb) break enable 1.1 @@ -1315,10 +1317,10 @@ (lldb) break disable 1.* (lldb) break enable 1.1 -)" "The first command disables all the locations of breakpoint 1, \ -the second re-enables the first location." - ); - +)" + "The first command disables all locations for breakpoint 1, \ +the second re-enables the first location."); + CommandArgumentEntry arg; CommandObject::AddIDsArgumentData(arg, eArgTypeBreakpointID, eArgTypeBreakpointIDRange); // Add the entry for the first argument for this command to the object's arguments vector. @@ -1566,7 +1568,7 @@ } else { - result.AppendError ("Invalid breakpoint id."); + result.AppendError("Invalid breakpoint ID."); result.SetStatus (eReturnStatusFailed); } } @@ -1616,12 +1618,11 @@ eClearTypeFileAndLine } BreakpointClearType; - CommandObjectBreakpointClear (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "breakpoint clear", - "Clears a breakpoint or set of breakpoints in the executable.", - "breakpoint clear "), - m_options (interpreter) + CommandObjectBreakpointClear(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "breakpoint clear", + "Delete or disable breakpoints matching the specified source file and line.", + "breakpoint clear "), + m_options(interpreter) { } @@ -1991,13 +1992,13 @@ // CommandObjectBreakpointName //------------------------------------------------------------------------- -static OptionDefinition -g_breakpoint_name_options[] = -{ - { LLDB_OPT_SET_1, false, "name", 'N', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBreakpointName, "Specifies a breakpoint name to use."}, - { LLDB_OPT_SET_2, false, "breakpoint-id", 'B', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBreakpointID, "Specify a breakpoint id to use."}, - { LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, - "Operate on Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."}, +static OptionDefinition g_breakpoint_name_options[] = { + {LLDB_OPT_SET_1, false, "name", 'N', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBreakpointName, + "Specifies a breakpoint name to use."}, + {LLDB_OPT_SET_2, false, "breakpoint-id", 'B', OptionParser::eRequiredArgument, nullptr, nullptr, 0, + eArgTypeBreakpointID, "Specify a breakpoint ID to use."}, + {LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, + "Operate on Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."}, }; class BreakpointNameOptionGroup : public OptionGroup { @@ -2347,11 +2348,9 @@ class CommandObjectBreakpointName : public CommandObjectMultiword { public: - CommandObjectBreakpointName (CommandInterpreter &interpreter) : - CommandObjectMultiword(interpreter, - "name", - "A set of commands to manage name tags for breakpoints", - "breakpoint name []") + CommandObjectBreakpointName(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "name", "Commands to manage name tags for breakpoints", + "breakpoint name []") { CommandObjectSP add_command_object (new CommandObjectBreakpointNameAdd (interpreter)); CommandObjectSP delete_command_object (new CommandObjectBreakpointNameDelete (interpreter)); @@ -2370,11 +2369,10 @@ //------------------------------------------------------------------------- #pragma mark MultiwordBreakpoint -CommandObjectMultiwordBreakpoint::CommandObjectMultiwordBreakpoint (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "breakpoint", - "A set of commands for operating on breakpoints. Also see _regexp-break.", - "breakpoint []") +CommandObjectMultiwordBreakpoint::CommandObjectMultiwordBreakpoint(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "breakpoint", + "Commands for operating on breakpoints (see 'help b' for shorthand.)", + "breakpoint []") { CommandObjectSP list_command_object (new CommandObjectBreakpointList (interpreter)); CommandObjectSP enable_command_object (new CommandObjectBreakpointEnable (interpreter)); @@ -2481,7 +2479,8 @@ else { i = valid_ids->GetSize() + 1; - result.AppendErrorWithFormat ("'%d' is not a currently valid breakpoint id.\n", cur_bp_id.GetBreakpointID()); + result.AppendErrorWithFormat("'%d' is not a currently valid breakpoint ID.\n", + cur_bp_id.GetBreakpointID()); result.SetStatus (eReturnStatusFailed); } } Index: source/Commands/CommandObjectBreakpointCommand.cpp =================================================================== --- source/Commands/CommandObjectBreakpointCommand.cpp +++ source/Commands/CommandObjectBreakpointCommand.cpp @@ -36,14 +36,13 @@ public IOHandlerDelegateMultiline { public: - CommandObjectBreakpointCommandAdd (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "add", - "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit." - " If no breakpoint is specified, adds the commands to the last created breakpoint.", - nullptr), - IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand), - m_options (interpreter) + CommandObjectBreakpointCommandAdd(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "add", + "Add LLDB commands to a breakpoint, to be executed whenever the breakpoint is hit." + " If no breakpoint is specified, adds the commands to the last created breakpoint.", + nullptr), + IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand), + m_options(interpreter) { SetHelpLong ( R"( @@ -855,11 +854,11 @@ // CommandObjectBreakpointCommand //------------------------------------------------------------------------- -CommandObjectBreakpointCommand::CommandObjectBreakpointCommand (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "command", - "A set of commands for adding, removing and examining bits of code to be executed when the breakpoint is hit (breakpoint 'commands').", - "command [] ") +CommandObjectBreakpointCommand::CommandObjectBreakpointCommand(CommandInterpreter &interpreter) + : CommandObjectMultiword( + interpreter, "command", + "Commands for adding, removing and listing LLDB commands executed when a breakpoint is hit.", + "command [] ") { CommandObjectSP add_command_object (new CommandObjectBreakpointCommandAdd (interpreter)); CommandObjectSP delete_command_object (new CommandObjectBreakpointCommandDelete (interpreter)); Index: source/Commands/CommandObjectBugreport.cpp =================================================================== --- source/Commands/CommandObjectBugreport.cpp +++ source/Commands/CommandObjectBugreport.cpp @@ -130,11 +130,9 @@ // CommandObjectMultiwordBugreport //------------------------------------------------------------------------- -CommandObjectMultiwordBugreport::CommandObjectMultiwordBugreport(CommandInterpreter &interpreter) : - CommandObjectMultiword(interpreter, - "bugreport", - "Set of commands for creating domain specific bugreports.", - "bugreport []") +CommandObjectMultiwordBugreport::CommandObjectMultiwordBugreport(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "bugreport", "Commands for creating domain-specific bug reports.", + "bugreport []") { LoadSubCommand("unwind", CommandObjectSP(new CommandObjectBugreportUnwind(interpreter))); Index: source/Commands/CommandObjectCommands.cpp =================================================================== --- source/Commands/CommandObjectCommands.cpp +++ source/Commands/CommandObjectCommands.cpp @@ -235,12 +235,10 @@ class CommandObjectCommandsSource : public CommandObjectParsed { public: - CommandObjectCommandsSource(CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "command source", - "Read in debugger commands from the file and execute them.", - nullptr), - m_options (interpreter) + CommandObjectCommandsSource(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "command source", "Read and execute LLDB commands from the file .", + nullptr), + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData file_arg; @@ -508,13 +506,11 @@ return &m_option_group; } - CommandObjectCommandsAlias (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "command alias", - "Allow users to define their own debugger command abbreviations.", - nullptr), - m_option_group(interpreter), - m_command_options() + CommandObjectCommandsAlias(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "command alias", "Define a custom command in terms of an existing command.", + nullptr), + m_option_group(interpreter), + m_command_options() { m_option_group.Append(&m_command_options); m_option_group.Finalize(); @@ -924,11 +920,9 @@ class CommandObjectCommandsUnalias : public CommandObjectParsed { public: - CommandObjectCommandsUnalias (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "command unalias", - "Allow the user to remove/delete a user-defined command abbreviation.", - nullptr) + CommandObjectCommandsUnalias(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "command unalias", + "Delete one or more custom commands defined by 'command alias'.", nullptr) { CommandArgumentEntry arg; CommandArgumentData alias_arg; @@ -1014,11 +1008,9 @@ class CommandObjectCommandsDelete : public CommandObjectParsed { public: - CommandObjectCommandsDelete (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "command delete", - "Allow the user to delete user-defined regular expression, python or multi-word commands.", - nullptr) + CommandObjectCommandsDelete(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "command delete", + "Delete one or more custom commands defined by 'command regex'.", nullptr) { CommandArgumentEntry arg; CommandArgumentData alias_arg; @@ -1075,7 +1067,9 @@ } else { - result.AppendErrorWithFormat ("must call '%s' with one or more valid user defined regular expression, python or multi-word command names", GetCommandName ()); + result.AppendErrorWithFormat( + "must call '%s' with one or more valid user defined regular expression command names", + GetCommandName()); result.SetStatus (eReturnStatusFailed); } @@ -1093,13 +1087,12 @@ public IOHandlerDelegateMultiline { public: - CommandObjectCommandsAddRegex (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "command regex", - "Allow the user to create a regular expression command.", - "command regex [s/// ...]"), - IOHandlerDelegateMultiline ("", IOHandlerDelegate::Completion::LLDBCommand), - m_options (interpreter) + CommandObjectCommandsAddRegex(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "command regex", + "Define a custom command in terms of existing commands by matching regular expressions.", + "command regex [s/// ...]"), + IOHandlerDelegateMultiline("", IOHandlerDelegate::Completion::LLDBCommand), + m_options(interpreter) { SetHelpLong(R"( )" "This command allows the user to create powerful regular expression commands \ @@ -2266,11 +2259,10 @@ class CommandObjectMultiwordCommandsScript : public CommandObjectMultiword { public: - CommandObjectMultiwordCommandsScript (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "command script", - "A set of commands for managing or customizing script commands.", - "command script []") + CommandObjectMultiwordCommandsScript(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "command script", + "Commands for managing custom commands implemented by interpreter scripts.", + "command script []") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectCommandsScriptAdd (interpreter))); LoadSubCommand ("delete", CommandObjectSP (new CommandObjectCommandsScriptDelete (interpreter))); @@ -2288,11 +2280,9 @@ // CommandObjectMultiwordCommands //------------------------------------------------------------------------- -CommandObjectMultiwordCommands::CommandObjectMultiwordCommands (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "command", - "A set of commands for managing or customizing the debugger commands.", - "command []") +CommandObjectMultiwordCommands::CommandObjectMultiwordCommands(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "command", "Commands for managing custom LLDB commands.", + "command []") { LoadSubCommand ("source", CommandObjectSP (new CommandObjectCommandsSource (interpreter))); LoadSubCommand ("alias", CommandObjectSP (new CommandObjectCommandsAlias (interpreter))); Index: source/Commands/CommandObjectDisassemble.cpp =================================================================== --- source/Commands/CommandObjectDisassemble.cpp +++ source/Commands/CommandObjectDisassemble.cpp @@ -257,12 +257,12 @@ // CommandObjectDisassemble //------------------------------------------------------------------------- -CommandObjectDisassemble::CommandObjectDisassemble (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "disassemble", - "Disassemble bytes in the current function, or elsewhere in the executable program as specified by the user.", - "disassemble []"), - m_options (interpreter) +CommandObjectDisassemble::CommandObjectDisassemble(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "disassemble", "Disassemble specified instructions in the current target. " + "Defaults to the current function for the current thread and " + "stack frame.", + "disassemble []"), + m_options(interpreter) { } Index: source/Commands/CommandObjectExpression.cpp =================================================================== --- source/Commands/CommandObjectExpression.cpp +++ source/Commands/CommandObjectExpression.cpp @@ -219,19 +219,18 @@ return g_option_table; } -CommandObjectExpression::CommandObjectExpression (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "expression", - "Evaluate an expression in the current program context, using user defined variables and variables currently in scope.", - nullptr, - eCommandProcessMustBePaused | eCommandTryTargetAPILock), - IOHandlerDelegate (IOHandlerDelegate::Completion::Expression), - m_option_group (interpreter), - m_format_options (eFormatDefault), - m_repl_option (LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false, true), - m_command_options (), - m_expr_line_count (0), - m_expr_lines () +CommandObjectExpression::CommandObjectExpression(CommandInterpreter &interpreter) + : CommandObjectRaw( + interpreter, "expression", + "Evaluate an expression on the current thread. Displays any returned value with LLDB's default formatting.", + nullptr, eCommandProcessMustBePaused | eCommandTryTargetAPILock), + IOHandlerDelegate(IOHandlerDelegate::Completion::Expression), + m_option_group(interpreter), + m_format_options(eFormatDefault), + m_repl_option(LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false, true), + m_command_options(), + m_expr_line_count(0), + m_expr_lines() { SetHelpLong( R"( Index: source/Commands/CommandObjectFrame.cpp =================================================================== --- source/Commands/CommandObjectFrame.cpp +++ source/Commands/CommandObjectFrame.cpp @@ -58,15 +58,11 @@ class CommandObjectFrameInfo : public CommandObjectParsed { public: - CommandObjectFrameInfo (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "frame info", - "List information about the currently selected frame in the current thread.", - "frame info", - eCommandRequiresFrame | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ) + CommandObjectFrameInfo(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "frame info", + "List information about the current stack frame in the current thread.", "frame info", + eCommandRequiresFrame | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused) { } @@ -141,17 +137,14 @@ static OptionDefinition g_option_table[]; int32_t relative_frame_offset; }; - - CommandObjectFrameSelect (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "frame select", - "Select a frame by index from within the current thread and make it the current frame.", - nullptr, - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ), - m_options (interpreter) + + CommandObjectFrameSelect(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "frame select", + "Select the current stack frame by index from within the current thread (see 'thread backtrace'.)", + nullptr, eCommandRequiresThread | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused), + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData index_arg; @@ -199,7 +192,7 @@ if (frame_idx == 0) { //If you are already at the bottom of the stack, then just warn and don't reset the frame. - result.AppendError("Already at the bottom of the stack"); + result.AppendError("Already at the bottom of the stack."); result.SetStatus(eReturnStatusFailed); return false; } @@ -219,7 +212,7 @@ if (frame_idx == num_frames - 1) { //If we are already at the top of the stack, just warn and don't reset the frame. - result.AppendError("Already at the top of the stack"); + result.AppendError("Already at the top of the stack."); result.SetStatus(eReturnStatusFailed); return false; } @@ -237,7 +230,7 @@ frame_idx = StringConvert::ToUInt32 (frame_idx_cstr, UINT32_MAX, 0, &success); if (!success) { - result.AppendErrorWithFormat ("invalid frame index argument '%s'", frame_idx_cstr); + result.AppendErrorWithFormat("invalid frame index argument '%s'.", frame_idx_cstr); result.SetStatus (eReturnStatusFailed); return false; } @@ -292,25 +285,19 @@ class CommandObjectFrameVariable : public CommandObjectParsed { public: - CommandObjectFrameVariable (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "frame variable", - "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'.", - nullptr, - eCommandRequiresFrame | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused | - eCommandRequiresProcess), - m_option_group (interpreter), - m_option_variable(true), // Include the frame specific options by passing "true" - m_option_format (eFormatDefault), - m_varobj_options() + CommandObjectFrameVariable(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "frame variable", "Show variables related to a stack frame. Defaults to all " + "arguments and local variables in scope. Names of argument, " + "local, file static and file global variables can be specified. " + "Children of aggregate variables can be specified such as " + "'var->child.x'.", + nullptr, eCommandRequiresFrame | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused | eCommandRequiresProcess), + m_option_group(interpreter), + m_option_variable(true), // Include the frame specific options by passing "true" + m_option_format(eFormatDefault), + m_varobj_options() { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -495,7 +482,9 @@ if (error_cstr) result.GetErrorStream().Printf("error: %s\n", error_cstr); else - result.GetErrorStream().Printf ("error: unable to find any variable expression path that matches '%s'\n", name_cstr); + result.GetErrorStream().Printf( + "error: unable to find any variable expression path that matches '%s'.\n", + name_cstr); } } } @@ -612,11 +601,10 @@ // CommandObjectMultiwordFrame //------------------------------------------------------------------------- -CommandObjectMultiwordFrame::CommandObjectMultiwordFrame (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "frame", - "A set of commands for operating on the current thread's frames.", - "frame []") +CommandObjectMultiwordFrame::CommandObjectMultiwordFrame(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "frame", + "Commands for selecting and examing the current thread's stack frames.", + "frame []") { LoadSubCommand ("info", CommandObjectSP (new CommandObjectFrameInfo (interpreter))); LoadSubCommand ("select", CommandObjectSP (new CommandObjectFrameSelect (interpreter))); Index: source/Commands/CommandObjectHelp.cpp =================================================================== --- source/Commands/CommandObjectHelp.cpp +++ source/Commands/CommandObjectHelp.cpp @@ -49,11 +49,11 @@ } } -CommandObjectHelp::CommandObjectHelp (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "help", - "Show a list of all debugger commands, or give details about specific commands.", - "help []"), m_options (interpreter) +CommandObjectHelp::CommandObjectHelp(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "help", + "Show a list of all debugger commands, or give details about a specific command.", + "help []"), + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData command_arg; Index: source/Commands/CommandObjectLanguage.h =================================================================== --- source/Commands/CommandObjectLanguage.h +++ source/Commands/CommandObjectLanguage.h @@ -27,9 +27,6 @@ ~CommandObjectLanguage() override; - void - GenerateHelpText(Stream &output_stream) override; - protected: bool DoExecute (Args& command, CommandReturnObject &result); Index: source/Commands/CommandObjectLanguage.cpp =================================================================== --- source/Commands/CommandObjectLanguage.cpp +++ source/Commands/CommandObjectLanguage.cpp @@ -20,22 +20,14 @@ using namespace lldb; using namespace lldb_private; -CommandObjectLanguage::CommandObjectLanguage (CommandInterpreter &interpreter) : -CommandObjectMultiword (interpreter, - "language", - "A set of commands for managing language-specific functionality.'.", - "language []" - ) +CommandObjectLanguage::CommandObjectLanguage(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "language", "Commands specific to a source language.", + "language []") { //Let the LanguageRuntime populates this command with subcommands LanguageRuntime::InitializeCommands(this); } -void -CommandObjectLanguage::GenerateHelpText (Stream &output_stream) { - CommandObjectMultiword::GenerateHelpText(output_stream); -} - CommandObjectLanguage::~CommandObjectLanguage () { } Index: source/Commands/CommandObjectLog.cpp =================================================================== --- source/Commands/CommandObjectLog.cpp +++ source/Commands/CommandObjectLog.cpp @@ -451,11 +451,9 @@ } }; -CommandObjectLog::CommandObjectLog(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "log", - "A set of commands for operating on logs.", - "log []") +CommandObjectLog::CommandObjectLog(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "log", "Commands controlling LLDB internal logging.", + "log []") { LoadSubCommand ("enable", CommandObjectSP (new CommandObjectLogEnable (interpreter))); LoadSubCommand ("disable", CommandObjectSP (new CommandObjectLogDisable (interpreter))); Index: source/Commands/CommandObjectMemory.cpp =================================================================== --- source/Commands/CommandObjectMemory.cpp +++ source/Commands/CommandObjectMemory.cpp @@ -205,9 +205,11 @@ if (byte_size_option_set) { if (byte_size_value > 1) - error.SetErrorStringWithFormat ("display format (bytes/bytes with ascii) conflicts with the specified byte size %" PRIu64 "\n" - "\tconsider using a different display format or don't specify the byte size", - byte_size_value.GetCurrentValue()); + error.SetErrorStringWithFormat( + "display format (bytes/bytes with ASCII) conflicts with the specified byte size %" PRIu64 + "\n" + "\tconsider using a different display format or don't specify the byte size.", + byte_size_value.GetCurrentValue()); } else byte_size_value = 1; @@ -318,23 +320,20 @@ class CommandObjectMemoryRead : public CommandObjectParsed { public: - CommandObjectMemoryRead (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "memory read", - "Read from the memory of the process being debugged.", - nullptr, - eCommandRequiresTarget | eCommandProcessMustBePaused), - m_option_group (interpreter), - m_format_options (eFormatBytesWithASCII, 1, 8), - m_memory_options (), - m_outfile_options (), - m_varobj_options(), - m_next_addr(LLDB_INVALID_ADDRESS), - m_prev_byte_size(0), - m_prev_format_options (eFormatBytesWithASCII, 1, 8), - m_prev_memory_options (), - m_prev_outfile_options (), - m_prev_varobj_options() + CommandObjectMemoryRead(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "memory read", "Read from the memory of the current target process.", + nullptr, eCommandRequiresTarget | eCommandProcessMustBePaused), + m_option_group(interpreter), + m_format_options(eFormatBytesWithASCII, 1, 8), + m_memory_options(), + m_outfile_options(), + m_varobj_options(), + m_next_addr(LLDB_INVALID_ADDRESS), + m_prev_byte_size(0), + m_prev_format_options(eFormatBytesWithASCII, 1, 8), + m_prev_memory_options(), + m_prev_outfile_options(), + m_prev_varobj_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -1041,15 +1040,12 @@ OptionValueUInt64 m_count; OptionValueUInt64 m_offset; }; - - CommandObjectMemoryFind (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "memory find", - "Find a value in the memory of the process being debugged.", - nullptr, - eCommandRequiresProcess | eCommandProcessMustBeLaunched), - m_option_group (interpreter), - m_memory_options () + + CommandObjectMemoryFind(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "memory find", "Find a value in the memory of the current target process.", + nullptr, eCommandRequiresProcess | eCommandProcessMustBeLaunched), + m_option_group(interpreter), + m_memory_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -1325,15 +1321,12 @@ off_t m_infile_offset; }; - CommandObjectMemoryWrite (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "memory write", - "Write to the memory of the process being debugged.", - nullptr, - eCommandRequiresProcess | eCommandProcessMustBeLaunched), - m_option_group (interpreter), - m_format_options (eFormatBytes, 1, UINT64_MAX), - m_memory_options () + CommandObjectMemoryWrite(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "memory write", "Write to the memory of the current target process.", + nullptr, eCommandRequiresProcess | eCommandProcessMustBeLaunched), + m_option_group(interpreter), + m_format_options(eFormatBytes, 1, UINT64_MAX), + m_memory_options() { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -1687,13 +1680,12 @@ class CommandObjectMemoryHistory : public CommandObjectParsed { public: - CommandObjectMemoryHistory (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "memory history", - "Prints out the recorded stack traces for allocation/deallocation of a memory address.", - nullptr, - eCommandRequiresTarget | eCommandRequiresProcess | eCommandProcessMustBePaused | - eCommandProcessMustBeLaunched) + CommandObjectMemoryHistory(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "memory history", + "Print recorded stack traces for allocation/deallocation events associated with an address.", nullptr, + eCommandRequiresTarget | eCommandRequiresProcess | eCommandProcessMustBePaused | + eCommandProcessMustBeLaunched) { CommandArgumentEntry arg1; CommandArgumentData addr_arg; @@ -1777,10 +1769,10 @@ { public: CommandObjectMemoryRegion(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "memory region", - "Get information on a memory region that contains an address in the current process.", - "memory region ADDR", - eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched), + : CommandObjectParsed( + interpreter, "memory region", + "Get information on the memory region containing an address in the current target process.", + "memory region ADDR", eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched), m_prev_end_addr(LLDB_INVALID_ADDRESS) { } @@ -1875,11 +1867,9 @@ // CommandObjectMemory //------------------------------------------------------------------------- -CommandObjectMemory::CommandObjectMemory (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "memory", - "A set of commands for operating on memory.", - "memory []") +CommandObjectMemory::CommandObjectMemory(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "memory", "Commands for operating on memory in the current target process.", + "memory []") { LoadSubCommand("find", CommandObjectSP(new CommandObjectMemoryFind(interpreter))); LoadSubCommand("read", CommandObjectSP(new CommandObjectMemoryRead(interpreter))); Index: source/Commands/CommandObjectMultiword.cpp =================================================================== --- source/Commands/CommandObjectMultiword.cpp +++ source/Commands/CommandObjectMultiword.cpp @@ -178,7 +178,8 @@ // First time through here, generate the help text for the object and // push it to the return result object as well - output_stream.PutCString ("The following subcommands are supported:\n\n"); + CommandObject::GenerateHelpText(output_stream); + output_stream.PutCString("\nThe following subcommands are supported:\n\n"); CommandMap::iterator pos; uint32_t max_len = FindLongestCommandWord (m_subcommand_dict); @@ -193,7 +194,7 @@ if (pos->second->WantsRawCommandString ()) { std::string help_text (pos->second->GetHelp()); - help_text.append (" This command takes 'raw' input (no need to quote stuff)."); + help_text.append(" Expects 'raw' input (see 'help raw-input'.)"); m_interpreter.OutputFormattedHelpText (output_stream, indented_command.c_str(), "--", Index: source/Commands/CommandObjectPlatform.cpp =================================================================== --- source/Commands/CommandObjectPlatform.cpp +++ source/Commands/CommandObjectPlatform.cpp @@ -329,12 +329,8 @@ class CommandObjectPlatformStatus : public CommandObjectParsed { public: - CommandObjectPlatformStatus (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "platform status", - "Display status for the currently selected platform.", - nullptr, - 0) + CommandObjectPlatformStatus(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "platform status", "Display status for the current platform.", nullptr, 0) { } @@ -376,12 +372,10 @@ class CommandObjectPlatformConnect : public CommandObjectParsed { public: - CommandObjectPlatformConnect (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "platform connect", - "Connect a platform by name to be the currently selected platform.", - "platform connect ", - 0) + CommandObjectPlatformConnect(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "platform connect", + "Select the current platform by providing a connection URL.", + "platform connect ", 0) { } @@ -444,12 +438,9 @@ class CommandObjectPlatformDisconnect : public CommandObjectParsed { public: - CommandObjectPlatformDisconnect (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "platform disconnect", - "Disconnect a platform by name to be the currently selected platform.", - "platform disconnect", - 0) + CommandObjectPlatformDisconnect(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "platform disconnect", "Disconnect from the current platform.", + "platform disconnect", 0) { } @@ -995,11 +986,9 @@ //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ - CommandObjectPlatformFile (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "platform file", - "A set of commands to manage file access through a platform", - "platform file [open|close|read|write] ...") + CommandObjectPlatformFile(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "platform file", "Commands to access files on the current platform.", + "platform file [open|close|read|write] ...") { LoadSubCommand ("open", CommandObjectSP (new CommandObjectPlatformFOpen (interpreter))); LoadSubCommand ("close", CommandObjectSP (new CommandObjectPlatformFClose (interpreter))); @@ -1930,11 +1919,10 @@ //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ - CommandObjectPlatformProcess (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "platform process", - "A set of commands to query, launch and attach to platform processes", - "platform process [attach|launch|list] ...") + CommandObjectPlatformProcess(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "platform process", + "Commands to query, launch and attach to processes on the current platform.", + "platform process [attach|launch|list] ...") { LoadSubCommand ("attach", CommandObjectSP (new CommandObjectPlatformProcessAttach (interpreter))); LoadSubCommand ("launch", CommandObjectSP (new CommandObjectPlatformProcessLaunch (interpreter))); @@ -2016,14 +2004,11 @@ static OptionDefinition g_option_table[]; uint32_t timeout; }; - - CommandObjectPlatformShell (CommandInterpreter &interpreter) : - CommandObjectRaw (interpreter, - "platform shell", - "Run a shell command on the selected platform.", - "platform shell ", - 0), - m_options(interpreter) + + CommandObjectPlatformShell(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "platform shell", "Run a shell command on the current platform.", + "platform shell ", 0), + m_options(interpreter) { } @@ -2192,11 +2177,9 @@ } }; -CommandObjectPlatform::CommandObjectPlatform(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "platform", - "A set of commands to manage and create platforms.", - "platform [connect|disconnect|info|list|status|select] ...") +CommandObjectPlatform::CommandObjectPlatform(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "platform", "Commands to manage and create platforms.", + "platform [connect|disconnect|info|list|status|select] ...") { LoadSubCommand ("select", CommandObjectSP (new CommandObjectPlatformSelect (interpreter))); LoadSubCommand ("list" , CommandObjectSP (new CommandObjectPlatformList (interpreter))); Index: source/Commands/CommandObjectPlugin.cpp =================================================================== --- source/Commands/CommandObjectPlugin.cpp +++ source/Commands/CommandObjectPlugin.cpp @@ -99,11 +99,9 @@ } }; -CommandObjectPlugin::CommandObjectPlugin (CommandInterpreter &interpreter) : -CommandObjectMultiword (interpreter, - "plugin", - "A set of commands for managing or customizing plugin commands.", - "plugin []") +CommandObjectPlugin::CommandObjectPlugin(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "plugin", "Commands for managing LLDB plugins.", + "plugin []") { LoadSubCommand ("load", CommandObjectSP (new CommandObjectPluginLoad (interpreter))); } Index: source/Commands/CommandObjectProcess.cpp =================================================================== --- source/Commands/CommandObjectProcess.cpp +++ source/Commands/CommandObjectProcess.cpp @@ -875,15 +875,11 @@ LazyBool m_keep_stopped; }; - CommandObjectProcessDetach (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "process detach", - "Detach from the current process being debugged.", - "process detach", - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched), - m_options(interpreter) + CommandObjectProcessDetach(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "process detach", "Detach from the current target process.", + "process detach", + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched), + m_options(interpreter) { } @@ -1075,12 +1071,9 @@ class CommandObjectProcessPlugin : public CommandObjectProxy { public: - CommandObjectProcessPlugin (CommandInterpreter &interpreter) : - CommandObjectProxy (interpreter, - "process plugin", - "Send a custom command to the current process plug-in.", - "process plugin ", - 0) + CommandObjectProcessPlugin(CommandInterpreter &interpreter) + : CommandObjectProxy(interpreter, "process plugin", + "Send a custom command to the current target process plug-in.", "process plugin ", 0) { } @@ -1302,12 +1295,9 @@ class CommandObjectProcessSignal : public CommandObjectParsed { public: - CommandObjectProcessSignal (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "process signal", - "Send a UNIX signal to the current process being debugged.", - nullptr, - eCommandRequiresProcess | eCommandTryTargetAPILock) + CommandObjectProcessSignal(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "process signal", "Send a UNIX signal to the current target process.", + nullptr, eCommandRequiresProcess | eCommandTryTargetAPILock) { CommandArgumentEntry arg; CommandArgumentData signal_arg; @@ -1378,14 +1368,10 @@ class CommandObjectProcessInterrupt : public CommandObjectParsed { public: - CommandObjectProcessInterrupt (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "process interrupt", - "Interrupt the current process being debugged.", - "process interrupt", - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched) + CommandObjectProcessInterrupt(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "process interrupt", "Interrupt the current target process.", + "process interrupt", + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched) { } @@ -1436,14 +1422,9 @@ class CommandObjectProcessKill : public CommandObjectParsed { public: - CommandObjectProcessKill (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "process kill", - "Terminate the current process being debugged.", - "process kill", - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched) + CommandObjectProcessKill(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "process kill", "Terminate the current target process.", "process kill", + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched) { } @@ -1555,12 +1536,10 @@ class CommandObjectProcessStatus : public CommandObjectParsed { public: - CommandObjectProcessStatus (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "process status", - "Show the current status and location of executing process.", - "process status", - eCommandRequiresProcess | eCommandTryTargetAPILock) + CommandObjectProcessStatus(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "process status", + "Show status and stop location for the current target process.", "process status", + eCommandRequiresProcess | eCommandTryTargetAPILock) { } @@ -1655,12 +1634,12 @@ std::string pass; }; - CommandObjectProcessHandle (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "process handle", - "Show or update what the process and debugger should do with various signals received from the OS.", - nullptr), - m_options (interpreter) + CommandObjectProcessHandle(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "process handle", + "Manage LLDB handling of OS signals for the current target process. Defaults to showing current policy.", + nullptr), + m_options(interpreter) { SetHelpLong ("\nIf no signals are specified, update them all. If no update " "option is specified, list the current values."); @@ -1889,11 +1868,9 @@ // CommandObjectMultiwordProcess //------------------------------------------------------------------------- -CommandObjectMultiwordProcess::CommandObjectMultiwordProcess (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "process", - "A set of commands for operating on a process.", - "process []") +CommandObjectMultiwordProcess::CommandObjectMultiwordProcess(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "process", "Commands for interacting with processes on the current platform.", + "process []") { LoadSubCommand ("attach", CommandObjectSP (new CommandObjectProcessAttach (interpreter))); LoadSubCommand ("launch", CommandObjectSP (new CommandObjectProcessLaunch (interpreter))); Index: source/Commands/CommandObjectQuit.cpp =================================================================== --- source/Commands/CommandObjectQuit.cpp +++ source/Commands/CommandObjectQuit.cpp @@ -24,8 +24,8 @@ // CommandObjectQuit //------------------------------------------------------------------------- -CommandObjectQuit::CommandObjectQuit (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, "quit", "Quit out of the LLDB debugger.", "quit") +CommandObjectQuit::CommandObjectQuit(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "quit", "Quit the LLDB debugger.", "quit") { } Index: source/Commands/CommandObjectRegister.cpp =================================================================== --- source/Commands/CommandObjectRegister.cpp +++ source/Commands/CommandObjectRegister.cpp @@ -467,11 +467,10 @@ //---------------------------------------------------------------------- // CommandObjectRegister constructor //---------------------------------------------------------------------- -CommandObjectRegister::CommandObjectRegister(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "register", - "A set of commands to access thread registers.", - "register [read|write] ...") +CommandObjectRegister::CommandObjectRegister(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "register", + "Commands to access registers for the current thread and stack frame.", + "register [read|write] ...") { LoadSubCommand ("read", CommandObjectSP (new CommandObjectRegisterRead (interpreter))); LoadSubCommand ("write", CommandObjectSP (new CommandObjectRegisterWrite (interpreter))); Index: source/Commands/CommandObjectSettings.cpp =================================================================== --- source/Commands/CommandObjectSettings.cpp +++ source/Commands/CommandObjectSettings.cpp @@ -30,12 +30,9 @@ class CommandObjectSettingsSet : public CommandObjectRaw { public: - CommandObjectSettingsSet (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings set", - "Set or change the value of a single debugger setting variable.", - nullptr), - m_options (interpreter) + CommandObjectSettingsSet(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings set", "Set the value of the specified debugger setting.", nullptr), + m_options(interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -298,11 +295,10 @@ class CommandObjectSettingsShow : public CommandObjectParsed { public: - CommandObjectSettingsShow (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "settings show", - "Show the specified internal debugger setting variable and its value, or show all the currently set variables and their values, if nothing is specified.", - nullptr) + CommandObjectSettingsShow(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "settings show", + "Show matching debugger settings and their current values. Defaults to showing all settings.", nullptr) { CommandArgumentEntry arg1; CommandArgumentData var_name_arg; @@ -383,12 +379,11 @@ class CommandObjectSettingsList : public CommandObjectParsed { -public: - CommandObjectSettingsList (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "settings list", - "List and describe all the internal debugger settings variables that are available to the user to 'set' or 'show', or describe a particular variable or set of variables (by specifying the variable name or a common prefix).", - nullptr) +public: + CommandObjectSettingsList(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "settings list", + "List and describe matching debugger settings. Defaults to all listing all settings.", + nullptr) { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -479,11 +474,9 @@ class CommandObjectSettingsRemove : public CommandObjectRaw { public: - CommandObjectSettingsRemove (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings remove", - "Remove the specified element from an array or dictionary settings variable.", - nullptr) + CommandObjectSettingsRemove(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings remove", + "Remove a value from a setting, specified by array index or dictionary key.", nullptr) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -598,11 +591,9 @@ class CommandObjectSettingsReplace : public CommandObjectRaw { public: - CommandObjectSettingsReplace (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings replace", - "Replace the specified element from an internal debugger settings array or dictionary variable with the specified new value.", - nullptr) + CommandObjectSettingsReplace(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings replace", + "Replace the debugger setting value specified by array index or dictionary key.", nullptr) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -723,11 +714,11 @@ class CommandObjectSettingsInsertBefore : public CommandObjectRaw { public: - CommandObjectSettingsInsertBefore (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings insert-before", - "Insert value(s) into an internal debugger settings array variable, immediately before the specified element.", - nullptr) + CommandObjectSettingsInsertBefore(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings insert-before", "Insert one or more values into an debugger array " + "setting immediately before the specified element " + "index.", + nullptr) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -846,11 +837,10 @@ class CommandObjectSettingsInsertAfter : public CommandObjectRaw { public: - CommandObjectSettingsInsertAfter (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings insert-after", - "Insert value(s) into an internal debugger settings array variable, immediately after the specified element.", - nullptr) + CommandObjectSettingsInsertAfter(CommandInterpreter &interpreter) + : CommandObjectRaw( + interpreter, "settings insert-after", + "Insert one or more values into a debugger array settings after the specified element index.", nullptr) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -969,11 +959,9 @@ class CommandObjectSettingsAppend : public CommandObjectRaw { public: - CommandObjectSettingsAppend (CommandInterpreter &interpreter) : - CommandObjectRaw(interpreter, - "settings append", - "Append a new value to the end of an internal debugger settings array, dictionary or string variable.", - nullptr) + CommandObjectSettingsAppend(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings append", + "Append one or more values to a debugger array, dictionary, or string setting.", nullptr) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -1084,11 +1072,9 @@ class CommandObjectSettingsClear : public CommandObjectParsed { public: - CommandObjectSettingsClear (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "settings clear", - "Erase all the contents of an internal debugger settings variables; this is only valid for variables with clearable types, i.e. strings, arrays or dictionaries.", - nullptr) + CommandObjectSettingsClear(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "settings clear", "Clear a debugger setting array, dictionary, or string.", + nullptr) { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -1173,11 +1159,9 @@ // CommandObjectMultiwordSettings //------------------------------------------------------------------------- -CommandObjectMultiwordSettings::CommandObjectMultiwordSettings (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "settings", - "A set of commands for manipulating internal settable debugger variables.", - "settings []") +CommandObjectMultiwordSettings::CommandObjectMultiwordSettings(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "settings", "Commands for managing LLDB settings.", + "settings []") { LoadSubCommand ("set", CommandObjectSP (new CommandObjectSettingsSet (interpreter))); LoadSubCommand ("show", CommandObjectSP (new CommandObjectSettingsShow (interpreter))); Index: source/Commands/CommandObjectSource.cpp =================================================================== --- source/Commands/CommandObjectSource.cpp +++ source/Commands/CommandObjectSource.cpp @@ -132,14 +132,12 @@ }; public: - CommandObjectSourceInfo (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "source info", - "Display source line information (as specified) based " - "on the current executable's debug info.", - nullptr, - eCommandRequiresTarget), - m_options(interpreter) + CommandObjectSourceInfo(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "source info", "Display source line information for the current target " + "process. Defaults to instruction pointer in current stack " + "frame.", + nullptr, eCommandRequiresTarget), + m_options(interpreter) { } @@ -821,15 +819,13 @@ bool show_bp_locs; bool reverse; }; - -public: - CommandObjectSourceList(CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "source list", - "Display source code (as specified) based on the current executable's debug info.", - nullptr, - eCommandRequiresTarget), - m_options (interpreter) + +public: + CommandObjectSourceList(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "source list", + "Display source code for the current target process as specified by options.", nullptr, + eCommandRequiresTarget), + m_options(interpreter) { } @@ -1482,11 +1478,11 @@ // CommandObjectMultiwordSource //------------------------------------------------------------------------- -CommandObjectMultiwordSource::CommandObjectMultiwordSource (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "source", - "A set of commands for accessing source file information", - "source []") +CommandObjectMultiwordSource::CommandObjectMultiwordSource(CommandInterpreter &interpreter) + : CommandObjectMultiword( + interpreter, "source", + "Commands for examining source code described by debug information for the current target process.", + "source []") { LoadSubCommand ("info", CommandObjectSP (new CommandObjectSourceInfo (interpreter))); LoadSubCommand ("list", CommandObjectSP (new CommandObjectSourceList (interpreter))); Index: source/Commands/CommandObjectTarget.cpp =================================================================== --- source/Commands/CommandObjectTarget.cpp +++ source/Commands/CommandObjectTarget.cpp @@ -724,22 +724,20 @@ static const uint32_t SHORT_OPTION_SHLB = 0x73686c62; // 'shlb' public: - CommandObjectTargetVariable (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "target variable", - "Read global variable(s) prior to, or while running your binary.", - nullptr, - eCommandRequiresTarget), - m_option_group (interpreter), - m_option_variable (false), // Don't include frame options - m_option_format (eFormatDefault), - m_option_compile_units (LLDB_OPT_SET_1, false, "file", - SHORT_OPTION_FILE, 0, eArgTypeFilename, - "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."), - m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib", - SHORT_OPTION_SHLB, 0, eArgTypeFilename, - "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."), - m_varobj_options() + CommandObjectTargetVariable(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "target variable", + "Read global variables for the current target, before or while running a process.", + nullptr, eCommandRequiresTarget), + m_option_group(interpreter), + m_option_variable(false), // Don't include frame options + m_option_format(eFormatDefault), + m_option_compile_units(LLDB_OPT_SET_1, false, "file", SHORT_OPTION_FILE, 0, eArgTypeFilename, + "A basename or fullpath to a file that contains global variables. This option can be " + "specified multiple times."), + m_option_shared_libraries(LLDB_OPT_SET_1, false, "shlib", SHORT_OPTION_SHLB, 0, eArgTypeFilename, + "A basename or fullpath to a shared library to use in the search for global " + "variables. This option can be specified multiple times."), + m_varobj_options() { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -2685,8 +2683,7 @@ //------------------------------------------------------------------ CommandObjectTargetModulesDump(CommandInterpreter &interpreter) : CommandObjectMultiword( - interpreter, "target modules dump", - "A set of commands for dumping information about one or more target modules.", + interpreter, "target modules dump", "Commands for dumping information about one or more target modules.", "target modules dump [headers|symtab|sections|symfile|line-table] [ ...]") { LoadSubCommand("objfile", CommandObjectSP(new CommandObjectTargetModulesDumpObjfile(interpreter))); @@ -4336,11 +4333,10 @@ class CommandObjectTargetModulesImageSearchPaths : public CommandObjectMultiword { public: - CommandObjectTargetModulesImageSearchPaths (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "target modules search-paths", - "A set of commands for operating on debugger target image search paths.", - "target modules search-paths []") + CommandObjectTargetModulesImageSearchPaths(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "target modules search-paths", + "Commands for managing module search paths for a target.", + "target modules search-paths []") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetModulesSearchPathsAdd (interpreter))); LoadSubCommand ("clear", CommandObjectSP (new CommandObjectTargetModulesSearchPathsClear (interpreter))); @@ -4364,11 +4360,10 @@ //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ - CommandObjectTargetModules(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "target modules", - "A set of commands for accessing information for one or more target modules.", - "target modules ...") + CommandObjectTargetModules(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "target modules", + "Commands for accessing information for one or more target modules.", + "target modules ...") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetModulesAdd (interpreter))); LoadSubCommand ("load", CommandObjectSP (new CommandObjectTargetModulesLoad (interpreter))); @@ -4822,11 +4817,9 @@ //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ - CommandObjectTargetSymbols(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "target symbols", - "A set of commands for adding and managing debug symbol files.", - "target symbols ...") + CommandObjectTargetSymbols(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "target symbols", "Commands for adding and managing debug symbol files.", + "target symbols ...") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetSymbolsAdd (interpreter))); } @@ -5403,11 +5396,10 @@ class CommandObjectMultiwordTargetStopHooks : public CommandObjectMultiword { public: - CommandObjectMultiwordTargetStopHooks (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "target stop-hook", - "A set of commands for operating on debugger target stop-hooks.", - "target stop-hook []") + CommandObjectMultiwordTargetStopHooks(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "target stop-hook", + "Commands for operating on debugger target stop-hooks.", + "target stop-hook []") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTargetStopHookAdd (interpreter))); LoadSubCommand ("delete", CommandObjectSP (new CommandObjectTargetStopHookDelete (interpreter))); @@ -5433,11 +5425,9 @@ // CommandObjectMultiwordTarget //------------------------------------------------------------------------- -CommandObjectMultiwordTarget::CommandObjectMultiwordTarget (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "target", - "A set of commands for operating on debugger targets.", - "target []") +CommandObjectMultiwordTarget::CommandObjectMultiwordTarget(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "target", "Commands for operating on debugger targets.", + "target []") { LoadSubCommand ("create", CommandObjectSP (new CommandObjectTargetCreate (interpreter))); LoadSubCommand ("delete", CommandObjectSP (new CommandObjectTargetDelete (interpreter))); Index: source/Commands/CommandObjectThread.cpp =================================================================== --- source/Commands/CommandObjectThread.cpp +++ source/Commands/CommandObjectThread.cpp @@ -229,17 +229,14 @@ bool m_extended_backtrace; }; - CommandObjectThreadBacktrace (CommandInterpreter &interpreter) : - CommandObjectIterateOverThreads(interpreter, - "thread backtrace", - "Show the stack for one or more threads. If no threads are specified, show the currently selected thread. Use the thread-index \"all\" to see all threads.", - nullptr, - eCommandRequiresProcess | - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ), - m_options(interpreter) + CommandObjectThreadBacktrace(CommandInterpreter &interpreter) + : CommandObjectIterateOverThreads( + interpreter, "thread backtrace", "Show thread call stacks. Defaults to the current thread, thread " + "indexes can be specified as arguments. Use the thread-index \"all\" " + "to see all threads.", + nullptr, eCommandRequiresProcess | eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), + m_options(interpreter) { } @@ -804,15 +801,12 @@ class CommandObjectThreadContinue : public CommandObjectParsed { public: - CommandObjectThreadContinue (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "thread continue", - "Continue execution of one or more threads in an active process.", - nullptr, - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused) + CommandObjectThreadContinue(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "thread continue", "Continue execution of the current target process. One " + "or more threads may be specified, by default all " + "threads continue.", + nullptr, eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) { CommandArgumentEntry arg; CommandArgumentData thread_idx_arg; @@ -1101,16 +1095,13 @@ // Instance variables to hold the values for command options. }; - CommandObjectThreadUntil (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "thread until", - "Run the current or specified thread until it reaches a given line number or address or leaves the current function.", - nullptr, - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ), - m_options (interpreter) + CommandObjectThreadUntil(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "thread until", "Continue until a line number or address is reached by the " + "current or specified thread. Stops when returning from " + "the current function as a safety measure.", + nullptr, eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData line_num_arg; @@ -1366,15 +1357,10 @@ class CommandObjectThreadSelect : public CommandObjectParsed { public: - CommandObjectThreadSelect (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "thread select", - "Select a thread as the currently active thread.", - nullptr, - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ) + CommandObjectThreadSelect(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "thread select", "Change the currently selected thread.", nullptr, + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused) { CommandArgumentEntry arg; CommandArgumentData thread_idx_arg; @@ -1434,15 +1420,11 @@ class CommandObjectThreadList : public CommandObjectParsed { public: - CommandObjectThreadList (CommandInterpreter &interpreter): - CommandObjectParsed (interpreter, - "thread list", - "Show a summary of all current threads in a process.", - "thread list", - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ) + CommandObjectThreadList(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "thread list", + "Show a summary of each thread in the current target process.", "thread list", + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused) { } @@ -1528,16 +1510,13 @@ static OptionDefinition g_option_table[]; }; - CommandObjectThreadInfo (CommandInterpreter &interpreter) : - CommandObjectIterateOverThreads (interpreter, - "thread info", - "Show an extended summary of information about thread(s) in a process.", - "thread info", - eCommandRequiresProcess | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused), - m_options (interpreter) + CommandObjectThreadInfo(CommandInterpreter &interpreter) + : CommandObjectIterateOverThreads( + interpreter, "thread info", + "Show an extended summary of one or more threads. Defaults to the current thread.", "thread info", + eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused), + m_options(interpreter) { m_add_return = false; } @@ -1653,17 +1632,14 @@ // Instance variables to hold the values for command options. }; - CommandObjectThreadReturn (CommandInterpreter &interpreter) : - CommandObjectRaw (interpreter, - "thread return", - "Return from the currently selected frame, short-circuiting execution of the frames below it, with an optional return value," - " or with the -x option from the innermost function evaluation.", - "thread return", - eCommandRequiresFrame | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ), - m_options (interpreter) + CommandObjectThreadReturn(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "thread return", + "Prematurely return from a stack frame, short-circuiting execution of newer frames " + "and optionally yielding a specified value. Defaults to the exiting the current stack " + "frame.", + "thread return", eCommandRequiresFrame | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), + m_options(interpreter) { CommandArgumentEntry arg; CommandArgumentData expression_arg; @@ -2043,18 +2019,14 @@ bool m_internal; }; - CommandObjectThreadPlanList (CommandInterpreter &interpreter) : - CommandObjectIterateOverThreads(interpreter, - "thread plan list", - "Show thread plans for one or more threads. If no threads are specified, show the " - "currently selected thread. Use the thread-index \"all\" to see all threads.", - nullptr, - eCommandRequiresProcess | - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ), - m_options(interpreter) + CommandObjectThreadPlanList(CommandInterpreter &interpreter) + : CommandObjectIterateOverThreads( + interpreter, "thread plan list", + "Show thread plans for one or more threads. If no threads are specified, show the " + "current thread. Use the thread-index \"all\" to see all threads.", + nullptr, eCommandRequiresProcess | eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), + m_options(interpreter) { } @@ -2103,18 +2075,13 @@ class CommandObjectThreadPlanDiscard : public CommandObjectParsed { public: - CommandObjectThreadPlanDiscard (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "thread plan discard", - "Discards thread plans up to and including the plan passed as the command argument." - "Only user visible plans can be discarded, use the index from \"thread plan list\"" - " without the \"-i\" argument.", - nullptr, - eCommandRequiresProcess | - eCommandRequiresThread | - eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused ) + CommandObjectThreadPlanDiscard(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "thread plan discard", + "Discards thread plans up to and including the specified index (see 'thread plan list'.) " + "Only user visible plans can be discarded.", + nullptr, eCommandRequiresProcess | eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) { CommandArgumentEntry arg; CommandArgumentData plan_index_arg; @@ -2183,11 +2150,9 @@ class CommandObjectMultiwordThreadPlan : public CommandObjectMultiword { public: - CommandObjectMultiwordThreadPlan(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "plan", - "A set of subcommands for accessing the thread plans controlling execution control on one or more threads.", - "thread plan [ [ []") +CommandObjectMultiwordThread::CommandObjectMultiwordThread(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "thread", + "Commands for operating on one or more threads in the current process.", + "thread []") { LoadSubCommand ("backtrace", CommandObjectSP (new CommandObjectThreadBacktrace (interpreter))); LoadSubCommand ("continue", CommandObjectSP (new CommandObjectThreadContinue (interpreter))); @@ -2214,46 +2178,38 @@ LoadSubCommand ("select", CommandObjectSP (new CommandObjectThreadSelect (interpreter))); LoadSubCommand ("until", CommandObjectSP (new CommandObjectThreadUntil (interpreter))); LoadSubCommand ("info", CommandObjectSP (new CommandObjectThreadInfo (interpreter))); - LoadSubCommand ("step-in", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( - interpreter, - "thread step-in", - "Source level single step in specified thread (current thread, if none specified).", - nullptr, - eStepTypeInto, - eStepScopeSource))); - - LoadSubCommand ("step-out", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( - interpreter, - "thread step-out", - "Finish executing the function of the currently selected frame and return to its call site in specified thread (current thread, if none specified).", - nullptr, - eStepTypeOut, - eStepScopeSource))); + LoadSubCommand("step-in", + CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( + interpreter, "thread step-in", + "Source level single step, stepping into calls. Defaults to current thread unless specified.", + nullptr, eStepTypeInto, eStepScopeSource))); - LoadSubCommand ("step-over", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( - interpreter, - "thread step-over", - "Source level single step in specified thread (current thread, if none specified), stepping over calls.", - nullptr, - eStepTypeOver, - eStepScopeSource))); + LoadSubCommand("step-out", + CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( + interpreter, "thread step-out", "Finish executing the current stack frame and stop after " + "returning. Defaults to current thread unless specified.", + nullptr, eStepTypeOut, eStepScopeSource))); - LoadSubCommand ("step-inst", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( - interpreter, - "thread step-inst", - "Single step one instruction in specified thread (current thread, if none specified).", - nullptr, - eStepTypeTrace, - eStepScopeInstruction))); + LoadSubCommand("step-over", + CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( + interpreter, "thread step-over", + "Source level single step, stepping over calls. Defaults to current thread unless specified.", + nullptr, eStepTypeOver, eStepScopeSource))); - LoadSubCommand ("step-inst-over", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( - interpreter, - "thread step-inst-over", - "Single step one instruction in specified thread (current thread, if none specified), stepping over calls.", - nullptr, - eStepTypeTraceOver, - eStepScopeInstruction))); + LoadSubCommand( + "step-inst", + CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( + interpreter, "thread step-inst", + "Instruction level single step, stepping into calls. Defaults to current thread unless specified.", + nullptr, eStepTypeTrace, eStepScopeInstruction))); + LoadSubCommand( + "step-inst-over", + CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( + interpreter, "thread step-inst-over", + "Instruction level single step, stepping over calls. Defaults to current thread unless specified.", + nullptr, eStepTypeTraceOver, eStepScopeInstruction))); + LoadSubCommand ("step-scripted", CommandObjectSP (new CommandObjectThreadStepWithTypeAndScope ( interpreter, "thread step-scripted", Index: source/Commands/CommandObjectType.cpp =================================================================== --- source/Commands/CommandObjectType.cpp +++ source/Commands/CommandObjectType.cpp @@ -3571,11 +3571,9 @@ class CommandObjectTypeFormat : public CommandObjectMultiword { public: - CommandObjectTypeFormat (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type format", - "A set of commands for editing variable value display options", - "type format [] ") + CommandObjectTypeFormat(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type format", "Commands for customizing value display formats.", + "type format [] ") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTypeFormatAdd (interpreter))); LoadSubCommand ("clear", CommandObjectSP (new CommandObjectTypeFormatClear (interpreter))); @@ -3596,11 +3594,10 @@ class CommandObjectTypeSynth : public CommandObjectMultiword { public: - CommandObjectTypeSynth (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type synthetic", - "A set of commands for operating on synthetic type representations", - "type synthetic [] ") + CommandObjectTypeSynth(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type synthetic", + "Commands for operating on synthetic type representations.", + "type synthetic [] ") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTypeSynthAdd (interpreter))); LoadSubCommand ("clear", CommandObjectSP (new CommandObjectTypeSynthClear (interpreter))); @@ -3621,11 +3618,9 @@ class CommandObjectTypeFilter : public CommandObjectMultiword { public: - CommandObjectTypeFilter (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type filter", - "A set of commands for operating on type filters", - "type synthetic [] ") + CommandObjectTypeFilter(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type filter", "Commands for operating on type filters.", + "type synthetic [] ") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTypeFilterAdd (interpreter))); LoadSubCommand ("clear", CommandObjectSP (new CommandObjectTypeFilterClear (interpreter))); @@ -3639,11 +3634,9 @@ class CommandObjectTypeCategory : public CommandObjectMultiword { public: - CommandObjectTypeCategory (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type category", - "A set of commands for operating on categories", - "type category [] ") + CommandObjectTypeCategory(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type category", "Commands for operating on type categories.", + "type category [] ") { LoadSubCommand ("define", CommandObjectSP (new CommandObjectTypeCategoryDefine (interpreter))); LoadSubCommand ("enable", CommandObjectSP (new CommandObjectTypeCategoryEnable (interpreter))); @@ -3658,11 +3651,9 @@ class CommandObjectTypeSummary : public CommandObjectMultiword { public: - CommandObjectTypeSummary (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type summary", - "A set of commands for editing variable summary display options", - "type summary [] ") + CommandObjectTypeSummary(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type summary", "Commands for editing variable summary display options.", + "type summary [] ") { LoadSubCommand ("add", CommandObjectSP (new CommandObjectTypeSummaryAdd (interpreter))); LoadSubCommand ("clear", CommandObjectSP (new CommandObjectTypeSummaryClear (interpreter))); @@ -3682,11 +3673,9 @@ // CommandObjectType //------------------------------------------------------------------------- -CommandObjectType::CommandObjectType (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "type", - "A set of commands for operating on the type system", - "type []") +CommandObjectType::CommandObjectType(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "type", "Commands for operating on the type system.", + "type []") { LoadSubCommand ("category", CommandObjectSP (new CommandObjectTypeCategory (interpreter))); LoadSubCommand ("filter", CommandObjectSP (new CommandObjectTypeFilter (interpreter))); Index: source/Commands/CommandObjectVersion.cpp =================================================================== --- source/Commands/CommandObjectVersion.cpp +++ source/Commands/CommandObjectVersion.cpp @@ -24,8 +24,8 @@ // CommandObjectVersion //------------------------------------------------------------------------- -CommandObjectVersion::CommandObjectVersion (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, "version", "Show version of LLDB debugger.", "version") +CommandObjectVersion::CommandObjectVersion(CommandInterpreter &interpreter) + : CommandObjectParsed(interpreter, "version", "Show the LLDB debugger version.", "version") { } Index: source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- source/Commands/CommandObjectWatchpoint.cpp +++ source/Commands/CommandObjectWatchpoint.cpp @@ -1308,11 +1308,9 @@ class CommandObjectWatchpointSet : public CommandObjectMultiword { public: - CommandObjectWatchpointSet (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "watchpoint set", - "A set of commands for setting a watchpoint.", - "watchpoint set []") + CommandObjectWatchpointSet(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "watchpoint set", "Commands for setting a watchpoint.", + "watchpoint set []") { LoadSubCommand ("variable", CommandObjectSP (new CommandObjectWatchpointSetVariable (interpreter))); @@ -1327,11 +1325,9 @@ //------------------------------------------------------------------------- #pragma mark MultiwordWatchpoint -CommandObjectMultiwordWatchpoint::CommandObjectMultiwordWatchpoint(CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "watchpoint", - "A set of commands for operating on watchpoints.", - "watchpoint []") +CommandObjectMultiwordWatchpoint::CommandObjectMultiwordWatchpoint(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "watchpoint", "Commands for operating on watchpoints.", + "watchpoint []") { CommandObjectSP list_command_object (new CommandObjectWatchpointList (interpreter)); CommandObjectSP enable_command_object (new CommandObjectWatchpointEnable (interpreter)); Index: source/Commands/CommandObjectWatchpointCommand.cpp =================================================================== --- source/Commands/CommandObjectWatchpointCommand.cpp +++ source/Commands/CommandObjectWatchpointCommand.cpp @@ -36,13 +36,12 @@ public IOHandlerDelegateMultiline { public: - CommandObjectWatchpointCommandAdd (CommandInterpreter &interpreter) : - CommandObjectParsed(interpreter, - "add", - "Add a set of commands to a watchpoint, to be executed whenever the watchpoint is hit.", - nullptr), - IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand), - m_options (interpreter) + CommandObjectWatchpointCommandAdd(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "add", + "Add a set of LLDB commands to a watchpoint, to be executed whenever the watchpoint is hit.", nullptr), + IOHandlerDelegateMultiline("DONE", IOHandlerDelegate::Completion::LLDBCommand), + m_options(interpreter) { SetHelpLong ( R"( @@ -708,11 +707,10 @@ // CommandObjectWatchpointCommand //------------------------------------------------------------------------- -CommandObjectWatchpointCommand::CommandObjectWatchpointCommand (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "command", - "A set of commands for adding, removing and examining bits of code to be executed when the watchpoint is hit (watchpoint 'commmands').", - "command [] ") +CommandObjectWatchpointCommand::CommandObjectWatchpointCommand(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "command", "Commands for adding, removing and examining LLDB commands " + "executed when the watchpoint is hit (watchpoint 'commmands').", + "command [] ") { CommandObjectSP add_command_object (new CommandObjectWatchpointCommandAdd (interpreter)); CommandObjectSP delete_command_object (new CommandObjectWatchpointCommandDelete (interpreter)); Index: source/Interpreter/CommandInterpreter.cpp =================================================================== --- source/Interpreter/CommandInterpreter.cpp +++ source/Interpreter/CommandInterpreter.cpp @@ -345,7 +345,8 @@ AddAlias ("call", cmd_obj_sp, "--")->SetHelpLong(""); if (auto po = AddAlias ("po", cmd_obj_sp, "-O --")) { - po->SetHelp("Evaluate an expression in the current program context, using user defined variables and variables currently in scope, and display the result of evaluation in a language-specific manner."); + po->SetHelp("Evaluate an expression on the current thread. Displays any returned value with formatting " + "controlled by the type's author."); po->SetHelpLong(""); } AddAlias("parray", cmd_obj_sp, "--element-count %1 --")->SetHelpLong(""); @@ -464,23 +465,27 @@ {"^[\"']?(.*[^[:space:]\"'])[\"']?[[:space:]]*$", "breakpoint set --name '%1'"}}; size_t num_regexes = llvm::array_lengthof(break_regexes); - - std::unique_ptr - break_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-break", - "Set a breakpoint using a regular expression to specify the location, where is in decimal and
is in hex.\n", - "\n_regexp-break : # _regexp-break main.c:12 // Break on line 12 of main.c\n" - "_regexp-break # _regexp-break 12 // Break on line 12 of current file\n" - "_regexp-break
# _regexp-break 0x1234000 // Break on address 0x1234000\n" - "_regexp-break # _regexp-break main // Break in 'main' after the prologue\n" - "_regexp-break & # _regexp-break &main // Break on the first instruction in 'main'\n" - "_regexp-break ` # _regexp-break libc.so`malloc // Break in 'malloc' only in the 'libc.so' shared library\n" - "_regexp-break // # _regexp-break /break here/ // Break on all lines that match the regular expression 'break here' in the current file.\n", - 2, - CommandCompletions::eSymbolCompletion | - CommandCompletions::eSourceFileCompletion, - false)); + std::unique_ptr break_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-break", "Set a breakpoint using one of several shorthand formats.\n", + "\n" + "_regexp-break :\n" + " main.c:12 // Break at line 12 of main.c\n\n" + "_regexp-break \n" + " 12 // Break at line 12 of current file\n\n" + "_regexp-break 0x
\n" + " 0x1234000 // Break at address 0x1234000\n\n" + "_regexp-break \n" + " main // Break in 'main' after the prologue\n\n" + "_regexp-break &\n" + " &main // Break at first instruction in 'main'\n\n" + "_regexp-break `\n" + " libc.so`malloc // Break in 'malloc' from 'libc.so'\n\n" + "_regexp-break //\n" + " /break here/ // Break on source lines in current file\n" + " // containing text 'break here'.\n", + 2, CommandCompletions::eSymbolCompletion | CommandCompletions::eSourceFileCompletion, false)); + if (break_regex_cmd_ap.get()) { bool success = true; @@ -499,15 +504,25 @@ } } - std::unique_ptr - tbreak_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-tbreak", - "Set a one shot breakpoint using a regular expression to specify the location, where is in decimal and
is in hex.", - "_regexp-tbreak [:]\n_regexp-break []\n_regexp-break [
]\n_regexp-break <...>", - 2, - CommandCompletions::eSymbolCompletion | - CommandCompletions::eSourceFileCompletion, - false)); + std::unique_ptr tbreak_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-tbreak", "Set a one-shot breakpoint using one of several shorthand formats.\n", + "\n" + "_regexp-break :\n" + " main.c:12 // Break at line 12 of main.c\n\n" + "_regexp-break \n" + " 12 // Break at line 12 of current file\n\n" + "_regexp-break 0x
\n" + " 0x1234000 // Break at address 0x1234000\n\n" + "_regexp-break \n" + " main // Break in 'main' after the prologue\n\n" + "_regexp-break &\n" + " &main // Break at first instruction in 'main'\n\n" + "_regexp-break `\n" + " libc.so`malloc // Break in 'malloc' from 'libc.so'\n\n" + "_regexp-break //\n" + " /break here/ // Break on source lines in current file\n" + " // containing text 'break here'.\n", + 2, CommandCompletions::eSymbolCompletion | CommandCompletions::eSourceFileCompletion, false)); if (tbreak_regex_cmd_ap.get()) { @@ -532,14 +547,9 @@ } } - std::unique_ptr - attach_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-attach", - "Attach to a process id if in decimal, otherwise treat the argument as a process name to attach to.", - "_regexp-attach []\n_regexp-attach []", - 2, - 0, - false)); + std::unique_ptr attach_regex_cmd_ap( + new CommandObjectRegexCommand(*this, "_regexp-attach", "Attach to process by ID or name.", + "_regexp-attach | ", 2, 0, false)); if (attach_regex_cmd_ap.get()) { if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "process attach --pid %1") && @@ -551,15 +561,11 @@ m_command_dict[attach_regex_cmd_sp->GetCommandName ()] = attach_regex_cmd_sp; } } - - std::unique_ptr - down_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-down", - "Go down \"n\" frames in the stack (1 frame by default).", - "_regexp-down [n]", - 2, - 0, - false)); + + std::unique_ptr down_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-down", "Select a newer stack frame. Defaults to moving one frame, a numeric argument can " + "specify an arbitrary number.", + "_regexp-down []", 2, 0, false)); if (down_regex_cmd_ap.get()) { if (down_regex_cmd_ap->AddRegexCommand("^$", "frame select -r -1") && @@ -569,15 +575,11 @@ m_command_dict[down_regex_cmd_sp->GetCommandName ()] = down_regex_cmd_sp; } } - - std::unique_ptr - up_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-up", - "Go up \"n\" frames in the stack (1 frame by default).", - "_regexp-up [n]", - 2, - 0, - false)); + + std::unique_ptr up_regex_cmd_ap( + new CommandObjectRegexCommand(*this, "_regexp-up", "Select an older stack frame. Defaults to moving one " + "frame, a numeric argument can specify an arbitrary number.", + "_regexp-up []", 2, 0, false)); if (up_regex_cmd_ap.get()) { if (up_regex_cmd_ap->AddRegexCommand("^$", "frame select -r 1") && @@ -588,14 +590,9 @@ } } - std::unique_ptr - display_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-display", - "Add an expression evaluation stop-hook.", - "_regexp-display expression", - 2, - 0, - false)); + std::unique_ptr display_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-display", "Evaluate an expression at every stop (see 'help target stop-hook'.)", + "_regexp-display expression", 2, 0, false)); if (display_regex_cmd_ap.get()) { if (display_regex_cmd_ap->AddRegexCommand("^(.+)$", "target stop-hook add -o \"expr -- %1\"")) @@ -605,14 +602,9 @@ } } - std::unique_ptr - undisplay_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-undisplay", - "Remove an expression evaluation stop-hook.", - "_regexp-undisplay stop-hook-number", - 2, - 0, - false)); + std::unique_ptr undisplay_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-undisplay", "Stop displaying expression at every stop (specified by stop-hook index.)", + "_regexp-undisplay stop-hook-number", 2, 0, false)); if (undisplay_regex_cmd_ap.get()) { if (undisplay_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "target stop-hook delete %1")) @@ -622,14 +614,10 @@ } } - std::unique_ptr - connect_gdb_remote_cmd_ap(new CommandObjectRegexCommand (*this, - "gdb-remote", - "Connect to a remote GDB server. If no hostname is provided, localhost is assumed.", - "gdb-remote [:]", - 2, - 0, - false)); + std::unique_ptr connect_gdb_remote_cmd_ap(new CommandObjectRegexCommand( + *this, "gdb-remote", + "Connect to a process via remote GDB server. If no host is specifed, localhost is assumed.", + "gdb-remote [:]", 2, 0, false)); if (connect_gdb_remote_cmd_ap.get()) { if (connect_gdb_remote_cmd_ap->AddRegexCommand("^([^:]+:[[:digit:]]+)$", "process connect --plugin gdb-remote connect://%1") && @@ -640,14 +628,10 @@ } } - std::unique_ptr - connect_kdp_remote_cmd_ap(new CommandObjectRegexCommand (*this, - "kdp-remote", - "Connect to a remote KDP server. udp port 41139 is the default port number.", - "kdp-remote [:]", - 2, - 0, - false)); + std::unique_ptr connect_kdp_remote_cmd_ap(new CommandObjectRegexCommand( + *this, "kdp-remote", + "Connect to a process via remote KDP server. If no UDP port is specified, port 41139 is assumed.", + "kdp-remote [:]", 2, 0, false)); if (connect_kdp_remote_cmd_ap.get()) { if (connect_kdp_remote_cmd_ap->AddRegexCommand("^([^:]+:[[:digit:]]+)$", "process connect --plugin kdp-remote udp://%1") && @@ -658,14 +642,10 @@ } } - std::unique_ptr - bt_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-bt", - "Show a backtrace. An optional argument is accepted; if that argument is a number, it specifies the number of frames to display. If that argument is 'all', full backtraces of all threads are displayed.", - "bt [|all]", - 2, - 0, - false)); + std::unique_ptr bt_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-bt", "Show the current thread's call stack. Any numeric argument displays at most that many " + "frames. The argument 'all' displays all threads.", + "bt [ | all]", 2, 0, false)); if (bt_regex_cmd_ap.get()) { // accept but don't document "bt -c " -- before bt was a regex command if you wanted to backtrace @@ -681,14 +661,16 @@ } } - std::unique_ptr - list_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-list", - "Implements the GDB 'list' command in all of its forms except FILE:FUNCTION and maps them to the appropriate 'source list' commands.", - "_regexp-list []\n_regexp-list [:]\n_regexp-list [:]", - 2, - CommandCompletions::eSourceFileCompletion, - false)); + std::unique_ptr list_regex_cmd_ap(new CommandObjectRegexCommand( + *this, "_regexp-list", "List relevant source code using one of several shorthand formats.", + "\n" + "_regexp-list : // List around specific file/line\n" + "_regexp-list // List current file around specified line\n" + "_regexp-list // List specified function\n" + "_regexp-list 0x
// List around specified address\n" + "_regexp-list -[] // List previous lines\n" + "_regexp-list // List subsequent lines", + 2, CommandCompletions::eSourceFileCompletion, false)); if (list_regex_cmd_ap.get()) { if (list_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "source list --line %1") && @@ -704,14 +686,12 @@ } } - std::unique_ptr - env_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-env", - "Implements a shortcut to viewing and setting environment variables.", - "_regexp-env\n_regexp-env FOO=BAR", - 2, - 0, - false)); + std::unique_ptr env_regex_cmd_ap( + new CommandObjectRegexCommand(*this, "_regexp-env", "Shorthand for viewing and setting environment variables.", + "\n" + "_regexp-env // Show enrivonment\n" + "_regexp-env = // Set an environment variable", + 2, 0, false)); if (env_regex_cmd_ap.get()) { if (env_regex_cmd_ap->AddRegexCommand("^$", "settings show target.env-vars") && @@ -722,17 +702,14 @@ } } - std::unique_ptr - jump_regex_cmd_ap(new CommandObjectRegexCommand (*this, - "_regexp-jump", - "Sets the program counter to a new address.", - "_regexp-jump []\n" - "_regexp-jump [<+-lineoffset>]\n" - "_regexp-jump [:]\n" - "_regexp-jump [*]\n", - 2, - 0, - false)); + std::unique_ptr jump_regex_cmd_ap( + new CommandObjectRegexCommand(*this, "_regexp-jump", "Set the program counter to a new address.", + "\n" + "_regexp-jump \n" + "_regexp-jump + | -\n" + "_regexp-jump :\n" + "_regexp-jump *\n", + 2, 0, false)); if (jump_regex_cmd_ap.get()) { if (jump_regex_cmd_ap->AddRegexCommand("^\\*(.*)$", "thread jump --addr %1") && Index: source/Interpreter/CommandObject.cpp =================================================================== --- source/Interpreter/CommandObject.cpp +++ source/Interpreter/CommandObject.cpp @@ -687,30 +687,30 @@ static const char * BreakpointIDHelpTextCallback () { - return "Breakpoint ID's consist major and minor numbers; the major number " - "corresponds to the single entity that was created with a 'breakpoint set' " - "command; the minor numbers correspond to all the locations that were actually " - "found/set based on the major breakpoint. A full breakpoint ID might look like " - "3.14, meaning the 14th location set for the 3rd breakpoint. You can specify " - "all the locations of a breakpoint by just indicating the major breakpoint " - "number. A valid breakpoint id consists either of just the major id number, " - "or the major number, a dot, and the location number (e.g. 3 or 3.2 could " - "both be valid breakpoint ids)."; + return "Breakpoints are identified using major and minor numbers; the major " + "number corresponds to the single entity that was created with a 'breakpoint " + "set' command; the minor numbers correspond to all the locations that were " + "actually found/set based on the major breakpoint. A full breakpoint ID might " + "look like 3.14, meaning the 14th location set for the 3rd breakpoint. You " + "can specify all the locations of a breakpoint by just indicating the major " + "breakpoint number. A valid breakpoint ID consists either of just the major " + "number, or the major number followed by a dot and the location number (e.g. " + "3 or 3.2 could both be valid breakpoint IDs.)"; } static const char * BreakpointIDRangeHelpTextCallback () { - return "A 'breakpoint id list' is a manner of specifying multiple breakpoints. " - "This can be done through several mechanisms. The easiest way is to just " - "enter a space-separated list of breakpoint ids. To specify all the " - "breakpoint locations under a major breakpoint, you can use the major " - "breakpoint number followed by '.*', eg. '5.*' means all the locations under " - "breakpoint 5. You can also indicate a range of breakpoints by using " - " - . The start-bp-id and end-bp-id for a range can " - "be any valid breakpoint ids. It is not legal, however, to specify a range " - "using specific locations that cross major breakpoint numbers. I.e. 3.2 - 3.7" - " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; + return "A 'breakpoint ID list' is a manner of specifying multiple breakpoints. " + "This can be done through several mechanisms. The easiest way is to just " + "enter a space-separated list of breakpoint IDs. To specify all the " + "breakpoint locations under a major breakpoint, you can use the major " + "breakpoint number followed by '.*', eg. '5.*' means all the locations under " + "breakpoint 5. You can also indicate a range of breakpoints by using " + " - . The start-bp-id and end-bp-id for a range can " + "be any valid breakpoint IDs. It is not legal, however, to specify a range " + "using specific locations that cross major breakpoint numbers. I.e. 3.2 - 3.7" + " is legal; 2 - 5 is legal; but 3.2 - 4.4 is not legal."; } static const char * @@ -717,16 +717,17 @@ BreakpointNameHelpTextCallback () { return "A name that can be added to a breakpoint when it is created, or later " - "on with the \"breakpoint name add\" command. " - "Breakpoint names can be used to specify breakpoints in all the places breakpoint ID's " - "and breakpoint ID ranges can be used. As such they provide a convenient way to group breakpoints, " - "and to operate on breakpoints you create without having to track the breakpoint number. " - "Note, the attributes you set when using a breakpoint name in a breakpoint command don't " - "adhere to the name, but instead are set individually on all the breakpoints currently tagged with that name. Future breakpoints " - "tagged with that name will not pick up the attributes previously given using that name. " - "In order to distinguish breakpoint names from breakpoint ID's and ranges, " - "names must start with a letter from a-z or A-Z and cannot contain spaces, \".\" or \"-\". " - "Also, breakpoint names can only be applied to breakpoints, not to breakpoint locations."; + "on with the \"breakpoint name add\" command. " + "Breakpoint names can be used to specify breakpoints in all the places breakpoint IDs " + "and breakpoint ID ranges can be used. As such they provide a convenient way to group breakpoints, " + "and to operate on breakpoints you create without having to track the breakpoint number. " + "Note, the attributes you set when using a breakpoint name in a breakpoint command don't " + "adhere to the name, but instead are set individually on all the breakpoints currently tagged with that " + "name. Future breakpoints " + "tagged with that name will not pick up the attributes previously given using that name. " + "In order to distinguish breakpoint names from breakpoint IDs and ranges, " + "names must start with a letter from a-z or A-Z and cannot contain spaces, \".\" or \"-\". " + "Also, breakpoint names can only be applied to breakpoints, not to breakpoint locations."; } static const char * @@ -916,71 +917,46 @@ CommandObject::GenerateHelpText (Stream &output_strm) { CommandInterpreter& interpreter = GetCommandInterpreter(); - if (GetOptions() != nullptr) + if (WantsRawCommandString()) { - if (WantsRawCommandString()) - { - std::string help_text (GetHelp()); - help_text.append (" This command takes 'raw' input (no need to quote stuff)."); - interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1); - } - else - interpreter.OutputFormattedHelpText (output_strm, "", "", GetHelp(), 1); - output_strm.Printf ("\nSyntax: %s\n", GetSyntax()); - GetOptions()->GenerateOptionUsage (output_strm, this); - const char *long_help = GetHelpLong(); - if ((long_help != nullptr) - && (strlen (long_help) > 0)) - FormatLongHelpText (output_strm, long_help); - if (!IsDashDashCommand()) - { - if (WantsRawCommandString() && !WantsCompletion()) - { - // Emit the message about using ' -- ' between the end of the command options and the raw input - // conditionally, i.e., only if the command object does not want completion. - interpreter.OutputFormattedHelpText (output_strm, "", "", - "\nIMPORTANT NOTE: Because this command takes 'raw' input, if you use any command options" - " you must use ' -- ' between the end of the command options and the beginning of the raw input.", 1); - } - else if (GetNumArgumentEntries() > 0 - && GetOptions() - && GetOptions()->NumCommandOptions() > 0) - { - // Also emit a warning about using "--" in case you are using a command that takes options and arguments. - interpreter.OutputFormattedHelpText (output_strm, "", "", - "\nThis command takes options and free-form arguments. If your arguments resemble" - " option specifiers (i.e., they start with a - or --), you must use ' -- ' between" - " the end of the command options and the beginning of the arguments.", 1); - } - } + std::string help_text(GetHelp()); + help_text.append(" Expects 'raw' input (see 'help raw-input'.)"); + interpreter.OutputFormattedHelpText(output_strm, "", "", help_text.c_str(), 1); } - else if (IsMultiwordObject()) + else + interpreter.OutputFormattedHelpText(output_strm, "", "", GetHelp(), 1); + output_strm.Printf("\nSyntax: %s\n", GetSyntax()); + Options *options = GetOptions(); + if (options != nullptr) { - if (WantsRawCommandString()) - { - std::string help_text (GetHelp()); - help_text.append (" This command takes 'raw' input (no need to quote stuff)."); - interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1); - } - else - interpreter.OutputFormattedHelpText (output_strm, "", "", GetHelp(), 1); - GenerateHelpText (output_strm); + options->GenerateOptionUsage(output_strm, this); } - else + const char *long_help = GetHelpLong(); + if ((long_help != nullptr) && (strlen(long_help) > 0)) { - const char *long_help = GetHelpLong(); - if ((long_help != nullptr) - && (strlen (long_help) > 0)) - FormatLongHelpText (output_strm, long_help); - else if (WantsRawCommandString()) + FormatLongHelpText(output_strm, long_help); + } + if (!IsDashDashCommand() && options && options->NumCommandOptions() > 0) + { + if (WantsRawCommandString() && !WantsCompletion()) { - std::string help_text (GetHelp()); - help_text.append (" This command takes 'raw' input (no need to quote stuff)."); - interpreter.OutputFormattedHelpText (output_strm, "", "", help_text.c_str(), 1); + // Emit the message about using ' -- ' between the end of the command options and the raw input + // conditionally, i.e., only if the command object does not want completion. + interpreter.OutputFormattedHelpText( + output_strm, "", "", + "\nImportant Note: Because this command takes 'raw' input, if you use any command options" + " you must use ' -- ' between the end of the command options and the beginning of the raw input.", + 1); } - else - interpreter.OutputFormattedHelpText (output_strm, "", "", GetHelp(), 1); - output_strm.Printf ("\nSyntax: %s\n", GetSyntax()); + else if (GetNumArgumentEntries() > 0) + { + // Also emit a warning about using "--" in case you are using a command that takes options and arguments. + interpreter.OutputFormattedHelpText( + output_strm, "", "", "\nThis command takes options and free-form arguments. If your arguments resemble" + " option specifiers (i.e., they start with a - or --), you must use ' -- ' between" + " the end of the command options and the beginning of the arguments.", + 1); + } } } @@ -1126,9 +1102,8 @@ return g_archs_help.GetData(); } -CommandObject::ArgumentTableEntry -CommandObject::g_arguments_data[] = -{ +CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = { + // clang-format off { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid address in the target program's execution space." }, { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "An expression that resolves to an address." }, { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of an abbreviation (alias) for a debugger command." }, @@ -1186,7 +1161,7 @@ { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, { nullptr, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." }, { eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language to be used for script-based commands. Currently only Python is valid." }, - { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { nullptr, false }, "The word for which you wish to search for information about." }, + { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { nullptr, false }, "Any word of interest for search purposes." }, { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { nullptr, false }, "An Objective-C selector name." }, { eArgTypeSettingIndex, "setting-index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a settings variable that is an array (try 'settings list' to see all the possible settings variables and their types)." }, { eArgTypeSettingKey, "setting-key", CommandCompletions::eNoCompletion, { nullptr, false }, "A key into a settings variables that is a dictionary (try 'settings list' to see all the possible settings variables and their types)." }, @@ -1211,7 +1186,9 @@ { eArgTypePlatform, "platform-name", CommandCompletions::ePlatformPluginCompletion, { nullptr, false }, "The name of an installed platform plug-in . Type 'platform list' to see a complete list of installed platforms." }, { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Watchpoint IDs are positive integers." }, { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { nullptr, false }, "For example, '1-3' or '1 to 3'." }, - { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." } + { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." }, + { eArgRawInput, "raw-input", CommandCompletions::eNoCompletion, { nullptr, false }, "Free-form text passed to a command without prior interpretation, allowing spaces without requiring quotes. To pass arguments and free form text put two dashes ' -- ' between the last argument and any raw input." } + // clang-format on }; const CommandObject::ArgumentTableEntry* Index: source/Interpreter/CommandObjectScript.cpp =================================================================== --- source/Interpreter/CommandObjectScript.cpp +++ source/Interpreter/CommandObjectScript.cpp @@ -30,11 +30,10 @@ // CommandObjectScript //------------------------------------------------------------------------- -CommandObjectScript::CommandObjectScript (CommandInterpreter &interpreter, ScriptLanguage script_lang) : - CommandObjectRaw (interpreter, - "script", - "Pass an expression to the script interpreter for evaluation and return the results. Drop into the interactive interpreter if no expression is given.", - "script []") +CommandObjectScript::CommandObjectScript(CommandInterpreter &interpreter, ScriptLanguage script_lang) + : CommandObjectRaw(interpreter, "script", "Invoke the script interpreter with provided code and display any " + "results. Start the interactive interpreter if no code is supplied.", + "script []") { } Index: source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp +++ source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp @@ -410,11 +410,9 @@ class CommandObjectMultiwordItaniumABI : public CommandObjectMultiword { public: - CommandObjectMultiwordItaniumABI (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "cplusplus", - "A set of commands for operating on the C++ Language Runtime.", - "cplusplus []") + CommandObjectMultiwordItaniumABI(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "cplusplus", "Commands for operating on the C++ language runtime.", + "cplusplus []") { LoadSubCommand ("demangle", CommandObjectSP (new CommandObjectMultiwordItaniumABI_Demangle (interpreter))); } Index: source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -775,11 +775,9 @@ class CommandObjectMultiwordObjC_ClassTable : public CommandObjectMultiword { public: - CommandObjectMultiwordObjC_ClassTable (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "class-table", - "A set of commands for operating on the Objective-C class table.", - "class-table []") + CommandObjectMultiwordObjC_ClassTable(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "class-table", "Commands for operating on the Objective-C class table.", + "class-table []") { LoadSubCommand ("dump", CommandObjectSP (new CommandObjectObjC_ClassTable_Dump (interpreter))); } @@ -790,12 +788,10 @@ class CommandObjectMultiwordObjC_TaggedPointer : public CommandObjectMultiword { public: - - CommandObjectMultiwordObjC_TaggedPointer (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "tagged-pointer", - "A set of commands for operating on Objective-C tagged pointers.", - "class-table []") + CommandObjectMultiwordObjC_TaggedPointer(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "tagged-pointer", + "Commands for operating on Objective-C tagged pointers.", + "class-table []") { LoadSubCommand ("info", CommandObjectSP (new CommandObjectMultiwordObjC_TaggedPointer_Info (interpreter))); } @@ -806,11 +802,9 @@ class CommandObjectMultiwordObjC : public CommandObjectMultiword { public: - CommandObjectMultiwordObjC (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "objc", - "A set of commands for operating on the Objective-C Language Runtime.", - "objc []") + CommandObjectMultiwordObjC(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "objc", "Commands for operating on the Objective-C language runtime.", + "objc []") { LoadSubCommand ("class-table", CommandObjectSP (new CommandObjectMultiwordObjC_ClassTable (interpreter))); LoadSubCommand ("tagged-pointer", CommandObjectSP (new CommandObjectMultiwordObjC_TaggedPointer (interpreter))); Index: source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -3595,7 +3595,7 @@ { public: CommandObjectRenderScriptRuntimeModule(CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "renderscript module", "Commands that deal with renderscript modules.", + : CommandObjectMultiword(interpreter, "renderscript module", "Commands that deal with RenderScript modules.", nullptr) { LoadSubCommand("dump", CommandObjectSP(new CommandObjectRenderScriptRuntimeModuleDump(interpreter))); @@ -3871,7 +3871,7 @@ { public: CommandObjectRenderScriptRuntimeKernel(CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "renderscript kernel", "Commands that deal with renderscript kernels.", + : CommandObjectMultiword(interpreter, "renderscript kernel", "Commands that deal with RenderScript kernels.", nullptr) { LoadSubCommand("list", CommandObjectSP(new CommandObjectRenderScriptRuntimeKernelList(interpreter))); @@ -3910,7 +3910,7 @@ { public: CommandObjectRenderScriptRuntimeContext(CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "renderscript context", "Commands that deal with renderscript contexts.", + : CommandObjectMultiword(interpreter, "renderscript context", "Commands that deal with RenderScript contexts.", nullptr) { LoadSubCommand("dump", CommandObjectSP(new CommandObjectRenderScriptRuntimeContextDump(interpreter))); @@ -4271,7 +4271,7 @@ public: CommandObjectRenderScriptRuntimeAllocation(CommandInterpreter &interpreter) : CommandObjectMultiword(interpreter, "renderscript allocation", - "Commands that deal with renderscript allocations.", nullptr) + "Commands that deal with RenderScript allocations.", nullptr) { LoadSubCommand("list", CommandObjectSP(new CommandObjectRenderScriptRuntimeAllocationList(interpreter))); LoadSubCommand("dump", CommandObjectSP(new CommandObjectRenderScriptRuntimeAllocationDump(interpreter))); @@ -4287,7 +4287,7 @@ { public: CommandObjectRenderScriptRuntimeStatus(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "renderscript status", "Displays current renderscript runtime status.", + : CommandObjectParsed(interpreter, "renderscript status", "Displays current RenderScript runtime status.", "renderscript status", eCommandRequiresProcess | eCommandProcessMustBeLaunched) { } @@ -4309,7 +4309,7 @@ { public: CommandObjectRenderScriptRuntime(CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "renderscript", "A set of commands for operating on renderscript.", + : CommandObjectMultiword(interpreter, "renderscript", "Commands for operating on the RenderScript runtime.", "renderscript []") { LoadSubCommand("module", CommandObjectSP(new CommandObjectRenderScriptRuntimeModule(interpreter))); Index: source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp =================================================================== --- source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -1187,11 +1187,9 @@ class CommandObjectMultiwordProcessKDP : public CommandObjectMultiword { public: - CommandObjectMultiwordProcessKDP (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "process plugin", - "A set of commands for operating on a ProcessKDP process.", - "process plugin []") + CommandObjectMultiwordProcessKDP(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "process plugin", "Commands for operating on a ProcessKDP process.", + "process plugin []") { LoadSubCommand ("packet", CommandObjectSP (new CommandObjectProcessKDPPacket (interpreter))); } Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -5266,11 +5266,9 @@ class CommandObjectMultiwordProcessGDBRemote : public CommandObjectMultiword { public: - CommandObjectMultiwordProcessGDBRemote (CommandInterpreter &interpreter) : - CommandObjectMultiword (interpreter, - "process plugin", - "A set of commands for operating on a ProcessGDBRemote process.", - "process plugin []") + CommandObjectMultiwordProcessGDBRemote(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "process plugin", "Commands for operating on a ProcessGDBRemote process.", + "process plugin []") { LoadSubCommand ("packet", CommandObjectSP (new CommandObjectProcessGDBRemotePacket (interpreter))); } Index: source/Target/ThreadPlanStepThrough.cpp =================================================================== --- source/Target/ThreadPlanStepThrough.cpp +++ source/Target/ThreadPlanStepThrough.cpp @@ -124,7 +124,7 @@ s->Address(m_start_address, sizeof (addr_t)); if (m_backstop_bkpt_id != LLDB_INVALID_BREAK_ID) { - s->Printf (" with backstop breakpoint id: %d at address: ", m_backstop_bkpt_id); + s->Printf(" with backstop breakpoint ID: %d at address: ", m_backstop_bkpt_id); s->Address (m_backstop_addr, sizeof (addr_t)); } else