aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpoint.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2010-06-15 18:47:14 +0000
committerJim Ingham <jingham@apple.com>2010-06-15 18:47:14 +0000
commit8651121c11e4b047924bafab305b7bec4395941b (patch)
treec49a0ff3ef8ed2de31b2c5d0db6f44d54890e296 /lldb/source/Commands/CommandObjectBreakpoint.cpp
parent5947573f391a156c8a74cc39c84d63ea19462566 (diff)
downloadllvm-8651121c11e4b047924bafab305b7bec4395941b.zip
llvm-8651121c11e4b047924bafab305b7bec4395941b.tar.gz
llvm-8651121c11e4b047924bafab305b7bec4395941b.tar.bz2
Change the Options parser over to use a mask rather than an ordinal for option sets.
Fixed the Disassemble arguments so you can't specify start address or name in multiple ways. Fixed the command line input so you can specify the filename without "-f" even if you use other options. llvm-svn: 106020
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp56
1 files changed, 18 insertions, 38 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index d24ba8f..68926e2 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 }
};