[Lldb-commits] [lldb] r153718 - in /lldb/trunk: include/lldb/Core/ValueObjectRegister.h source/Core/ValueObject.cpp source/Core/ValueObjectRegister.cpp

Sean Callanan scallanan at apple.com
Thu Mar 29 19:04:38 PDT 2012


Author: spyffe
Date: Thu Mar 29 21:04:38 2012
New Revision: 153718

URL: http://llvm.org/viewvc/llvm-project?rev=153718&view=rev
Log:
Be more careful when overriding the type for a
ValueObject, and make sure that ValueObjects that
have null type names (because they have null types)
also have null qualified type names.  This avoids
some potential crashes if 
ValueObject::GetQualifiedTypeName tries to get the
name of their type by calling GetClangTypeImpl().

Modified:
    lldb/trunk/include/lldb/Core/ValueObjectRegister.h
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectRegister.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObjectRegister.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectRegister.h?rev=153718&r1=153717&r2=153718&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectRegister.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectRegister.h Thu Mar 29 21:04:38 2012
@@ -42,6 +42,9 @@
 
     virtual ConstString
     GetTypeName();
+    
+    virtual ConstString
+    GetQualifiedTypeName();
 
     virtual uint32_t
     CalculateNumChildren();
@@ -89,6 +92,9 @@
 
     virtual ConstString
     GetTypeName();
+    
+    virtual ConstString
+    GetQualifiedTypeName();
 
     virtual uint32_t
     CalculateNumChildren();

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=153718&r1=153717&r2=153718&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Mar 29 21:04:38 2012
@@ -275,7 +275,7 @@
 ValueObject::MaybeCalculateCompleteType ()
 {
     ClangASTType ret(GetClangASTImpl(), GetClangTypeImpl());
-    
+        
     if (m_did_calculate_complete_objc_class_type)
     {
         if (m_override_type.IsValid())
@@ -349,7 +349,10 @@
         m_override_type = complete_class;
     }
     
-    return m_override_type;
+    if (m_override_type.IsValid())
+        return m_override_type;
+    else
+        return ret;
 }
 
 clang::ASTContext *

Modified: lldb/trunk/source/Core/ValueObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectRegister.cpp?rev=153718&r1=153717&r2=153718&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectRegister.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectRegister.cpp Thu Mar 29 21:04:38 2012
@@ -51,8 +51,13 @@
 ConstString
 ValueObjectRegisterContext::GetTypeName()
 {
-    ConstString empty_type_name;
-    return empty_type_name;
+    return ConstString();
+}
+
+ConstString
+ValueObjectRegisterContext::GetQualifiedTypeName()
+{
+    return ConstString();
 }
 
 uint32_t
@@ -151,6 +156,12 @@
     return ConstString();
 }
 
+ConstString
+ValueObjectRegisterSet::GetQualifiedTypeName()
+{
+    return ConstString();
+}
+
 uint32_t
 ValueObjectRegisterSet::CalculateNumChildren()
 {





More information about the lldb-commits mailing list