Fix MiGdbSetShowTestCase.test_lldbmi_gdb_set_ouptut_radix after r234476

This includes:
* Add CMICmnLLDBUtilSBValue::IsIntegerType to check integer type
* Improve CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted to handle veVarFormat arg

llvm-svn: 234480
This commit is contained in:
Ilia K 2015-04-09 12:21:56 +00:00
parent 1b2ff68408
commit b49b2d2166
3 changed files with 30 additions and 0 deletions

View File

@ -275,6 +275,16 @@ CMICmnLLDBDebugSessionInfoVarObj::GetValueStringFormatted(const lldb::SBValue &v
const CMICmnLLDBDebugSessionInfoVarObj::varFormat_e veVarFormat)
{
const CMICmnLLDBUtilSBValue utilValue(vrValue, true);
if (utilValue.IsIntegerType())
{
MIuint64 nValue = 0;
if (CMICmnLLDBProxySBValue::GetValueAsUnsigned(vrValue, nValue))
{
lldb::SBValue &rValue = const_cast<lldb::SBValue &>(vrValue);
return GetStringFormatted(nValue, rValue.GetValue(), veVarFormat);
}
}
return utilValue.GetValue().Escape().AddSlashes();
}

View File

@ -260,6 +260,25 @@ CMICmnLLDBUtilSBValue::IsFirstChildCharType(void) const
return utilValue.IsCharType();
}
//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is a integer type or some
// other type. Char type can be signed or unsigned and short or long/very long.
// Type: Method.
// Args: None.
// Return: bool - True = Yes is a integer type, false = some other type.
// Throws: None.
//--
bool
CMICmnLLDBUtilSBValue::IsIntegerType(void) const
{
const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
return ((eType == lldb::eBasicTypeShort) || (eType == lldb::eBasicTypeUnsignedShort) ||
(eType == lldb::eBasicTypeInt) || (eType == lldb::eBasicTypeUnsignedInt) ||
(eType == lldb::eBasicTypeLong) || (eType == lldb::eBasicTypeUnsignedLong) ||
(eType == lldb::eBasicTypeLongLong) || (eType == lldb::eBasicTypeUnsignedLongLong) ||
(eType == lldb::eBasicTypeInt128) || (eType == lldb::eBasicTypeUnsignedInt128));
}
//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is a pointer type or some
// other type.

View File

@ -42,6 +42,7 @@ class CMICmnLLDBUtilSBValue
CMIUtilString GetTypeNameDisplay(void) const;
bool IsCharType(void) const;
bool IsFirstChildCharType(void) const;
bool IsIntegerType(void) const;
bool IsPointerType(void) const;
bool IsArrayType(void) const;
bool IsLLDBVariable(void) const;