diff options
author | Greg Clayton <gclayton@apple.com> | 2011-10-07 18:58:12 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-10-07 18:58:12 +0000 |
commit | cf0e4f0dafe445ae2ca9228e41767944329f30c4 (patch) | |
tree | 2b40b1c1cb173b2ceb6b3f77b41c52c22b1f9be0 /lldb/source/Interpreter/OptionGroupWatchpoint.cpp | |
parent | 08d0491006c28c92e18de9e108ad09e6333d4fed (diff) | |
download | bcm5719-llvm-cf0e4f0dafe445ae2ca9228e41767944329f30c4.tar.gz bcm5719-llvm-cf0e4f0dafe445ae2ca9228e41767944329f30c4.zip |
Re-organized the contents of RangeMap.h to be more concise and also allow for a Range, RangeArray, RangeData (range + data), or a RangeDataArray. We have many range implementations in LLDB and I will be converting over to using the classes in RangeMap.h so we can have one set of code that does ranges and searching of ranges.
Fixed up DWARFDebugAranges to use the new range classes.
Fixed the enumeration parsing to take a lldb_private::Error to avoid a lot of duplicated code. Now when an invalid enumeration is supplied, an error will be returned and that error will contain a list of the valid enumeration values.
llvm-svn: 141382
Diffstat (limited to 'lldb/source/Interpreter/OptionGroupWatchpoint.cpp')
-rw-r--r-- | lldb/source/Interpreter/OptionGroupWatchpoint.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp index 076d010ae7e..c1f2182c1b5 100644 --- a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp +++ b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp @@ -64,21 +64,16 @@ OptionGroupWatchpoint::SetOptionValue (CommandInterpreter &interpreter, char short_option = (char) g_option_table[option_idx].short_option; switch (short_option) { - case 'w': { - OptionEnumValueElement *enum_values = g_option_table[option_idx].enum_values; - watch_type = (WatchType) Args::StringToOptionEnum(option_arg, enum_values, 0, &watch_variable); - if (!watch_variable) - error.SetErrorStringWithFormat("Invalid option arg for '-w': '%s'.\n", option_arg); + case 'w': + watch_type = (WatchType) Args::StringToOptionEnum(option_arg, g_option_table[option_idx].enum_values, 0, error); + if (error.Success()) + watch_variable = true; break; - } - case 'x': { - bool success = false; - OptionEnumValueElement *enum_values = g_option_table[option_idx].enum_values; - watch_size = (WatchType) Args::StringToOptionEnum(option_arg, enum_values, 0, &success); - if (!success) - error.SetErrorStringWithFormat("Invalid option arg for '-x': '%s'.\n", option_arg); + + case 'x': + watch_size = (WatchType) Args::StringToOptionEnum(option_arg, g_option_table[option_idx].enum_values, 0, error); break; - } + default: error.SetErrorStringWithFormat("Invalid short option character '%c'.\n", short_option); break; @@ -91,8 +86,8 @@ void OptionGroupWatchpoint::OptionParsingStarting (CommandInterpreter &interpreter) { watch_variable = false; - watch_type = eWatchInvalid; - watch_size = 0; + watch_type = eWatchInvalid; + watch_size = 0; } |