[Lldb-commits] [lldb] r234480 - Fix MiGdbSetShowTestCase.test_lldbmi_gdb_set_ouptut_radix after r234476

Ilia K ki.stfu at gmail.com
Thu Apr 9 05:21:57 PDT 2015


Author: ki.stfu
Date: Thu Apr  9 07:21:56 2015
New Revision: 234480

URL: http://llvm.org/viewvc/llvm-project?rev=234480&view=rev
Log:
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


Modified:
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp?rev=234480&r1=234479&r2=234480&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp Thu Apr  9 07:21:56 2015
@@ -275,6 +275,16 @@ CMICmnLLDBDebugSessionInfoVarObj::GetVal
                                                           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();
 }
 

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp?rev=234480&r1=234479&r2=234480&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp Thu Apr  9 07:21:56 2015
@@ -261,6 +261,25 @@ CMICmnLLDBUtilSBValue::IsFirstChildCharT
 }
 
 //++ ------------------------------------------------------------------------------------
+// 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.
 // Type:    Method.

Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h?rev=234480&r1=234479&r2=234480&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h (original)
+++ lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h Thu Apr  9 07:21:56 2015
@@ -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;





More information about the lldb-commits mailing list