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/CommandObjectBreakpoint.cpp | |
parent | bfa20dddcbf31e05be41c3bd993bf25578bfa179 (diff) | |
download | llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.zip llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.tar.gz llvm-47cbf4a07bdfe8f5ef56be7a0caf003f91a00a9e.tar.bz2 |
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/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 5a175d6..b0193b67 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -22,6 +22,7 @@ #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueString.h" #include "lldb/Interpreter/OptionValueUInt64.h" @@ -100,7 +101,7 @@ public: break; case 'G': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_bp_opts.SetAutoContinue(value); } else @@ -121,7 +122,7 @@ public: break; case 'o': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_bp_opts.SetOneShot(value); } else @@ -377,8 +378,8 @@ public: switch (short_option) { case 'a': { - m_load_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + m_load_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); } break; case 'A': @@ -442,7 +443,7 @@ public: case 'h': { bool success; - m_catch_bp = Args::StringToBoolean(option_arg, true, &success); + m_catch_bp = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-catch option: '%s'", @@ -456,7 +457,7 @@ public: case 'K': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = OptionArgParser::ToBoolean(option_arg, true, &success); if (value) m_skip_prologue = eLazyBoolYes; else @@ -485,7 +486,7 @@ public: case 'm': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = OptionArgParser::ToBoolean(option_arg, true, &success); if (value) m_move_to_nearest_code = eLazyBoolYes; else @@ -519,8 +520,8 @@ public: case 'R': { lldb::addr_t tmp_offset_addr; - tmp_offset_addr = - Args::StringToAddress(execution_context, option_arg, 0, &error); + tmp_offset_addr = OptionArgParser::ToAddress(execution_context, + option_arg, 0, &error); if (error.Success()) m_offset_addr = tmp_offset_addr; } break; @@ -549,7 +550,7 @@ public: case 'w': { bool success; - m_throw_bp = Args::StringToBoolean(option_arg, true, &success); + m_throw_bp = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-throw option: '%s'", @@ -1783,7 +1784,7 @@ public: switch (short_option) { case 'L': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowList(value); } else @@ -1793,7 +1794,7 @@ public: } break; case 'A': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowDisable(value); } else @@ -1803,7 +1804,7 @@ public: } break; case 'D': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowDelete(value); } else |