diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectArgs.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 56 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectCall.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.cpp | 130 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.h | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectFile.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectImage.cpp | 31 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectLog.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 18 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSourceFile.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectVariable.cpp | 28 |
15 files changed, 150 insertions, 186 deletions
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp index 5e432d78ca7..f450e40c208 100644 --- a/lldb/source/Commands/CommandObjectArgs.cpp +++ b/lldb/source/Commands/CommandObjectArgs.cpp @@ -273,7 +273,7 @@ CommandObjectArgs::Execute(Args &command, lldb::OptionDefinition CommandObjectArgs::CommandOptions::g_option_table[] = { - { 0, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, + { LLDB_OPT_SET_1, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, { 0, false, NULL, 0, 0, NULL, NULL, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index d24ba8f553b..68926e24b6d 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -17,6 +17,7 @@ #include "lldb/Breakpoint/Breakpoint.h" #include "lldb/Breakpoint/BreakpointIDList.h" #include "lldb/Breakpoint/BreakpointLocation.h" +#include "lldb/Core/Options.h" #include "lldb/Core/RegularExpression.h" #include "lldb/Core/StreamString.h" #include "lldb/Interpreter/CommandInterpreter.h" @@ -62,47 +63,32 @@ CommandObjectBreakpointSet::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectBreakpointSet::CommandOptions::g_option_table[] = { - { 0, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<filename>", + { LLDB_OPT_SET_ALL, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>", + "Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."}, + + { LLDB_OPT_SET_ALL, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL, + "Ignore inlined subroutines when setting the breakppoint." }, + + { LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<filename>", "Set the breakpoint by source location in this particular file."}, - { 0, true, "line", 'l', required_argument, NULL, 0, "<linenum>", + { LLDB_OPT_SET_1, true, "line", 'l', required_argument, NULL, 0, "<linenum>", "Set the breakpoint by source location at this particular line."}, - { 0, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>", - "Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."}, - // Comment out this option for the moment, as we don't actually use it, but will in the future. // This way users won't see it, but the infrastructure is left in place. // { 0, false, "column", 'c', required_argument, NULL, "<column>", // "Set the breakpoint by source location at this particular column."}, - { 0, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL, - "Ignore inlined subroutines when setting the breakppoint." }, - - { 1, true, "address", 'a', required_argument, NULL, 0, "<address>", + { LLDB_OPT_SET_2, true, "address", 'a', required_argument, NULL, 0, "<address>", "Set the breakpoint by address, at the specified address."}, - { 1, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL, - "Ignore inlined subroutines when setting the breakppoint." }, - - { 2, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<function-name>", + { LLDB_OPT_SET_3, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<function-name>", "Set the breakpoint by function name." }, - { 2, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>", - "Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."}, - - { 2, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL, - "Ignore inlined subroutines when setting the breakpoint." }, - - { 3, true, "func_regex", 'r', required_argument, NULL, 0, "<regular-expression>", + { LLDB_OPT_SET_4, true, "func_regex", 'r', required_argument, NULL, 0, "<regular-expression>", "Set the breakpoint by function name, evaluating a regular-expression to find the function name(s)." }, - { 3, false, "shlib", 's', required_argument, NULL, CommandCompletions::eModuleCompletion, "<shlib-name>", - "Set the breakpoint only in this shared library (can use this option multiple times for multiple shlibs)."}, - - { 3, false, "ignore_inlines", 'i', no_argument, NULL, 0, NULL, - "Ignore inlined subroutines when setting the breakpoint." }, - { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -505,25 +491,19 @@ CommandObjectBreakpointList::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectBreakpointList::CommandOptions::g_option_table[] = { - { 0, false, "brief", 'b', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_ALL, false, "internal", 'i', no_argument, NULL, 0, NULL, + "Show debugger internal breakpoints" }, + + { LLDB_OPT_SET_1, false, "brief", 'b', no_argument, NULL, 0, NULL, "Give a brief description of the breakpoint (no location info)."}, // FIXME: We need to add an "internal" command, and then add this sort of thing to it. // But I need to see it for now, and don't want to wait. - { 0, false, "internal", 'i', no_argument, NULL, 0, NULL, - "Show debugger internal breakpoints" }, - - { 1, false, "full", 'f', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_2, false, "full", 'f', no_argument, NULL, 0, NULL, "Give a full description of the breakpoint and its locations."}, - // DITTO FIXME - { 1, false, "internal", 'i', no_argument, NULL, 0, NULL, - "Show debugger internal breakpoints" }, - { 2, false, "verbose", 'v', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_3, false, "verbose", 'v', no_argument, NULL, 0, NULL, "Explain everything we know about the breakpoint (for debugging debugger bugs)." }, - // DITTO FIXME - { 2, false, "internal", 'i', no_argument, NULL, 0, NULL, - "Show debugger internal breakpoints" }, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 8a5a443ea8e..dc1c84b0e64 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -44,13 +44,13 @@ CommandObjectBreakpointCommandAdd::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectBreakpointCommandAdd::CommandOptions::g_option_table[] = { - { 0, true, "script", 's', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_1, true, "script", 's', no_argument, NULL, 0, NULL, "Write the breakpoint command script in the default scripting language."}, - { 1, true, "python", 'p', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_2, true, "python", 'p', no_argument, NULL, 0, NULL, "Write the breakpoint command script in the Python scripting language."}, - { 2, true, "commands", 'c', no_argument, NULL, 0, NULL, + { LLDB_OPT_SET_3, true, "commands", 'c', no_argument, NULL, 0, NULL, "Write the breakpoint command script using the command line commands."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } diff --git a/lldb/source/Commands/CommandObjectCall.cpp b/lldb/source/Commands/CommandObjectCall.cpp index 58d0a0e9f11..e7a5f8d1b1b 100644 --- a/lldb/source/Commands/CommandObjectCall.cpp +++ b/lldb/source/Commands/CommandObjectCall.cpp @@ -297,11 +297,11 @@ CommandObjectCall::Execute lldb::OptionDefinition CommandObjectCall::CommandOptions::g_option_table[] = { -{ 0, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."}, -{ 0, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."}, -{ 0, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, -{ 0, false, "noexecute", 'n', no_argument, NULL, 0, "no execute", "Only JIT and copy the wrapper & arguments, but don't execute."}, -{ 0, false, "useabi", 'a', no_argument, NULL, 0, NULL, "Use the ABI instead of the JIT to marshall arguments."}, +{ LLDB_OPT_SET_1, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."}, +{ LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."}, +{ LLDB_OPT_SET_1, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, +{ LLDB_OPT_SET_1, false, "noexecute", 'n', no_argument, NULL, 0, "no execute", "Only JIT and copy the wrapper & arguments, but don't execute."}, +{ LLDB_OPT_SET_1, false, "useabi", 'a', no_argument, NULL, 0, NULL, "Use the ABI instead of the JIT to marshall arguments."}, { 0, false, NULL, 0, 0, NULL, NULL, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 0985504e4ff..651858aa136 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -34,7 +34,8 @@ using namespace lldb_private; CommandObjectDisassemble::CommandOptions::CommandOptions () : Options(), m_func_name(), - m_load_addr() + m_start_addr(), + m_end_addr () { ResetOptionValues(); } @@ -64,13 +65,21 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (int option_idx, const show_bytes = true; break; - case 'a': - m_load_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 0); - if (m_load_addr == LLDB_INVALID_ADDRESS) - m_load_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 16); + case 's': + m_start_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 0); + if (m_start_addr == LLDB_INVALID_ADDRESS) + m_start_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 16); - if (m_load_addr == LLDB_INVALID_ADDRESS) - error.SetErrorStringWithFormat ("Invalid address string '%s'.\n", optarg); + if (m_start_addr == LLDB_INVALID_ADDRESS) + error.SetErrorStringWithFormat ("Invalid start address string '%s'.\n", optarg); + break; + case 'e': + m_end_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 0); + if (m_end_addr == LLDB_INVALID_ADDRESS) + m_end_addr = Args::StringToUInt64(optarg, LLDB_INVALID_ADDRESS, 16); + + if (m_end_addr == LLDB_INVALID_ADDRESS) + error.SetErrorStringWithFormat ("Invalid end address string '%s'.\n", optarg); break; case 'n': @@ -97,7 +106,8 @@ CommandObjectDisassemble::CommandOptions::ResetOptionValues () show_bytes = false; num_lines_context = 0; m_func_name.clear(); - m_load_addr = LLDB_INVALID_ADDRESS; + m_start_addr = LLDB_INVALID_ADDRESS; + m_end_addr = LLDB_INVALID_ADDRESS; } const lldb::OptionDefinition* @@ -109,22 +119,17 @@ CommandObjectDisassemble::CommandOptions::GetDefinitions () lldb::OptionDefinition CommandObjectDisassemble::CommandOptions::g_option_table[] = { -{ 0, false, "bytes", 'b', no_argument, NULL, 0, NULL, "Show opcode bytes when disassembling."}, -{ 0, false, "context", 'c', required_argument, NULL, 0, "<num-lines>", "Number of context lines of source to show."}, -{ 0, false, "mixed", 'm', no_argument, NULL, 0, NULL, "Enable mixed source and assembly display."}, -{ 0, false, "raw", 'r', no_argument, NULL, 0, NULL, "Print raw disassembly with no symbol information."}, - -{ 1, false, "address", 'a', required_argument, NULL, 0, "<address>", "Address to start disassembling."}, -{ 1, false, "bytes", 'b', no_argument, NULL, 0, NULL, "Show opcode bytes when disassembling."}, -{ 1, false, "context", 'c', required_argument, NULL, 0, "<num-lines>", "Number of context lines of source to show."}, -{ 1, false, "mixed", 'm', no_argument, NULL, 0, NULL, "Enable mixed source and assembly display."}, -{ 1, false, "raw", 'r', no_argument, NULL, 0, NULL, "Print raw disassembly with no symbol information."}, - -{ 2, false, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<function-name>", "Disassemble entire contents of the given function name."}, -{ 2, false, "bytes", 'b', no_argument, NULL, 0, NULL, "Show opcode bytes when disassembling."}, -{ 2, false, "context", 'c', required_argument, NULL, 0, "<num-lines>", "Number of context lines of source to show."}, -{ 2, false, "mixed", 'm', no_argument, NULL, 0, NULL, "Enable mixed source and assembly display."}, -{ 2, false, "raw", 'r', no_argument, NULL, 0, NULL, "Print raw disassembly with no symbol information."}, +{ LLDB_OPT_SET_ALL, false, "bytes", 'b', no_argument, NULL, 0, NULL, "Show opcode bytes when disassembling."}, +{ LLDB_OPT_SET_ALL, false, "context", 'c', required_argument, NULL, 0, "<num-lines>", "Number of context lines of source to show."}, +{ LLDB_OPT_SET_ALL, false, "mixed", 'm', no_argument, NULL, 0, NULL, "Enable mixed source and assembly display."}, +{ LLDB_OPT_SET_ALL, false, "raw", 'r', no_argument, NULL, 0, NULL, "Print raw disassembly with no symbol information."}, + +{ LLDB_OPT_SET_1, true, "start-address", 's', required_argument, NULL, 0, "<start-address>", "Address to start disassembling."}, +{ LLDB_OPT_SET_1, false, "end-address", 'e', required_argument, NULL, 0, "<end-address>", "Address to start disassembling."}, + +{ LLDB_OPT_SET_2, true, "name", 'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, "<function-name>", "Disassemble entire contents of the given function name."}, + +{ LLDB_OPT_SET_3, false, "current-frame", 'f', no_argument, NULL, 0, "<current-frame>", "Disassemble entire contents of the current frame's function."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -138,7 +143,7 @@ CommandObjectDisassemble::CommandOptions::g_option_table[] = CommandObjectDisassemble::CommandObjectDisassemble () : CommandObject ("disassemble", "Disassemble bytes in the current function or anywhere in the inferior program.", - "disassemble [[<start-addr> [<end-addr>]] | <function-name>] [<cmd-options>]") + "disassemble [<cmd-options>]") { } @@ -317,15 +322,35 @@ CommandObjectDisassemble::Execute lldb::addr_t end_addr = LLDB_INVALID_ADDRESS; ConstString name; const size_t argc = command.GetArgumentCount(); - if (argc == 0 && m_options.m_load_addr != LLDB_INVALID_ADDRESS) + if (argc != 0) { - addr = m_options.m_load_addr; - end_addr = addr + DEFAULT_DISASM_BYTE_SIZE; - } else if (argc == 0 && !m_options.m_func_name.empty()) + result.AppendErrorWithFormat ("\"disassemble\" doesn't take any arguments.\n"); + result.SetStatus (eReturnStatusFailed); + return false; + } + + if (m_options.m_start_addr != LLDB_INVALID_ADDRESS) + { + addr = m_options.m_start_addr; + if (m_options.m_end_addr != LLDB_INVALID_ADDRESS) + { + end_addr = m_options.m_end_addr; + if (end_addr < addr) + { + result.AppendErrorWithFormat ("End address before start address.\n"); + result.SetStatus (eReturnStatusFailed); + return false; + } + } + else + end_addr = addr + DEFAULT_DISASM_BYTE_SIZE; + } + else if (!m_options.m_func_name.empty()) { ConstString tmpname(m_options.m_func_name.c_str()); name = tmpname; - } else if (argc == 0) + } + else { ExecutionContext exe_ctx(context->GetExecutionContext()); if (exe_ctx.frame) @@ -361,38 +386,6 @@ CommandObjectDisassemble::Execute return false; } } - else if (argc == 1) - { - const char *arg = command.GetArgumentAtIndex(0); - addr = Args::StringToAddress (arg); - if (addr == LLDB_INVALID_ADDRESS) - { - // Lookup function or symbol name? - ConstString tmpname(arg); - name = tmpname; - } - else - { - end_addr = addr + DEFAULT_DISASM_BYTE_SIZE; - } - } - else if (argc >= 1 && argc <= 2) - { - addr = Args::StringToAddress (command.GetArgumentAtIndex(0)); - if (addr == LLDB_INVALID_ADDRESS) - { - result.AppendErrorWithFormat ("Unable to parse address '%s'.\n", command.GetArgumentAtIndex(0)); - result.SetStatus (eReturnStatusFailed); - return false; - } - end_addr = Args::StringToAddress (command.GetArgumentAtIndex(1), addr); - if (end_addr == LLDB_INVALID_ADDRESS) - { - result.AppendErrorWithFormat ("Unable to parse address '%s'.\n", command.GetArgumentAtIndex(1)); - result.SetStatus (eReturnStatusFailed); - return false; - } - } if (!name.IsEmpty()) { @@ -413,19 +406,10 @@ CommandObjectDisassemble::Execute return false; } } - - if (addr < end_addr) + else { Disassemble (context, interpreter, result, disassembler, addr, end_addr); } - if (addr == LLDB_INVALID_ADDRESS && name.IsEmpty()) - { - result.AppendError ("No recognizable address of function name provided"); - result.SetStatus (eReturnStatusFailed); - return false; - } - { - return result.Succeeded(); - } + return result.Succeeded(); } diff --git a/lldb/source/Commands/CommandObjectDisassemble.h b/lldb/source/Commands/CommandObjectDisassemble.h index 2cf800d2f59..e4587cb72c2 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.h +++ b/lldb/source/Commands/CommandObjectDisassemble.h @@ -49,7 +49,8 @@ public: uint32_t num_lines_context; bool raw; std::string m_func_name; - lldb::addr_t m_load_addr; + lldb::addr_t m_start_addr; + lldb::addr_t m_end_addr; static lldb::OptionDefinition g_option_table[]; }; diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 9afc8c0a1a3..1ed606b74e9 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -546,9 +546,9 @@ CommandObjectExpression::ExecuteRawCommandString lldb::OptionDefinition CommandObjectExpression::CommandOptions::g_option_table[] = { -{ 0, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."}, -{ 0, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."}, -{ 0, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, +{ LLDB_OPT_SET_1, true, "language", 'l', required_argument, NULL, 0, "[c|c++|objc|objc++]", "Sets the language to use when parsing the expression."}, +{ LLDB_OPT_SET_2, false, "format", 'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]", "Specify the format that the expression output should use."}, +{ LLDB_OPT_SET_3, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable verbose debug logging of the expression parsing and evaluation."}, { 0, false, NULL, 0, 0, NULL, NULL, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectFile.cpp b/lldb/source/Commands/CommandObjectFile.cpp index 01576c5b6d5..de40c6ee7fd 100644 --- a/lldb/source/Commands/CommandObjectFile.cpp +++ b/lldb/source/Commands/CommandObjectFile.cpp @@ -38,7 +38,7 @@ CommandObjectFile::CommandOptions::~CommandOptions () lldb::OptionDefinition CommandObjectFile::CommandOptions::g_option_table[] = { - { 0, false, "arch", 'a', required_argument, NULL, 0, "<arch>", "Specify the architecture to launch."}, + { LLDB_OPT_SET_1, false, "arch", 'a', required_argument, NULL, 0, "<arch>", "Specify the architecture to launch."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectImage.cpp b/lldb/source/Commands/CommandObjectImage.cpp index ab728e9d32d..1f4d170e7b4 100644 --- a/lldb/source/Commands/CommandObjectImage.cpp +++ b/lldb/source/Commands/CommandObjectImage.cpp @@ -1066,13 +1066,13 @@ protected: lldb::OptionDefinition CommandObjectImageList::CommandOptions::g_option_table[] = { -{ 0, false, "arch", 'a', optional_argument, NULL, 0, "<width>", "Display the architecture when listing images."}, -{ 0, false, "uuid", 'u', no_argument, NULL, 0, NULL, "Display the UUID when listing images."}, -{ 0, false, "fullpath", 'f', optional_argument, NULL, 0, "<width>", "Display the fullpath to the image object file."}, -{ 0, false, "directory", 'd', optional_argument, NULL, 0, "<width>", "Display the directory with optional width for the image object file."}, -{ 0, false, "basename", 'b', optional_argument, NULL, 0, "<width>", "Display the basename with optional width for the image object file."}, -{ 0, false, "symfile", 's', optional_argument, NULL, 0, "<width>", "Display the fullpath to the image symbol file with optional width."}, -{ 0, false, "symfile-basename", 'S', optional_argument, NULL, 0, "<width>", "Display the basename to the image symbol file with optional width."}, +{ LLDB_OPT_SET_1, false, "arch", 'a', optional_argument, NULL, 0, "<width>", "Display the architecture when listing images."}, +{ LLDB_OPT_SET_1, false, "uuid", 'u', no_argument, NULL, 0, NULL, "Display the UUID when listing images."}, +{ LLDB_OPT_SET_1, false, "fullpath", 'f', optional_argument, NULL, 0, "<width>", "Display the fullpath to the image object file."}, +{ LLDB_OPT_SET_1, false, "directory", 'd', optional_argument, NULL, 0, "<width>", "Display the directory with optional width for the image object file."}, +{ LLDB_OPT_SET_1, false, "basename", 'b', optional_argument, NULL, 0, "<width>", "Display the basename with optional width for the image object file."}, +{ LLDB_OPT_SET_1, false, "symfile", 's', optional_argument, NULL, 0, "<width>", "Display the fullpath to the image symbol file with optional width."}, +{ LLDB_OPT_SET_1, false, "symfile-basename", 'S', optional_argument, NULL, 0, "<width>", "Display the basename to the image symbol file with optional width."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -1381,15 +1381,14 @@ protected: lldb::OptionDefinition CommandObjectImageLookup::CommandOptions::g_option_table[] = { -{ 1, true, "address", 'a', required_argument, NULL, 0, "<addr>", "Lookup an address in one or more executable images."}, -{ 1, false, "offset", 'o', required_argument, NULL, 0, "<offset>", "When looking up an address subtract <offset> from any addresses before doing the lookup."}, -{ 2, true, "symbol", 's', required_argument, NULL, 0, "<name>", "Lookup a symbol by name in the symbol tables in one or more executable images."}, -{ 2, false, "regex", 'r', no_argument, NULL, 0, NULL, "The <name> argument for name lookups are regular expressions."}, -{ 3, true, "file", 'f', required_argument, NULL, 0, "<file>", "Lookup a file by fullpath or basename in one or more executable images."}, -{ 3, false, "line", 'l', required_argument, NULL, 0, "<line>", "Lookup a line number in a file (must be used in conjunction with --file)."}, -{ 3, false, "no-inlines", 'i', no_argument, NULL, 0, NULL, "Check inline line entries (must be used in conjunction with --file)."}, -{ 4, true, "function", 'n', required_argument, NULL, 0, "<name>", "Lookup a function by name in the debug symbols in one or more executable images."}, -{ 5, false, "regex", 'r', no_argument, NULL, 0, NULL, "The <name> argument for name lookups are regular expressions."}, +{ LLDB_OPT_SET_1, true, "address", 'a', required_argument, NULL, 0, "<addr>", "Lookup an address in one or more executable images."}, +{ LLDB_OPT_SET_1, false, "offset", 'o', required_argument, NULL, 0, "<offset>", "When looking up an address subtract <offset> from any addresses before doing the lookup."}, +{ LLDB_OPT_SET_2, true, "symbol", 's', required_argument, NULL, 0, "<name>", "Lookup a symbol by name in the symbol tables in one or more executable images."}, +{ LLDB_OPT_SET_2, false, "regex", 'r', no_argument, NULL, 0, NULL, "The <name> argument for name lookups are regular expressions."}, +{ LLDB_OPT_SET_3, true, "file", 'f', required_argument, NULL, 0, "<file>", "Lookup a file by fullpath or basename in one or more executable images."}, +{ LLDB_OPT_SET_3, false, "line", 'l', required_argument, NULL, 0, "<line>", "Lookup a line number in a file (must be used in conjunction with --file)."}, +{ LLDB_OPT_SET_3, false, "no-inlines", 'i', no_argument, NULL, 0, NULL, "Check inline line entries (must be used in conjunction with --file)."}, +{ LLDB_OPT_SET_4, true, "function", 'n', required_argument, NULL, 0, "<name>", "Lookup a function by name in the debug symbols in one or more executable images."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index 6b54badd7fc..58c1b81933a 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -226,14 +226,14 @@ protected: lldb::OptionDefinition CommandObjectLogEnable::CommandOptions::g_option_table[] = { -{ 0, false, "file", 'f', required_argument, NULL, 0, "<filename>", "Set the destination file to log to."}, -{ 0, false, "threadsafe", 't', no_argument, NULL, 0, NULL, "Enable thread safe logging to avoid interweaved log lines." }, -{ 0, false, "verbose", 'v', no_argument, NULL, 0, NULL, "Enable verbose logging." }, -{ 0, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable debug logging." }, -{ 0, false, "sequence", 's', no_argument, NULL, 0, NULL, "Prepend all log lines with an increasing integer sequence id." }, -{ 0, false, "timestamp", 'T', no_argument, NULL, 0, NULL, "Prepend all log lines with a timestamp." }, -{ 0, false, "pid-tid", 'p', no_argument, NULL, 0, NULL, "Prepend all log lines with the process and thread ID that generates the log line." }, -{ 0, false, "thread-name",'n', no_argument, NULL, 0, NULL, "Prepend all log lines with the thread name for the thread that generates the log line." }, +{ LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, 0, "<filename>", "Set the destination file to log to."}, +{ LLDB_OPT_SET_1, false, "threadsafe", 't', no_argument, NULL, 0, NULL, "Enable thread safe logging to avoid interweaved log lines." }, +{ LLDB_OPT_SET_1, false, "verbose", 'v', no_argument, NULL, 0, NULL, "Enable verbose logging." }, +{ LLDB_OPT_SET_1, false, "debug", 'g', no_argument, NULL, 0, NULL, "Enable debug logging." }, +{ LLDB_OPT_SET_1, false, "sequence", 's', no_argument, NULL, 0, NULL, "Prepend all log lines with an increasing integer sequence id." }, +{ LLDB_OPT_SET_1, false, "timestamp", 'T', no_argument, NULL, 0, NULL, "Prepend all log lines with a timestamp." }, +{ LLDB_OPT_SET_1, false, "pid-tid", 'p', no_argument, NULL, 0, NULL, "Prepend all log lines with the process and thread ID that generates the log line." }, +{ LLDB_OPT_SET_1, false, "thread-name",'n', no_argument, NULL, 0, NULL, "Prepend all log lines with the thread name for the thread that generates the log line." }, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 91abd81e9fd..aefe5fe9965 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -317,10 +317,10 @@ protected: lldb::OptionDefinition CommandObjectMemoryRead::CommandOptions::g_option_table[] = { - { 0, false, "format", 'f', required_argument, NULL, 0, "<format>", "The format that will be used to display the memory. Defaults to bytes with ASCII (--format=Y)."}, - { 0, false, "size", 's', required_argument, NULL, 0, "<byte-size>","The size in bytes to use when displaying with the selected format."}, - { 0, false, "num-per-line", 'l', required_argument, NULL, 0, "<N>", "The number of items per line to display."}, - { 0, false, "count", 'c', required_argument, NULL, 0, "<N>", "The number of total items to display."}, + { LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, "<format>", "The format that will be used to display the memory. Defaults to bytes with ASCII (--format=Y)."}, + { LLDB_OPT_SET_1, false, "size", 's', required_argument, NULL, 0, "<byte-size>","The size in bytes to use when displaying with the selected format."}, + { LLDB_OPT_SET_1, false, "num-per-line", 'l', required_argument, NULL, 0, "<N>", "The number of items per line to display."}, + { LLDB_OPT_SET_1, false, "count", 'c', required_argument, NULL, 0, "<N>", "The number of total items to display."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -656,8 +656,8 @@ protected: lldb::OptionDefinition CommandObjectMemoryWrite::CommandOptions::g_option_table[] = { - { 0, false, "format", 'f', required_argument, NULL, 0, "<format>", "The format value types that will be decoded and written to memory."}, - { 0, false, "size", 's', required_argument, NULL, 0, "<byte-size>","The size in bytes of the values to write to memory."}, + { LLDB_OPT_SET_1, false, "format", 'f', required_argument, NULL, 0, "<format>", "The format value types that will be decoded and written to memory."}, + { LLDB_OPT_SET_1, false, "size", 's', required_argument, NULL, 0, "<byte-size>","The size in bytes of the values to write to memory."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index ea0f6aff5eb..537fe7c9326 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -264,11 +264,11 @@ protected: lldb::OptionDefinition CommandObjectProcessLaunch::CommandOptions::g_option_table[] = { -{ 0, false, "stop-at-entry", 's', no_argument, NULL, 0, NULL, "Stop at the entry point of the program when launching a process."}, -{ 0, false, "stdin", 'i', required_argument, NULL, 0, "<path>", "Redirect stdin for the process to <path>."}, -{ 0, false, "stdout", 'o', required_argument, NULL, 0, "<path>", "Redirect stdout for the process to <path>."}, -{ 0, false, "stderr", 'e', required_argument, NULL, 0, "<path>", "Redirect stderr for the process to <path>."}, -{ 0, false, "plugin", 'p', required_argument, NULL, 0, "<plugin>", "Name of the process plugin you want to use."}, +{ LLDB_OPT_SET_1, false, "stop-at-entry", 's', no_argument, NULL, 0, NULL, "Stop at the entry point of the program when launching a process."}, +{ LLDB_OPT_SET_1, false, "stdin", 'i', required_argument, NULL, 0, "<path>", "Redirect stdin for the process to <path>."}, +{ LLDB_OPT_SET_1, false, "stdout", 'o', required_argument, NULL, 0, "<path>", "Redirect stdout for the process to <path>."}, +{ LLDB_OPT_SET_1, false, "stderr", 'e', required_argument, NULL, 0, "<path>", "Redirect stderr for the process to <path>."}, +{ LLDB_OPT_SET_1, false, "plugin", 'p', required_argument, NULL, 0, "<plugin>", "Name of the process plugin you want to use."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -478,10 +478,10 @@ protected: lldb::OptionDefinition CommandObjectProcessAttach::CommandOptions::g_option_table[] = { -{ 0, false, "pid", 'p', required_argument, NULL, 0, "<pid>", "The process ID of an existing process to attach to."}, -{ 0, false, "plugin", 'P', required_argument, NULL, 0, "<plugin>", "Name of the process plugin you want to use."}, -{ 1, true, "name", 'n', required_argument, NULL, 0, "<process-name>", "The name of the process to attach to."}, -{ 1, false, "waitfor", 'w', no_argument, NULL, 0, NULL, "Wait for the the process with <process-name> to launch."}, +{ LLDB_OPT_SET_ALL, false, "plugin", 'P', required_argument, NULL, 0, "<plugin>", "Name of the process plugin you want to use."}, +{ LLDB_OPT_SET_1, false, "pid", 'p', required_argument, NULL, 0, "<pid>", "The process ID of an existing process to attach to."}, +{ LLDB_OPT_SET_2, true, "name", 'n', required_argument, NULL, 0, "<process-name>", "The name of the process to attach to."}, +{ LLDB_OPT_SET_2, false, "waitfor", 'w', no_argument, NULL, 0, NULL, "Wait for the the process with <process-name> to launch."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectSourceFile.cpp b/lldb/source/Commands/CommandObjectSourceFile.cpp index df70bc9aea3..fbffe10081e 100644 --- a/lldb/source/Commands/CommandObjectSourceFile.cpp +++ b/lldb/source/Commands/CommandObjectSourceFile.cpp @@ -85,9 +85,9 @@ CommandObjectSourceFile::CommandOptions::GetDefinitions () lldb::OptionDefinition CommandObjectSourceFile::CommandOptions::g_option_table[] = { -{ 0, false, "line", 'l', required_argument, NULL, 0, "<line>", "The line number at which to start the display source."}, -{ 0, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<file>", "The file from which to display source."}, -{ 0, false, "count", 'n', required_argument, NULL, 0, "<count>", "The number of source lines to display."}, +{ LLDB_OPT_SET_1, false, "line", 'l', required_argument, NULL, 0, "<line>", "The line number at which to start the display source."}, +{ LLDB_OPT_SET_1, false, "file", 'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, "<file>", "The file from which to display source."}, +{ LLDB_OPT_SET_1, false, "count", 'n', required_argument, NULL, 0, "<count>", "The number of source lines to display."}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 0cc326f5f45..76d13e8cb54 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -619,8 +619,8 @@ g_duo_running_mode[] = lldb::OptionDefinition CommandObjectThreadStepWithTypeAndScope::CommandOptions::g_option_table[] = { -{ 0, true, "avoid_no_debug", 'a', required_argument, NULL, 0, "<avoid_no_debug>", "Should step-in step over functions with no debug information"}, -{ 0, true, "run_mode", 'm', required_argument, g_tri_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"}, +{ LLDB_OPT_SET_1, true, "avoid_no_debug", 'a', required_argument, NULL, 0, "<avoid_no_debug>", "Should step-in step over functions with no debug information"}, +{ LLDB_OPT_SET_1, true, "run_mode", 'm', required_argument, g_tri_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; @@ -1056,9 +1056,9 @@ protected: lldb::OptionDefinition CommandObjectThreadUntil::CommandOptions::g_option_table[] = { -{ 0, true, "frame", 'f', required_argument, NULL, 0, "<frame>", "Frame index for until operation - defaults to 0"}, -{ 0, true, "thread", 't', required_argument, NULL, 0, "<thread>", "Thread index for the thread for until operation"}, -{ 0, true, "run_mode", 'm', required_argument, g_duo_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"}, +{ LLDB_OPT_SET_1, true, "frame", 'f', required_argument, NULL, 0, "<frame>", "Frame index for until operation - defaults to 0"}, +{ LLDB_OPT_SET_1, true, "thread", 't', required_argument, NULL, 0, "<thread>", "Thread index for the thread for until operation"}, +{ LLDB_OPT_SET_1, true, "run_mode", 'm', required_argument, g_duo_running_mode, 0, "<run_mode>", "Determine how to run other threads while stepping this one"}, { 0, false, NULL, 0, 0, NULL, 0, NULL, NULL } }; diff --git a/lldb/source/Commands/CommandObjectVariable.cpp b/lldb/source/Commands/CommandObjectVariable.cpp index 6bde4829be0..c802374ed94 100644 --- a/lldb/source/Commands/CommandObjectVariable.cpp +++ b/lldb/source/Commands/CommandObjectVariable.cpp @@ -761,20 +761,20 @@ protected: lldb::OptionDefinition CommandObjectVariableList::CommandOptions::g_option_table[] = { -{ 0, false, "debug", 'D', no_argument, NULL, 0, NULL, "Show verbose debug information."}, -{ 0, false, "depth", 'd', required_argument, NULL, 0, "<count>", "Set the max recurse depth when dumping aggregate types (default is infinity)."}, -{ 0, false, "globals", 'g', no_argument, NULL, 0, NULL, "List global and static variables for the current stack frame source file."}, -{ 0, false, "global", 'G', required_argument, NULL, 0, NULL, "Find a global variable by name (which might not be in the current stack frame source file)."}, -{ 0, false, "location", 'L', no_argument, NULL, 0, NULL, "Show variable location information."}, -{ 0, false, "name", 'n', required_argument, NULL, 0, "<name>", "Lookup a variable by name or regex (--regex) for the current execution context."}, -{ 0, false, "no-args", 'a', no_argument, NULL, 0, NULL, "Omit function arguments."}, -{ 0, false, "no-locals", 'l', no_argument, NULL, 0, NULL, "Omit local variables."}, -{ 0, false, "no-types", 't', no_argument, NULL, 0, NULL, "Omit variable type names."}, -{ 0, false, "no-summary", 'y', no_argument, NULL, 0, NULL, "Omit summary information."}, -{ 0, false, "scope", 's', no_argument, NULL, 0, NULL, "Show variable scope (argument, local, global, static)."}, -{ 0, false, "objc", 'o', no_argument, NULL, 0, NULL, "When looking up a variable by name (--name), print as an Objective-C object."}, -{ 0, false, "ptr-depth", 'p', required_argument, NULL, 0, "<count>", "The number of pointers to be traversed when dumping values (default is zero)."}, -{ 0, false, "regex", 'r', no_argument, NULL, 0, NULL, "The <name> argument for name lookups are regular expressions."}, +{ LLDB_OPT_SET_1, false, "debug", 'D', no_argument, NULL, 0, NULL, "Show verbose debug information."}, +{ LLDB_OPT_SET_1, false, "depth", 'd', required_argument, NULL, 0, "<count>", "Set the max recurse depth when dumping aggregate types (default is infinity)."}, +{ LLDB_OPT_SET_1, false, "globals", 'g', no_argument, NULL, 0, NULL, "List global and static variables for the current stack frame source file."}, +{ LLDB_OPT_SET_1, false, "global", 'G', required_argument, NULL, 0, NULL, "Find a global variable by name (which might not be in the current stack frame source file)."}, +{ LLDB_OPT_SET_1, false, "location", 'L', no_argument, NULL, 0, NULL, "Show variable location information."}, +{ LLDB_OPT_SET_1, false, "name", 'n', required_argument, NULL, 0, "<name>", "Lookup a variable by name or regex (--regex) for the current execution context."}, +{ LLDB_OPT_SET_1, false, "no-args", 'a', no_argument, NULL, 0, NULL, "Omit function arguments."}, +{ LLDB_OPT_SET_1, false, "no-locals", 'l', no_argument, NULL, 0, NULL, "Omit local variables."}, +{ LLDB_OPT_SET_1, false, "no-types", 't', no_argument, NULL, 0, NULL, "Omit variable type names."}, +{ LLDB_OPT_SET_1, false, "no-summary", 'y', no_argument, NULL, 0, NULL, "Omit summary information."}, +{ LLDB_OPT_SET_1, false, "scope", 's', no_argument, NULL, 0, NULL, "Show variable scope (argument, local, global, static)."}, +{ LLDB_OPT_SET_1, false, "objc", 'o', no_argument, NULL, 0, NULL, "When looking up a variable by name (--name), print as an Objective-C object."}, +{ LLDB_OPT_SET_1, false, "ptr-depth", 'p', required_argument, NULL, 0, "<count>", "The number of pointers to be traversed when dumping values (default is zero)."}, +{ LLDB_OPT_SET_1, false, "regex", 'r', no_argument, NULL, 0, NULL, "The <name> argument for name lookups are regular expressions."}, { 0, false, NULL, 0, 0, NULL, NULL, NULL, NULL } }; |