diff options
author | Zachary Turner <zturner@google.com> | 2016-09-23 17:48:13 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2016-09-23 17:48:13 +0000 |
commit | 8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4 (patch) | |
tree | 1ce2972876d13303fcd7f12d5774f806921d3421 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | 6c46efba7818644ddab8d8c52940583c0672fd98 (diff) | |
download | bcm5719-llvm-8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4.tar.gz bcm5719-llvm-8cef4b0bb4bae8598efa7cd1274e54f534b0f4a4.zip |
Update OptionGroup::SetValue to take StringRef.
Then deal with all the fallout.
Differential Revision: https://reviews.llvm.org/D24847
llvm-svn: 282265
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index cb6d1d83907..4202068c680 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -217,7 +217,8 @@ public: break; case 'E': { - LanguageType language = Language::GetLanguageTypeFromString(option_arg); + LanguageType language = + Language::GetLanguageTypeFromString(option_strref); switch (language) { case eLanguageTypeC89: @@ -304,7 +305,7 @@ public: } case 'L': - m_language = Language::GetLanguageTypeFromString(option_arg); + m_language = Language::GetLanguageTypeFromString(option_strref); if (m_language == eLanguageTypeUnknown) error.SetErrorStringWithFormat( "Unknown language type: '%s' for breakpoint", option_arg); @@ -1772,28 +1773,29 @@ public: return llvm::makeArrayRef(g_breakpoint_name_options); } - Error SetOptionValue(uint32_t option_idx, const char *option_value, + Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Error error; const int short_option = g_breakpoint_name_options[option_idx].short_option; - llvm::StringRef option_strref(option_value ? option_value : ""); switch (short_option) { case 'N': - if (BreakpointID::StringIsBreakpointName(option_strref, error) && + if (BreakpointID::StringIsBreakpointName(option_value, error) && error.Success()) - m_name.SetValueFromString(option_strref); + m_name.SetValueFromString(option_value); break; case 'B': if (m_breakpoint.SetValueFromString(option_value).Fail()) error.SetErrorStringWithFormat( - "unrecognized value \"%s\" for breakpoint", option_value); + "unrecognized value \"%s\" for breakpoint", + option_value.str().c_str()); break; case 'D': if (m_use_dummy.SetValueFromString(option_value).Fail()) error.SetErrorStringWithFormat( - "unrecognized value \"%s\" for use-dummy", option_value); + "unrecognized value \"%s\" for use-dummy", + option_value.str().c_str()); break; default: @@ -1803,6 +1805,7 @@ public: } return error; } + Error SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete; void OptionParsingStarting(ExecutionContext *execution_context) override { m_name.Clear(); |