Index: lldb/include/lldb/Interpreter/OptionGroupFile.h =================================================================== --- lldb/include/lldb/Interpreter/OptionGroupFile.h +++ lldb/include/lldb/Interpreter/OptionGroupFile.h @@ -20,7 +20,7 @@ class OptionGroupFile : public OptionGroup { public: OptionGroupFile(uint32_t usage_mask, bool required, const char *long_option, - int short_option, uint32_t completion_type, + char short_option, uint32_t completion_type, lldb::CommandArgumentType argument_type, const char *usage_text); Index: lldb/include/lldb/Utility/OptionDefinition.h =================================================================== --- lldb/include/lldb/Utility/OptionDefinition.h +++ lldb/include/lldb/Utility/OptionDefinition.h @@ -23,11 +23,8 @@ bool required; /// Full name for this option. const char *long_option; - /// Single character for this option. If the option doesn't use a short - /// option character, this has to be a integer value that is not a printable - /// ASCII code point and also unique in the used set of options. - /// @see OptionDefinition::HasShortOption - int short_option; + /// Single character for this option. + char short_option; /// no_argument, required_argument or optional_argument int option_has_arg; /// If non-NULL, option is valid iff |validator->IsValid()|, otherwise @@ -43,12 +40,6 @@ /// Full text explaining what this options does and what (if any) argument to /// pass it. const char *usage_text; - - /// Whether this has a short option character. - bool HasShortOption() const { - // See the short_option documentation for more. - return llvm::isPrint(short_option); - } }; } // namespace lldb_private Index: lldb/source/Commands/CommandObjectBreakpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpoint.cpp +++ lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -60,7 +60,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_breakpoint_modify_options[option_idx].short_option; switch (short_option) { @@ -178,7 +178,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_breakpoint_dummy_options[option_idx].short_option; switch (short_option) { @@ -257,7 +257,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_breakpoint_set_options[option_idx].short_option; switch (short_option) { @@ -1142,7 +1142,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'b': @@ -1275,7 +1275,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -1431,7 +1431,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -1588,7 +1588,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = g_breakpoint_name_options[option_idx].short_option; + const char short_option = g_breakpoint_name_options[option_idx].short_option; switch (short_option) { case 'N': @@ -1647,7 +1647,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_breakpoint_access_options[option_idx].short_option; switch (short_option) { @@ -2097,7 +2097,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -2295,7 +2295,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': Index: lldb/source/Commands/CommandObjectBreakpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -283,7 +283,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_breakpoint_command_add_options[option_idx].short_option; switch (short_option) { @@ -506,7 +506,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'D': Index: lldb/source/Commands/CommandObjectCommands.cpp =================================================================== --- lldb/source/Commands/CommandObjectCommands.cpp +++ lldb/source/Commands/CommandObjectCommands.cpp @@ -84,7 +84,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'e': @@ -200,7 +200,7 @@ ExecutionContext *execution_context) override { Status error; - const int short_option = GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; std::string option_str(option_value); switch (short_option) { @@ -1018,7 +1018,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'h': @@ -1266,7 +1266,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'r': @@ -1404,7 +1404,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': Index: lldb/source/Commands/CommandObjectDisassemble.cpp =================================================================== --- lldb/source/Commands/CommandObjectDisassemble.cpp +++ lldb/source/Commands/CommandObjectDisassemble.cpp @@ -46,7 +46,7 @@ ExecutionContext *execution_context) { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'm': Index: lldb/source/Commands/CommandObjectExpression.cpp =================================================================== --- lldb/source/Commands/CommandObjectExpression.cpp +++ lldb/source/Commands/CommandObjectExpression.cpp @@ -53,7 +53,7 @@ ExecutionContext *execution_context) { Status error; - const int short_option = GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'l': Index: lldb/source/Commands/CommandObjectFrame.cpp =================================================================== --- lldb/source/Commands/CommandObjectFrame.cpp +++ lldb/source/Commands/CommandObjectFrame.cpp @@ -55,7 +55,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'r': reg = ConstString(option_arg); @@ -231,7 +231,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'r': { int32_t offset = 0; @@ -743,7 +743,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'l': Index: lldb/source/Commands/CommandObjectHelp.h =================================================================== --- lldb/source/Commands/CommandObjectHelp.h +++ lldb/source/Commands/CommandObjectHelp.h @@ -39,7 +39,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': Index: lldb/source/Commands/CommandObjectLog.cpp =================================================================== --- lldb/source/Commands/CommandObjectLog.cpp +++ lldb/source/Commands/CommandObjectLog.cpp @@ -83,7 +83,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': Index: lldb/source/Commands/CommandObjectMemory.cpp =================================================================== --- lldb/source/Commands/CommandObjectMemory.cpp +++ lldb/source/Commands/CommandObjectMemory.cpp @@ -58,7 +58,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = g_memory_read_options[option_idx].short_option; + const char short_option = g_memory_read_options[option_idx].short_option; switch (short_option) { case 'l': @@ -910,7 +910,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = g_memory_find_options[option_idx].short_option; + const char short_option = g_memory_find_options[option_idx].short_option; switch (short_option) { case 'e': @@ -1198,7 +1198,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = g_memory_write_options[option_idx].short_option; + const char short_option = g_memory_write_options[option_idx].short_option; switch (short_option) { case 'i': Index: lldb/source/Commands/CommandObjectPlatform.cpp =================================================================== --- lldb/source/Commands/CommandObjectPlatform.cpp +++ lldb/source/Commands/CommandObjectPlatform.cpp @@ -67,7 +67,7 @@ SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - char short_option = (char)GetDefinitions()[option_idx].short_option; + char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'v': { if (option_arg.getAsInteger(8, m_permissions)) { @@ -1596,7 +1596,7 @@ ExecutionContext *execution_context) override { Status error; - const char short_option = (char)GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'h': Index: lldb/source/Commands/CommandObjectProcess.cpp =================================================================== --- lldb/source/Commands/CommandObjectProcess.cpp +++ lldb/source/Commands/CommandObjectProcess.cpp @@ -273,7 +273,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': attach_info.SetContinueOnceAttached(true); @@ -482,7 +482,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'i': if (option_arg.getAsInteger(0, m_ignore)) @@ -622,7 +622,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 's': @@ -717,7 +717,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'p': @@ -842,7 +842,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'i': do_install = true; @@ -1237,7 +1237,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'v': @@ -1334,7 +1334,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 's': Index: lldb/source/Commands/CommandObjectRegister.cpp =================================================================== --- lldb/source/Commands/CommandObjectRegister.cpp +++ lldb/source/Commands/CommandObjectRegister.cpp @@ -256,7 +256,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 's': { OptionValueSP value_sp(OptionValueUInt64::Create(option_value, error)); Index: lldb/source/Commands/CommandObjectReproducer.cpp =================================================================== --- lldb/source/Commands/CommandObjectReproducer.cpp +++ lldb/source/Commands/CommandObjectReproducer.cpp @@ -240,7 +240,7 @@ Status SetOptionValue(uint32_t option_idx, StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 's': @@ -373,7 +373,7 @@ Status SetOptionValue(uint32_t option_idx, StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -620,7 +620,7 @@ Status SetOptionValue(uint32_t option_idx, StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': Index: lldb/source/Commands/CommandObjectScript.cpp =================================================================== --- lldb/source/Commands/CommandObjectScript.cpp +++ lldb/source/Commands/CommandObjectScript.cpp @@ -49,7 +49,7 @@ uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'l': Index: lldb/source/Commands/CommandObjectSession.cpp =================================================================== --- lldb/source/Commands/CommandObjectSession.cpp +++ lldb/source/Commands/CommandObjectSession.cpp @@ -81,7 +81,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': Index: lldb/source/Commands/CommandObjectSettings.cpp =================================================================== --- lldb/source/Commands/CommandObjectSettings.cpp +++ lldb/source/Commands/CommandObjectSettings.cpp @@ -94,7 +94,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -339,7 +339,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -440,7 +440,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -1088,7 +1088,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': m_clear_all = true; Index: lldb/source/Commands/CommandObjectSource.cpp =================================================================== --- lldb/source/Commands/CommandObjectSource.cpp +++ lldb/source/Commands/CommandObjectSource.cpp @@ -43,7 +43,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'l': if (option_arg.getAsInteger(0, start_line)) @@ -632,7 +632,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = GetDefinitions()[option_idx].short_option; + const char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'l': if (option_arg.getAsInteger(0, start_line)) Index: lldb/source/Commands/CommandObjectTarget.cpp =================================================================== --- lldb/source/Commands/CommandObjectTarget.cpp +++ lldb/source/Commands/CommandObjectTarget.cpp @@ -691,9 +691,6 @@ #pragma mark CommandObjectTargetVariable class CommandObjectTargetVariable : public CommandObjectParsed { - static const uint32_t SHORT_OPTION_FILE = 0x66696c65; // 'file' - static const uint32_t SHORT_OPTION_SHLB = 0x73686c62; // 'shlb' - public: CommandObjectTargetVariable(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "target variable", @@ -703,13 +700,13 @@ m_option_group(), m_option_variable(false), // Don't include frame options m_option_format(eFormatDefault), - m_option_compile_units(LLDB_OPT_SET_1, false, "file", SHORT_OPTION_FILE, + m_option_compile_units(LLDB_OPT_SET_1, false, "file", 'l', 0, eArgTypeFilename, "A basename or fullpath to a file that contains " "global variables. This option can be " "specified multiple times."), m_option_shared_libraries( - LLDB_OPT_SET_1, false, "shlib", SHORT_OPTION_SHLB, 0, + LLDB_OPT_SET_1, false, "shlib", 'S', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search " "for global " @@ -1982,7 +1979,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'm': @@ -2928,7 +2925,7 @@ ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; if (short_option == 'g') { m_use_global_module_list = true; } else if (short_option == 'a') { @@ -3279,7 +3276,7 @@ ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': { @@ -3627,7 +3624,7 @@ ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': { @@ -4460,7 +4457,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_target_stop_hook_add_options[option_idx].short_option; switch (short_option) { Index: lldb/source/Commands/CommandObjectThread.cpp =================================================================== --- lldb/source/Commands/CommandObjectThread.cpp +++ lldb/source/Commands/CommandObjectThread.cpp @@ -249,7 +249,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': { @@ -411,7 +411,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_thread_step_scope_options[option_idx].short_option; switch (short_option) { @@ -1011,7 +1011,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': { @@ -1430,7 +1430,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; Status error; switch (short_option) { @@ -1578,7 +1578,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'x': { @@ -1751,7 +1751,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; Status error; switch (short_option) { @@ -1887,7 +1887,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'i': @@ -2186,7 +2186,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': { Index: lldb/source/Commands/CommandObjectTrace.cpp =================================================================== --- lldb/source/Commands/CommandObjectTrace.cpp +++ lldb/source/Commands/CommandObjectTrace.cpp @@ -46,7 +46,7 @@ Status SetOptionValue(uint32_t option_idx, StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'v': { @@ -146,7 +146,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'v': { @@ -213,7 +213,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'v': { Index: lldb/source/Commands/CommandObjectType.cpp =================================================================== --- lldb/source/Commands/CommandObjectType.cpp +++ lldb/source/Commands/CommandObjectType.cpp @@ -293,7 +293,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; bool success; switch (short_option) { @@ -519,7 +519,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override { Status error; - const int short_option = + const char short_option = g_type_format_add_options[option_idx].short_option; bool success; @@ -720,7 +720,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': @@ -888,7 +888,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'a': @@ -1001,7 +1001,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'w': m_category_regex.SetCurrentValue(option_arg); @@ -1209,7 +1209,7 @@ uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; bool success; switch (short_option) { @@ -1751,7 +1751,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'e': @@ -1855,7 +1855,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'l': @@ -2038,7 +2038,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'l': @@ -2463,7 +2463,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; bool success; switch (short_option) { @@ -2730,7 +2730,7 @@ ExecutionContext *execution_context) override { Status error; - const int short_option = g_type_lookup_options[option_idx].short_option; + const char short_option = g_type_lookup_options[option_idx].short_option; switch (short_option) { case 'h': Index: lldb/source/Commands/CommandObjectWatchpoint.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpoint.cpp +++ lldb/source/Commands/CommandObjectWatchpoint.cpp @@ -177,7 +177,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'b': @@ -473,7 +473,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -600,7 +600,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'i': @@ -728,7 +728,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': Index: lldb/source/Commands/CommandObjectWatchpointCommand.cpp =================================================================== --- lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -322,7 +322,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'o': Index: lldb/source/Interpreter/OptionGroupArchitecture.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupArchitecture.cpp +++ lldb/source/Interpreter/OptionGroupArchitecture.cpp @@ -38,7 +38,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'a': Index: lldb/source/Interpreter/OptionGroupFile.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupFile.cpp +++ lldb/source/Interpreter/OptionGroupFile.cpp @@ -14,7 +14,7 @@ using namespace lldb_private; OptionGroupFile::OptionGroupFile(uint32_t usage_mask, bool required, - const char *long_option, int short_option, + const char *long_option, char short_option, uint32_t completion_type, lldb::CommandArgumentType argument_type, const char *usage_text) Index: lldb/source/Interpreter/OptionGroupFormat.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupFormat.cpp +++ lldb/source/Interpreter/OptionGroupFormat.cpp @@ -56,7 +56,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'f': Index: lldb/source/Interpreter/OptionGroupOutputFile.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupOutputFile.cpp +++ lldb/source/Interpreter/OptionGroupOutputFile.cpp @@ -18,13 +18,11 @@ OptionGroupOutputFile::~OptionGroupOutputFile() {} -static const uint32_t SHORT_OPTION_APND = 0x61706e64; // 'apnd' - static constexpr OptionDefinition g_option_table[] = { {LLDB_OPT_SET_1, false, "outfile", 'o', OptionParser::eRequiredArgument, nullptr, {}, 0, eArgTypeFilename, "Specify a path for capturing command output."}, - {LLDB_OPT_SET_1, false, "append-outfile", SHORT_OPTION_APND, + {LLDB_OPT_SET_1, false, "append-outfile", 'a', OptionParser::eNoArgument, nullptr, {}, 0, eArgTypeNone, "Append to the file specified with '--outfile '."}, }; @@ -38,14 +36,14 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'o': error = m_file.SetValueFromString(option_arg); break; - case SHORT_OPTION_APND: + case 'a': m_append.SetCurrentValue(true); break; Index: lldb/source/Interpreter/OptionGroupPlatform.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupPlatform.cpp +++ lldb/source/Interpreter/OptionGroupPlatform.cpp @@ -91,7 +91,7 @@ if (!m_include_platform_option) ++option_idx; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'p': Index: lldb/source/Interpreter/OptionGroupUUID.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupUUID.cpp +++ lldb/source/Interpreter/OptionGroupUUID.cpp @@ -30,7 +30,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'u': Index: lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp +++ lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp @@ -73,7 +73,7 @@ uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; bool success = false; switch (short_option) { Index: lldb/source/Interpreter/OptionGroupVariable.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupVariable.cpp +++ lldb/source/Interpreter/OptionGroupVariable.cpp @@ -79,7 +79,7 @@ Status error; if (!include_frame_options) option_idx += 3; - const int short_option = g_variable_options[option_idx].short_option; + const char short_option = g_variable_options[option_idx].short_option; switch (short_option) { case 'r': use_regex = true; Index: lldb/source/Interpreter/OptionGroupWatchpoint.cpp =================================================================== --- lldb/source/Interpreter/OptionGroupWatchpoint.cpp +++ lldb/source/Interpreter/OptionGroupWatchpoint.cpp @@ -83,7 +83,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = g_option_table[option_idx].short_option; + const char short_option = g_option_table[option_idx].short_option; switch (short_option) { case 'w': { WatchType tmp_watch_type; Index: lldb/source/Interpreter/Options.cpp =================================================================== --- lldb/source/Interpreter/Options.cpp +++ lldb/source/Interpreter/Options.cpp @@ -210,7 +210,7 @@ m_getopt_table.resize(defs.size() + 1); for (size_t i = 0; i < defs.size(); ++i) { - const int short_opt = defs[i].short_option; + const char short_opt = defs[i].short_option; m_getopt_table[i].definition = &defs[i]; m_getopt_table[i].flag = nullptr; @@ -223,22 +223,13 @@ std::map::const_iterator pos = option_seen.find(short_opt); StreamString strm; - if (defs[i].HasShortOption()) - Host::SystemLog(Host::eSystemLogError, - "option[%u] --%s has a short option -%c that " - "conflicts with option[%u] --%s, short option won't " - "be used for --%s\n", - (int)i, defs[i].long_option, short_opt, pos->second, - m_getopt_table[pos->second].definition->long_option, - defs[i].long_option); - else - Host::SystemLog(Host::eSystemLogError, - "option[%u] --%s has a short option 0x%x that " - "conflicts with option[%u] --%s, short option won't " - "be used for --%s\n", - (int)i, defs[i].long_option, short_opt, pos->second, - m_getopt_table[pos->second].definition->long_option, - defs[i].long_option); + Host::SystemLog(Host::eSystemLogError, + "option[%u] --%s has a short option -%c that " + "conflicts with option[%u] --%s, short option won't " + "be used for --%s\n", + (int)i, defs[i].long_option, short_opt, pos->second, + m_getopt_table[pos->second].definition->long_option, + defs[i].long_option); } } @@ -355,16 +346,12 @@ static bool PrintOption(const OptionDefinition &opt_def, OptionDisplayType display_type, const char *header, const char *footer, bool show_optional, Stream &strm) { - if (display_type == eDisplayShortOption && !opt_def.HasShortOption()) - return false; - if (header && header[0]) strm.PutCString(header); if (show_optional && !opt_def.required) strm.PutChar('['); - const bool show_short_option = - opt_def.HasShortOption() && display_type != eDisplayLongOption; + const bool show_short_option = display_type != eDisplayLongOption; if (show_short_option) strm.Printf("-%c", opt_def.short_option); else @@ -443,7 +430,7 @@ std::set options; std::set::const_iterator options_pos, options_end; for (auto &def : opt_defs) { - if (def.usage_mask & opt_set_mask && def.HasShortOption()) { + if (def.usage_mask & opt_set_mask) { // Add current option to the end of out_stream. if (def.required && def.option_has_arg == OptionParser::eNoArgument) { @@ -468,7 +455,7 @@ options.clear(); for (auto &def : opt_defs) { - if (def.usage_mask & opt_set_mask && def.HasShortOption()) { + if (def.usage_mask & opt_set_mask) { // Add current option to the end of out_stream. if (!def.required && @@ -496,7 +483,7 @@ // First go through and print the required options (list them up front). for (auto &def : opt_defs) { - if (def.usage_mask & opt_set_mask && def.HasShortOption()) { + if (def.usage_mask & opt_set_mask) { if (def.required && def.option_has_arg != OptionParser::eNoArgument) PrintOption(def, eDisplayBestOption, " ", nullptr, true, strm); } @@ -577,14 +564,10 @@ arg_name_str.Printf("<%s>", CommandObject::GetArgumentName(arg_type)); strm.Indent(); - if (opt_defs[i].short_option && opt_defs[i].HasShortOption()) { + if (opt_defs[i].short_option) { PrintOption(opt_defs[i], eDisplayShortOption, nullptr, nullptr, false, strm); PrintOption(opt_defs[i], eDisplayLongOption, " ( ", " )", false, strm); - } else { - // Short option is not printable, just print long option - PrintOption(opt_defs[i], eDisplayLongOption, nullptr, nullptr, false, - strm); } strm.EOL(); Index: lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp +++ lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp @@ -520,7 +520,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'v': m_verbose.SetCurrentValue(true); Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp =================================================================== --- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -4097,7 +4097,7 @@ ExecutionContext *exe_ctx) override { Status err; StreamString err_str; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 't': if (!ParseReductionTypes(option_arg, err_str)) @@ -4251,7 +4251,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *exe_ctx) override { Status err; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'c': { @@ -4532,7 +4532,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *exe_ctx) override { Status err; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'f': @@ -4660,7 +4660,7 @@ Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *exe_ctx) override { Status err; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 'i': Index: lldb/source/Target/Platform.cpp =================================================================== --- lldb/source/Target/Platform.cpp +++ lldb/source/Target/Platform.cpp @@ -1413,7 +1413,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - char short_option = (char)GetDefinitions()[option_idx].short_option; + char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'r': m_rsync = true; @@ -1459,7 +1459,7 @@ llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - char short_option = (char)GetDefinitions()[option_idx].short_option; + char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 's': m_ssh = true; @@ -1490,7 +1490,7 @@ uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - char short_option = (char)GetDefinitions()[option_idx].short_option; + char short_option = GetDefinitions()[option_idx].short_option; switch (short_option) { case 'c': m_cache_dir.assign(std::string(option_arg)); Index: lldb/source/Target/Process.cpp =================================================================== --- lldb/source/Target/Process.cpp +++ lldb/source/Target/Process.cpp @@ -311,7 +311,7 @@ uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) { Status error; - const int short_option = m_getopt_table[option_idx].val; + const char short_option = m_getopt_table[option_idx].val; switch (short_option) { case 's': // Stop at program entry point