diff options
| author | Sean Callanan <scallanan@apple.com> | 2012-03-30 02:04:38 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2012-03-30 02:04:38 +0000 |
| commit | 356e17ce69b41905d9f9b2ce22d22dbde38e4022 (patch) | |
| tree | 9a902d18d1dfdfd7d867dba44b0cd578e1617e60 | |
| parent | a40d40602c758c81e8135a932423948949bdc759 (diff) | |
| download | bcm5719-llvm-356e17ce69b41905d9f9b2ce22d22dbde38e4022.tar.gz bcm5719-llvm-356e17ce69b41905d9f9b2ce22d22dbde38e4022.zip | |
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().
llvm-svn: 153718
| -rw-r--r-- | lldb/include/lldb/Core/ValueObjectRegister.h | 6 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 7 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObjectRegister.cpp | 15 |
3 files changed, 24 insertions, 4 deletions
diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h index dab37846727..39b1871b687 100644 --- a/lldb/include/lldb/Core/ValueObjectRegister.h +++ b/lldb/include/lldb/Core/ValueObjectRegister.h @@ -42,6 +42,9 @@ public: virtual ConstString GetTypeName(); + + virtual ConstString + GetQualifiedTypeName(); virtual uint32_t CalculateNumChildren(); @@ -89,6 +92,9 @@ public: virtual ConstString GetTypeName(); + + virtual ConstString + GetQualifiedTypeName(); virtual uint32_t CalculateNumChildren(); diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index a13c84b7c38..9e27dc0b164 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -275,7 +275,7 @@ ClangASTType ValueObject::MaybeCalculateCompleteType () { ClangASTType ret(GetClangASTImpl(), GetClangTypeImpl()); - + if (m_did_calculate_complete_objc_class_type) { if (m_override_type.IsValid()) @@ -349,7 +349,10 @@ ValueObject::MaybeCalculateCompleteType () m_override_type = complete_class; } - return m_override_type; + if (m_override_type.IsValid()) + return m_override_type; + else + return ret; } clang::ASTContext * diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index befd610f65f..2df5af6d320 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -51,8 +51,13 @@ ValueObjectRegisterContext::GetClangTypeImpl () ConstString ValueObjectRegisterContext::GetTypeName() { - ConstString empty_type_name; - return empty_type_name; + return ConstString(); +} + +ConstString +ValueObjectRegisterContext::GetQualifiedTypeName() +{ + return ConstString(); } uint32_t @@ -151,6 +156,12 @@ ValueObjectRegisterSet::GetTypeName() return ConstString(); } +ConstString +ValueObjectRegisterSet::GetQualifiedTypeName() +{ + return ConstString(); +} + uint32_t ValueObjectRegisterSet::CalculateNumChildren() { |

