summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-10-07 18:58:12 +0000
committerGreg Clayton <gclayton@apple.com>2011-10-07 18:58:12 +0000
commitcf0e4f0dafe445ae2ca9228e41767944329f30c4 (patch)
tree2b40b1c1cb173b2ceb6b3f77b41c52c22b1f9be0 /lldb/source/Commands/CommandObjectBreakpointCommand.cpp
parent08d0491006c28c92e18de9e108ad09e6333d4fed (diff)
downloadbcm5719-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/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp75
1 files changed, 36 insertions, 39 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index 5130a2f86be..942d7ff891c 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -91,45 +91,42 @@ CommandObjectBreakpointCommandAdd::CommandOptions::SetOptionValue
char short_option = (char) m_getopt_table[option_idx].val;
switch (short_option)
- {
- case 'o':
- m_use_one_liner = true;
- m_one_liner = option_arg;
- break;
- break;
- case 's':
- {
- bool found_one = false;
- m_script_language = (lldb::ScriptLanguage) Args::StringToOptionEnum (option_arg,
- g_option_table[option_idx].enum_values,
- eScriptLanguageNone,
- &found_one);
- if (!found_one)
- error.SetErrorStringWithFormat("Invalid enumeration value '%s' for option '%c'.\n",
- option_arg,
- short_option);
-
- if (m_script_language == eScriptLanguagePython || m_script_language == eScriptLanguageDefault)
- {
- m_use_commands = false;
- m_use_script_language = true;
- }
- else
- {
- m_use_commands = true;
- m_use_script_language = false;
- }
- }
- break;
- case 'e':
- bool success_ptr;
- m_stop_on_error = Args::StringToBoolean(option_arg, false, &success_ptr);
- if (!success_ptr)
- error.SetErrorStringWithFormat("Invalid value for stop-on-error: \"%s\".\n", option_arg);
- break;
- default:
- break;
- }
+ {
+ case 'o':
+ m_use_one_liner = true;
+ m_one_liner = option_arg;
+ break;
+
+ case 's':
+ m_script_language = (lldb::ScriptLanguage) Args::StringToOptionEnum (option_arg,
+ g_option_table[option_idx].enum_values,
+ eScriptLanguageNone,
+ error);
+
+ if (m_script_language == eScriptLanguagePython || m_script_language == eScriptLanguageDefault)
+ {
+ m_use_commands = false;
+ m_use_script_language = true;
+ }
+ else
+ {
+ m_use_commands = true;
+ m_use_script_language = false;
+ }
+ break;
+
+ case 'e':
+ {
+ bool success = false;
+ m_stop_on_error = Args::StringToBoolean(option_arg, false, &success);
+ if (!success)
+ error.SetErrorStringWithFormat("Invalid value for stop-on-error: \"%s\".\n", option_arg);
+ }
+ break;
+
+ default:
+ break;
+ }
return error;
}
OpenPOWER on IntegriCloud