summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectVariable.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-02-22 23:57:45 +0000
committerSean Callanan <scallanan@apple.com>2012-02-22 23:57:45 +0000
commit7277284f87dd195294355416d29ff3e6715d037a (patch)
tree0869c062a22cad4c17e2e98015b8beaa183bd598 /lldb/source/Core/ValueObjectVariable.cpp
parent9646a472da57c03b44dd4286de571426117395fa (diff)
downloadbcm5719-llvm-7277284f87dd195294355416d29ff3e6715d037a.tar.gz
bcm5719-llvm-7277284f87dd195294355416d29ff3e6715d037a.zip
Added support for looking up the complete type for
Objective-C classes. This allows LLDB to find ivars declared in class extensions in modules other than where the debugger is currently stopped (we already supported this when the debugger was stopped in the same module as the definition). This involved the following main changes: - The ObjCLanguageRuntime now knows how to hunt for the authoritative version of an Objective-C type. It looks for the symbol indicating a definition, and then gets the type from the module containing that symbol. - ValueObjects now report their type with a potential override, and the override is set if the type of the ValueObject is an Objective-C class or pointer type that is defined somewhere other than the original reported type. This means that "frame variable" will always use the complete type if one is available. - The ClangASTSource now looks for the complete type when looking for ivars. This means that "expr" will always use the complete type if one is available. - I added a testcase that verifies that both "frame variable" and "expr" work. llvm-svn: 151214
Diffstat (limited to 'lldb/source/Core/ValueObjectVariable.cpp')
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index 24f189d9f95..653b3cb58e8 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -53,7 +53,7 @@ ValueObjectVariable::~ValueObjectVariable()
}
lldb::clang_type_t
-ValueObjectVariable::GetClangType ()
+ValueObjectVariable::GetClangTypeImpl ()
{
Type *var_type = m_variable_sp->GetType();
if (var_type)
@@ -73,15 +73,19 @@ ValueObjectVariable::GetTypeName()
uint32_t
ValueObjectVariable::CalculateNumChildren()
-{
- Type *var_type = m_variable_sp->GetType();
- if (var_type)
- return var_type->GetNumChildren(true);
- return 0;
+{
+ ClangASTType type(GetClangAST(),
+ GetClangType());
+
+ if (!type.IsValid())
+ return 0;
+
+ const bool omit_empty_base_classes = true;
+ return ClangASTContext::GetNumChildren(type.GetASTContext(), type.GetOpaqueQualType(), omit_empty_base_classes);
}
clang::ASTContext *
-ValueObjectVariable::GetClangAST ()
+ValueObjectVariable::GetClangASTImpl ()
{
Type *var_type = m_variable_sp->GetType();
if (var_type)
@@ -92,10 +96,13 @@ ValueObjectVariable::GetClangAST ()
size_t
ValueObjectVariable::GetByteSize()
{
- Type *type = m_variable_sp->GetType();
- if (type)
- return type->GetByteSize();
- return 0;
+ ClangASTType type(GetClangAST(),
+ GetClangType());
+
+ if (!type.IsValid())
+ return 0;
+
+ return (ClangASTType::GetClangTypeBitWidth(type.GetASTContext(), type.GetOpaqueQualType()) + 7) / 8;
}
lldb::ValueType
OpenPOWER on IntegriCloud