diff options
author | Pavel Labath <labath@google.com> | 2018-04-10 09:03:59 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-04-10 09:03:59 +0000 |
commit | 47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e (patch) | |
tree | 9d619d8e076a6c0a5113264c2b3d96369f85e275 /lldb/source/Commands/CommandObjectTarget.cpp | |
parent | bfa20dddcbf31e05be41c3bd993bf25578bfa179 (diff) | |
download | bcm5719-llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.tar.gz bcm5719-llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.zip |
Move Args::StringTo*** functions to a new OptionArgParser class
Summary:
The idea behind this is to move the functionality which depend on other lldb
classes into a separate class. This way, the Args class can be turned
into a lightweight arc+argv wrapper and moved into the lower lldb
layers.
Reviewers: jingham, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D44306
llvm-svn: 329677
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 7fb9c430ec0..7520c510f7b 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -24,6 +24,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupArchitecture.h" #include "lldb/Interpreter/OptionGroupBoolean.h" #include "lldb/Interpreter/OptionGroupFile.h" @@ -1983,7 +1984,7 @@ public: switch (short_option) { case 's': - m_sort_order = (SortOrder)Args::StringToOptionEnum( + m_sort_order = (SortOrder)OptionArgParser::ToOptionEnum( option_arg, GetDefinitions()[option_idx].enum_values, eSortOrderNone, error); break; @@ -2885,8 +2886,8 @@ public: if (short_option == 'g') { m_use_global_module_list = true; } else if (short_option == 'a') { - m_module_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + m_module_addr = OptionArgParser::ToAddress( + execution_context, option_arg, LLDB_INVALID_ADDRESS, &error); } else { unsigned long width = 0; option_arg.getAsInteger(0, width); @@ -3251,8 +3252,8 @@ public: case 'a': { m_str = option_arg; m_type = eLookupTypeAddress; - m_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + m_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); if (m_addr == LLDB_INVALID_ADDRESS) error.SetErrorStringWithFormat("invalid address string '%s'", option_arg.str().c_str()); @@ -3567,8 +3568,8 @@ public: switch (short_option) { case 'a': { m_type = eLookupTypeAddress; - m_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + m_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); } break; case 'o': |