diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 27 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpointCommand.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectCommands.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.cpp | 11 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectLog.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 27 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectProcess.cpp | 5 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 9 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 15 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 22 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectType.cpp | 9 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpointCommand.cpp | 6 |
13 files changed, 88 insertions, 70 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 5a175d61060..b0193b67023 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 diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 170cb851311..95a17db8081 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -22,6 +22,7 @@ #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" @@ -293,7 +294,7 @@ are no syntax errors may indicate that a function was declared but never called. break; case 's': - m_script_language = (lldb::ScriptLanguage)Args::StringToOptionEnum( + m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum( option_arg, g_breakpoint_add_options[option_idx].enum_values, eScriptLanguageNone, error); @@ -307,7 +308,8 @@ are no syntax errors may indicate that a function was declared but never called. case 'e': { bool success = false; - m_stop_on_error = Args::StringToBoolean(option_arg, false, &success); + m_stop_on_error = + OptionArgParser::ToBoolean(option_arg, false, &success); if (!success) error.SetErrorStringWithFormat( "invalid value for stop-on-error: \"%s\"", diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index c9d71a65754..8aff1b6d2a6 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -23,6 +23,7 @@ #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObjectRegexCommand.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" @@ -1639,7 +1640,7 @@ protected: break; case 's': m_synchronicity = - (ScriptedCommandSynchronicity)Args::StringToOptionEnum( + (ScriptedCommandSynchronicity)OptionArgParser::ToOptionEnum( option_arg, GetDefinitions()[option_idx].enum_values, 0, error); if (!error.Success()) error.SetErrorStringWithFormat( diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 31c54b7d433..f360a324f04 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -20,6 +20,7 @@ #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/Options.h" #include "lldb/Symbol/Function.h" #include "lldb/Symbol/Symbol.h" @@ -101,14 +102,14 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue( break; case 's': { - start_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + start_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); if (start_addr != LLDB_INVALID_ADDRESS) some_location_specified = true; } break; case 'e': { - end_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + end_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); if (end_addr != LLDB_INVALID_ADDRESS) some_location_specified = true; } break; @@ -168,7 +169,7 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue( break; case 'a': { - symbol_containing_addr = Args::StringToAddress( + symbol_containing_addr = OptionArgParser::ToAddress( execution_context, option_arg, LLDB_INVALID_ADDRESS, &error); if (symbol_containing_addr != LLDB_INVALID_ADDRESS) { some_location_specified = true; diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 01ca3111155..22b456d81b2 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -27,6 +27,7 @@ #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Symbol/Variable.h" #include "lldb/Target/Language.h" @@ -88,7 +89,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( case 'a': { bool success; bool result; - result = Args::StringToBoolean(option_arg, true, &success); + result = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "invalid all-threads value setting: \"%s\"", @@ -99,7 +100,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( case 'i': { bool success; - bool tmp_value = Args::StringToBoolean(option_arg, true, &success); + bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success); if (success) ignore_breakpoints = tmp_value; else @@ -111,7 +112,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( case 'j': { bool success; - bool tmp_value = Args::StringToBoolean(option_arg, true, &success); + bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success); if (success) allow_jit = tmp_value; else @@ -131,7 +132,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( case 'u': { bool success; - bool tmp_value = Args::StringToBoolean(option_arg, true, &success); + bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success); if (success) unwind_on_error = tmp_value; else @@ -146,8 +147,8 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( m_verbosity = eLanguageRuntimeDescriptionDisplayVerbosityFull; break; } - m_verbosity = - (LanguageRuntimeDescriptionDisplayVerbosity)Args::StringToOptionEnum( + m_verbosity = (LanguageRuntimeDescriptionDisplayVerbosity) + OptionArgParser::ToOptionEnum( option_arg, GetDefinitions()[option_idx].enum_values, 0, error); if (!error.Success()) error.SetErrorStringWithFormat( @@ -167,7 +168,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue( case 'X': { bool success; - bool tmp_value = Args::StringToBoolean(option_arg, true, &success); + bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success); if (success) auto_apply_fixits = tmp_value ? eLazyBoolYes : eLazyBoolNo; else diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp index ef82d07f15f..e3580c3ae0c 100644 --- a/lldb/source/Commands/CommandObjectLog.cpp +++ b/lldb/source/Commands/CommandObjectLog.cpp @@ -19,6 +19,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/Options.h" #include "lldb/Symbol/LineTable.h" #include "lldb/Symbol/ObjectFile.h" @@ -345,7 +346,7 @@ protected: } } else if (sub_command.equals_lower("increment")) { bool success; - bool increment = Args::StringToBoolean(param, false, &success); + bool increment = OptionArgParser::ToBoolean(param, false, &success); if (success) { Timer::SetQuiet(!increment); result.SetStatus(eReturnStatusSuccessFinishNoResult); diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 8f4c186a8d6..aacb13405d2 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -27,6 +27,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionGroupOutputFile.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" @@ -590,8 +591,8 @@ protected: } if (argc > 0) - addr = Args::StringToAddress(&m_exe_ctx, command[0].ref, - LLDB_INVALID_ADDRESS, &error); + addr = OptionArgParser::ToAddress(&m_exe_ctx, command[0].ref, + LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid start address expression."); @@ -601,7 +602,7 @@ protected: } if (argc == 2) { - lldb::addr_t end_addr = Args::StringToAddress( + lldb::addr_t end_addr = OptionArgParser::ToAddress( &m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, nullptr); if (end_addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid end address expression."); @@ -1036,13 +1037,13 @@ protected: } Status error; - lldb::addr_t low_addr = Args::StringToAddress(&m_exe_ctx, command[0].ref, - LLDB_INVALID_ADDRESS, &error); + lldb::addr_t low_addr = OptionArgParser::ToAddress( + &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); if (low_addr == LLDB_INVALID_ADDRESS || error.Fail()) { result.AppendError("invalid low address"); return false; } - lldb::addr_t high_addr = Args::StringToAddress( + lldb::addr_t high_addr = OptionArgParser::ToAddress( &m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, &error); if (high_addr == LLDB_INVALID_ADDRESS || error.Fail()) { result.AppendError("invalid high address"); @@ -1345,8 +1346,8 @@ protected: size_t item_byte_size = byte_size_value.GetCurrentValue(); Status error; - lldb::addr_t addr = Args::StringToAddress(&m_exe_ctx, command[0].ref, - LLDB_INVALID_ADDRESS, &error); + lldb::addr_t addr = OptionArgParser::ToAddress( + &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression\n"); @@ -1469,7 +1470,7 @@ protected: break; } case eFormatBoolean: - uval64 = Args::StringToBoolean(entry.ref, false, &success); + uval64 = OptionArgParser::ToBoolean(entry.ref, false, &success); if (!success) { result.AppendErrorWithFormat( "'%s' is not a valid boolean string value.\n", entry.c_str()); @@ -1642,8 +1643,8 @@ protected: } Status error; - lldb::addr_t addr = Args::StringToAddress(&m_exe_ctx, command[0].ref, - LLDB_INVALID_ADDRESS, &error); + lldb::addr_t addr = OptionArgParser::ToAddress( + &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error); if (addr == LLDB_INVALID_ADDRESS) { result.AppendError("invalid address expression"); @@ -1711,8 +1712,8 @@ protected: } else { auto load_addr_str = command[0].ref; if (command.GetArgumentCount() == 1) { - load_addr = Args::StringToAddress(&m_exe_ctx, load_addr_str, - LLDB_INVALID_ADDRESS, &error); + load_addr = OptionArgParser::ToAddress(&m_exe_ctx, load_addr_str, + LLDB_INVALID_ADDRESS, &error); if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) { result.AppendErrorWithFormat( "invalid address argument \"%s\": %s\n", command[0].c_str(), diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index c763fe51885..c2f5229c674 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.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/Options.h" #include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" @@ -756,7 +757,7 @@ public: case 's': bool tmp_result; bool success; - tmp_result = Args::StringToBoolean(option_arg, false, &success); + tmp_result = OptionArgParser::ToBoolean(option_arg, false, &success); if (!success) error.SetErrorStringWithFormat("invalid boolean option: \"%s\"", option_arg.str().c_str()); @@ -1440,7 +1441,7 @@ public: bool VerifyCommandOptionValue(const std::string &option, int &real_value) { bool okay = true; bool success = false; - bool tmp_value = Args::StringToBoolean(option, false, &success); + bool tmp_value = OptionArgParser::ToBoolean(option, false, &success); if (success && tmp_value) real_value = 1; diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 066cc59c5c3..7f2b9f0f809 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.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/Options.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" @@ -91,8 +92,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed { break; case 'a': { - address = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + address = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); } break; case 's': modules.push_back(std::string(option_arg)); @@ -709,8 +710,8 @@ class CommandObjectSourceList : public CommandObjectParsed { break; case 'a': { - address = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + address = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); } break; case 's': modules.push_back(std::string(option_arg)); 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': diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index b68aa920b58..43c5c5446f5 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -21,6 +21,7 @@ #include "lldb/Host/StringConvert.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/Options.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" @@ -290,7 +291,7 @@ public: case 'e': { bool success; m_extended_backtrace = - Args::StringToBoolean(option_arg, false, &success); + OptionArgParser::ToBoolean(option_arg, false, &success); if (!success) error.SetErrorStringWithFormat( "invalid boolean value for option '%c'", short_option); @@ -447,7 +448,8 @@ public: switch (short_option) { case 'a': { bool success; - bool avoid_no_debug = Args::StringToBoolean(option_arg, true, &success); + bool avoid_no_debug = + OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "invalid boolean value for option '%c'", short_option); @@ -459,7 +461,8 @@ public: case 'A': { bool success; - bool avoid_no_debug = Args::StringToBoolean(option_arg, true, &success); + bool avoid_no_debug = + OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "invalid boolean value for option '%c'", short_option); @@ -483,7 +486,7 @@ public: case 'm': { OptionEnumValueElement *enum_values = GetDefinitions()[option_idx].enum_values; - m_run_mode = (lldb::RunMode)Args::StringToOptionEnum( + m_run_mode = (lldb::RunMode)OptionArgParser::ToOptionEnum( option_arg, enum_values, eOnlyDuringStepping, error); } break; @@ -1030,7 +1033,7 @@ public: switch (short_option) { case 'a': { - lldb::addr_t tmp_addr = Args::StringToAddress( + lldb::addr_t tmp_addr = OptionArgParser::ToAddress( execution_context, option_arg, LLDB_INVALID_ADDRESS, &error); if (error.Success()) m_until_addrs.push_back(tmp_addr); @@ -1052,7 +1055,7 @@ public: case 'm': { OptionEnumValueElement *enum_values = GetDefinitions()[option_idx].enum_values; - lldb::RunMode run_mode = (lldb::RunMode)Args::StringToOptionEnum( + lldb::RunMode run_mode = (lldb::RunMode)OptionArgParser::ToOptionEnum( option_arg, enum_values, eOnlyDuringStepping, error); if (error.Success()) { @@ -1541,7 +1544,8 @@ public: switch (short_option) { case 'x': { bool success; - bool tmp_value = Args::StringToBoolean(option_arg, false, &success); + bool tmp_value = + OptionArgParser::ToBoolean(option_arg, false, &success); if (success) m_from_expression = tmp_value; else { @@ -1737,8 +1741,8 @@ public: return Status("invalid line offset: '%s'.", option_arg.str().c_str()); break; 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 'r': m_force = true; diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 2d4271cab36..87ce47f6988 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -24,6 +24,7 @@ #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueLanguage.h" @@ -329,7 +330,7 @@ private: switch (short_option) { case 'C': - m_cascade = Args::StringToBoolean(option_arg, true, &success); + m_cascade = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat("invalid value for cascade: %s", option_arg.str().c_str()); @@ -571,7 +572,7 @@ private: switch (short_option) { case 'C': - m_cascade = Args::StringToBoolean(option_value, true, &success); + m_cascade = OptionArgParser::ToBoolean(option_value, true, &success); if (!success) error.SetErrorStringWithFormat("invalid value for cascade: %s", option_value.str().c_str()); @@ -1252,7 +1253,7 @@ Status CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue( switch (short_option) { case 'C': - m_flags.SetCascades(Args::StringToBoolean(option_arg, true, &success)); + m_flags.SetCascades(OptionArgParser::ToBoolean(option_arg, true, &success)); if (!success) error.SetErrorStringWithFormat("invalid value for cascade: %s", option_arg.str().c_str()); @@ -2520,7 +2521,7 @@ private: switch (short_option) { case 'C': - m_cascade = Args::StringToBoolean(option_arg, true, &success); + m_cascade = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat("invalid value for cascade: %s", option_arg.str().c_str()); diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index ec7e4a1f9cd..eda81a6cf02 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -22,6 +22,7 @@ #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" @@ -331,7 +332,7 @@ are no syntax errors may indicate that a function was declared but never called. break; case 's': - m_script_language = (lldb::ScriptLanguage)Args::StringToOptionEnum( + m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum( option_arg, GetDefinitions()[option_idx].enum_values, eScriptLanguageNone, error); @@ -341,7 +342,8 @@ are no syntax errors may indicate that a function was declared but never called. case 'e': { bool success = false; - m_stop_on_error = Args::StringToBoolean(option_arg, false, &success); + m_stop_on_error = + OptionArgParser::ToBoolean(option_arg, false, &success); if (!success) error.SetErrorStringWithFormat( "invalid value for stop-on-error: \"%s\"", |