summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandObjectArgs.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectBreakpoint.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectCommands.cpp10
-rw-r--r--lldb/source/Commands/CommandObjectDisassemble.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectHelp.h2
-rw-r--r--lldb/source/Commands/CommandObjectLog.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectPlatform.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp8
-rw-r--r--lldb/source/Commands/CommandObjectRegister.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectSettings.cpp2
-rw-r--r--lldb/source/Commands/CommandObjectSource.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp197
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectType.cpp26
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp6
-rw-r--r--lldb/source/Commands/CommandObjectWatchpointCommand.cpp2
20 files changed, 201 insertions, 90 deletions
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp
index 2ae91e10cb5..24cf9bc8b81 100644
--- a/lldb/source/Commands/CommandObjectArgs.cpp
+++ b/lldb/source/Commands/CommandObjectArgs.cpp
@@ -54,7 +54,7 @@ CommandObjectArgs::CommandOptions::SetOptionValue (uint32_t option_idx, const ch
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index 7c673f7fe67..bb8617f9780 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -118,7 +118,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -746,7 +746,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1253,7 +1253,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1441,7 +1441,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index f308ae3713c..53b6b4e2171 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -413,7 +413,7 @@ one command per line.\n" );
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index 5999f7c8935..e1bd287a863 100644
--- a/lldb/source/Commands/CommandObjectCommands.cpp
+++ b/lldb/source/Commands/CommandObjectCommands.cpp
@@ -72,7 +72,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
@@ -234,7 +234,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
@@ -1082,7 +1082,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1335,7 +1335,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1478,7 +1478,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp
index 45fdda71731..bed64d42e37 100644
--- a/lldb/source/Commands/CommandObjectDisassemble.cpp
+++ b/lldb/source/Commands/CommandObjectDisassemble.cpp
@@ -59,7 +59,7 @@ CommandObjectDisassemble::CommandOptions::SetOptionValue (uint32_t option_idx, c
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index a93d4e65fa0..1110c1f321c 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -71,7 +71,7 @@ CommandObjectExpression::CommandOptions::SetOptionValue (CommandInterpreter &int
{
Error error;
- const char short_option = (char) g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index eab0d02c188..53de2b14448 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -120,7 +120,7 @@ public:
{
Error error;
bool success = false;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
case 'r':
diff --git a/lldb/source/Commands/CommandObjectHelp.h b/lldb/source/Commands/CommandObjectHelp.h
index b66d69f476f..91a40b52949 100644
--- a/lldb/source/Commands/CommandObjectHelp.h
+++ b/lldb/source/Commands/CommandObjectHelp.h
@@ -57,7 +57,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index fb982972d26..35fcacc4b18 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -132,7 +132,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index fffbda1d143..2f79e52b4cd 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -82,7 +82,7 @@ public:
const char *option_arg)
{
Error error;
- char short_option = (char) g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
switch (short_option)
{
@@ -861,7 +861,7 @@ public:
const char *option_arg)
{
Error error;
- char short_option = (char) g_memory_write_option_table[option_idx].short_option;
+ const int short_option = g_memory_write_option_table[option_idx].short_option;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 3be46ab872e..10700aa1bb6 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -606,7 +606,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success = false;
switch (short_option)
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 68f577ffcf5..1fae2dee8b4 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -355,7 +355,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success = false;
switch (short_option)
{
@@ -715,7 +715,7 @@ protected:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success = false;
switch (short_option)
{
@@ -941,7 +941,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1533,7 +1533,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp
index 6873450fc2e..896b0187b9d 100644
--- a/lldb/source/Commands/CommandObjectRegister.cpp
+++ b/lldb/source/Commands/CommandObjectRegister.cpp
@@ -289,7 +289,7 @@ protected:
const char *option_value)
{
Error error;
- const char short_option = (char) g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
switch (short_option)
{
case 's':
diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp
index e55da23bac7..7c578326511 100644
--- a/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/lldb/source/Commands/CommandObjectSettings.cpp
@@ -119,7 +119,7 @@ insert-before or insert-after.\n");
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp
index c4ccf2a2167..5162d53ab1e 100644
--- a/lldb/source/Commands/CommandObjectSource.cpp
+++ b/lldb/source/Commands/CommandObjectSource.cpp
@@ -54,7 +54,7 @@ class CommandObjectSourceInfo : public CommandObjectParsed
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- const char short_option = g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
switch (short_option)
{
case 'l':
@@ -162,7 +162,7 @@ class CommandObjectSourceList : public CommandObjectParsed
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- const char short_option = g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
switch (short_option)
{
case 'l':
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 2dc5fab4829..2a5b6c6d4c4 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -602,8 +602,8 @@ public:
m_option_group (interpreter),
m_option_variable (false), // Don't include frame options
m_option_format (eFormatDefault),
- m_option_compile_units (LLDB_OPT_SET_1, false, "file", 'f', 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",'s', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
+ m_option_compile_units (LLDB_OPT_SET_1, false, "file", 'file', 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",'shlb', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
m_varobj_options()
{
CommandArgumentEntry arg;
@@ -719,6 +719,51 @@ public:
}
protected:
+
+ void
+ DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, const VariableList &variable_list, Stream &s)
+ {
+ size_t count = variable_list.GetSize();
+ if (count > 0)
+ {
+ if (sc.module_sp)
+ {
+ if (sc.comp_unit)
+ {
+ s.Printf ("Global variables for %s/%s in %s/%s:\n",
+ sc.comp_unit->GetDirectory().GetCString(),
+ sc.comp_unit->GetFilename().GetCString(),
+ sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
+ sc.module_sp->GetFileSpec().GetFilename().GetCString());
+ }
+ else
+ {
+ s.Printf ("Global variables for %s/%s\n",
+ sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
+ sc.module_sp->GetFileSpec().GetFilename().GetCString());
+ }
+ }
+ else if (sc.comp_unit)
+ {
+ s.Printf ("Global variables for %s/%s\n",
+ sc.comp_unit->GetDirectory().GetCString(),
+ sc.comp_unit->GetFilename().GetCString());
+ }
+
+ for (uint32_t i=0; i<count; ++i)
+ {
+ VariableSP var_sp (variable_list.GetVariableAtIndex(i));
+ if (var_sp)
+ {
+ ValueObjectSP valobj_sp (ValueObjectVariable::Create (exe_ctx.GetBestExecutionContextScope(), var_sp));
+
+ if (valobj_sp)
+ DumpValueObject (s, var_sp, valobj_sp, var_sp->GetName().GetCString());
+ }
+ }
+ }
+
+ }
virtual bool
DoExecute (Args& args, CommandReturnObject &result)
{
@@ -728,6 +773,7 @@ protected:
{
const size_t argc = args.GetArgumentCount();
Stream &s = result.GetOutputStream();
+
if (argc > 0)
{
@@ -791,55 +837,120 @@ protected:
}
else
{
- bool success = false;
- StackFrame *frame = exe_ctx.GetFramePtr();
- CompileUnit *comp_unit = NULL;
- if (frame)
+ const FileSpecList &compile_units = m_option_compile_units.GetOptionValue().GetCurrentValue();
+ const FileSpecList &shlibs = m_option_shared_libraries.GetOptionValue().GetCurrentValue();
+ SymbolContextList sc_list;
+ const size_t num_compile_units = compile_units.GetSize();
+ const size_t num_shlibs = shlibs.GetSize();
+ if (num_compile_units == 0 && num_shlibs == 0)
{
- comp_unit = frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit;
- if (comp_unit)
+ bool success = false;
+ StackFrame *frame = exe_ctx.GetFramePtr();
+ CompileUnit *comp_unit = NULL;
+ if (frame)
{
- const bool can_create = true;
- VariableListSP comp_unit_varlist_sp (comp_unit->GetVariableList(can_create));
- if (comp_unit_varlist_sp)
+ SymbolContext sc = frame->GetSymbolContext (eSymbolContextCompUnit);
+ if (sc.comp_unit)
{
- size_t count = comp_unit_varlist_sp->GetSize();
- if (count > 0)
+ const bool can_create = true;
+ VariableListSP comp_unit_varlist_sp (sc.comp_unit->GetVariableList(can_create));
+ if (comp_unit_varlist_sp)
{
- s.Printf ("Global variables for %s/%s:\n",
- comp_unit->GetDirectory().GetCString(),
- comp_unit->GetFilename().GetCString());
-
- success = true;
- for (uint32_t i=0; i<count; ++i)
+ size_t count = comp_unit_varlist_sp->GetSize();
+ if (count > 0)
{
- VariableSP var_sp (comp_unit_varlist_sp->GetVariableAtIndex(i));
- if (var_sp)
- {
- ValueObjectSP valobj_sp (ValueObjectVariable::Create (exe_ctx.GetBestExecutionContextScope(), var_sp));
-
- if (valobj_sp)
- DumpValueObject (s, var_sp, valobj_sp, var_sp->GetName().GetCString());
- }
+ DumpGlobalVariableList(exe_ctx, sc, *comp_unit_varlist_sp, s);
+ success = true;
}
}
}
}
+ if (!success)
+ {
+ if (frame)
+ {
+ if (comp_unit)
+ result.AppendErrorWithFormat ("no global variables in current compile unit: %s/%s\n",
+ comp_unit->GetDirectory().GetCString(),
+ comp_unit->GetFilename().GetCString());
+ else
+ result.AppendError ("no debug information for frame %u\n", frame->GetFrameIndex());
+ }
+ else
+ result.AppendError ("'target variable' takes one or more global variable names as arguments\n");
+ result.SetStatus (eReturnStatusFailed);
+ }
}
- if (!success)
+ else
{
- if (frame)
+ SymbolContextList sc_list;
+ const bool append = true;
+ // We have one or more compile unit or shlib
+ if (num_shlibs > 0)
{
- if (comp_unit)
- result.AppendErrorWithFormat ("no global variables in current compile unit: %s/%s\n",
- comp_unit->GetDirectory().GetCString(),
- comp_unit->GetFilename().GetCString());
- else
- result.AppendError ("no debug information for frame %u\n", frame->GetFrameIndex());
- }
+ for (size_t shlib_idx=0; shlib_idx<num_shlibs; ++shlib_idx)
+ {
+ const FileSpec module_file(shlibs.GetFileSpecAtIndex(shlib_idx));
+ ModuleSpec module_spec (module_file);
+
+ ModuleSP module_sp (target->GetImages().FindFirstModule(module_spec));
+ if (module_sp)
+ {
+ if (num_compile_units > 0)
+ {
+ for (size_t cu_idx=0; cu_idx<num_compile_units; ++cu_idx)
+ module_sp->FindCompileUnits(compile_units.GetFileSpecAtIndex(cu_idx), append, sc_list);
+ }
+ else
+ {
+ SymbolContext sc;
+ sc.module_sp = module_sp;
+ sc_list.Append(sc);
+ }
+ }
+ else
+ {
+ // Didn't find matching shlib/module in target...
+ result.AppendErrorWithFormat ("target doesn't contain the specified shared library: %s%s%s\n",
+ module_file.GetDirectory().GetCString(),
+ module_file.GetDirectory() ? "/" : "",
+ module_file.GetFilename().GetCString());
+ }
+ }
+ }
else
- result.AppendError ("'target variable' takes one or more global variable names as arguments\n");
- result.SetStatus (eReturnStatusFailed);
+ {
+ // No shared libraries, we just want to find globals for the compile units files that were specified
+ for (size_t cu_idx=0; cu_idx<num_compile_units; ++cu_idx)
+ target->GetImages().FindCompileUnits(compile_units.GetFileSpecAtIndex(cu_idx), append, sc_list);
+ }
+
+ const uint32_t num_scs = sc_list.GetSize();
+ if (num_scs > 0)
+ {
+ SymbolContext sc;
+ for (uint32_t sc_idx=0; sc_idx<num_scs; ++sc_idx)
+ {
+ if (sc_list.GetContextAtIndex(sc_idx, sc))
+ {
+ if (sc.comp_unit)
+ {
+ const bool can_create = true;
+ VariableListSP comp_unit_varlist_sp (sc.comp_unit->GetVariableList(can_create));
+ if (comp_unit_varlist_sp)
+ DumpGlobalVariableList(exe_ctx, sc, *comp_unit_varlist_sp, s);
+ }
+ else if (sc.module_sp)
+ {
+ // Get all global variables for this module
+ lldb_private::RegularExpression all_globals_regex("."); // Any global with at least one character
+ VariableList variable_list;
+ sc.module_sp->FindGlobalVariables(all_globals_regex, append, UINT32_MAX, variable_list);
+ DumpGlobalVariableList(exe_ctx, sc, variable_list, s);
+ }
+ }
+ }
+ }
}
}
}
@@ -1980,7 +2091,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -2913,7 +3024,7 @@ public:
virtual Error
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
if (short_option == 'g')
{
m_use_global_module_list = true;
@@ -3368,7 +3479,7 @@ public:
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -3601,7 +3712,7 @@ public:
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -4489,7 +4600,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index f555b624e11..49167e8a09d 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -67,7 +67,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -296,7 +296,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -818,7 +818,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp
index ba2a9f3bd6b..335b38c1215 100644
--- a/lldb/source/Commands/CommandObjectType.cpp
+++ b/lldb/source/Commands/CommandObjectType.cpp
@@ -209,7 +209,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
@@ -374,7 +374,7 @@ private:
const char *option_value)
{
Error error;
- const char short_option = (char) g_option_table[option_idx].short_option;
+ const int short_option = g_option_table[option_idx].short_option;
bool success;
switch (short_option)
@@ -915,7 +915,7 @@ Error
CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
@@ -1417,7 +1417,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1580,7 +1580,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -1724,7 +1724,7 @@ class CommandObjectTypeSummaryList : public CommandObjectParsed
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -2287,7 +2287,7 @@ class CommandObjectTypeFilterList : public CommandObjectParsed
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -2501,7 +2501,7 @@ class CommandObjectTypeSynthList : public CommandObjectParsed
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -2699,7 +2699,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -2865,7 +2865,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -3032,7 +3032,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -3161,7 +3161,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -3658,7 +3658,7 @@ private:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
bool success;
switch (short_option)
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index 8d907ae5740..00a78837e4e 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -213,7 +213,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -642,7 +642,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
@@ -799,7 +799,7 @@ public:
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
index eaf3b35f645..2f4824959cd 100644
--- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -396,7 +396,7 @@ but do NOT enter more than one command per line. \n" );
SetOptionValue (uint32_t option_idx, const char *option_arg)
{
Error error;
- char short_option = (char) m_getopt_table[option_idx].val;
+ const int short_option = m_getopt_table[option_idx].val;
switch (short_option)
{
OpenPOWER on IntegriCloud