diff options
author | Enrico Granata <egranata@apple.com> | 2015-01-28 00:07:51 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2015-01-28 00:07:51 +0000 |
commit | 1cd5e921e1011a31ca1de57444b0649a921ccf33 (patch) | |
tree | cd3cfcdd9c8e8afa56132e8e00f1579bb45fb9e5 /lldb/source/Core | |
parent | b06fe2a704e5132b53f3826823c37caafe5dc23b (diff) | |
download | bcm5719-llvm-1cd5e921e1011a31ca1de57444b0649a921ccf33.tar.gz bcm5719-llvm-1cd5e921e1011a31ca1de57444b0649a921ccf33.zip |
Preparatory infrastructural work to support dynamically determining sizes of ObjC types via the runtime
This is necessary because the byte size of an ObjC class type is not reliably statically knowable (e.g. because superclasses sit deep in frameworks that we have no debug info for)
The lack of reliable size info is a problem when trying to freeze-dry an ObjC instance (not the pointer, the pointee)
This commit lays the foundation for having language runtimes help in figuring out byte sizes, and having ClangASTType ask for runtime help
No feature change as no runtime actually implements the logic, and nowhere is an ExecutionContext passed in yet
llvm-svn: 227274
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/Value.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectConstResult.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectMemory.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectVariable.cpp | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp index db33fce4a03..a416d0745a6 100644 --- a/lldb/source/Core/Value.cpp +++ b/lldb/source/Core/Value.cpp @@ -277,7 +277,7 @@ Value::GetValueByteSize (Error *error_ptr) { const ClangASTType &ast_type = GetClangType(); if (ast_type.IsValid()) - byte_size = ast_type.GetByteSize(); + byte_size = ast_type.GetByteSize(nullptr); } break; } @@ -434,7 +434,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, lldb::Encoding type_encoding = ast_type.GetEncoding(type_encoding_count); if (type_encoding == eEncodingUint || type_encoding == eEncodingSint) - limit_byte_size = ast_type.GetByteSize(); + limit_byte_size = ast_type.GetByteSize(nullptr); } if (m_value.GetData (data, limit_byte_size)) diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 3937424ed7e..99b38dd6264 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -971,7 +971,7 @@ ValueObject::GetPointeeData (DataExtractor& data, if (item_count == 0) return 0; - const uint64_t item_type_size = pointee_or_element_clang_type.GetByteSize(); + const uint64_t item_type_size = pointee_or_element_clang_type.GetByteSize(nullptr); const uint64_t bytes = item_count * item_type_size; const uint64_t offset = item_idx * item_type_size; @@ -1047,7 +1047,7 @@ ValueObject::GetPointeeData (DataExtractor& data, break; case eAddressTypeHost: { - const uint64_t max_bytes = GetClangType().GetByteSize(); + const uint64_t max_bytes = GetClangType().GetByteSize(nullptr); if (max_bytes > offset) { size_t bytes_read = std::min<uint64_t>(max_bytes - offset, bytes); @@ -2225,7 +2225,7 @@ ValueObject::GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type ValueObjectChild *synthetic_child = new ValueObjectChild(*this, type, name_const_str, - type.GetByteSize(), + type.GetByteSize(nullptr), offset, 0, 0, @@ -2266,7 +2266,7 @@ ValueObject::GetSyntheticBase (uint32_t offset, const ClangASTType& type, bool c ValueObjectChild *synthetic_child = new ValueObjectChild(*this, type, name_const_str, - type.GetByteSize(), + type.GetByteSize(nullptr), offset, 0, 0, diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp index fc870d72622..cbeb2ab47b2 100644 --- a/lldb/source/Core/ValueObjectConstResult.cpp +++ b/lldb/source/Core/ValueObjectConstResult.cpp @@ -257,7 +257,7 @@ uint64_t ValueObjectConstResult::GetByteSize() { if (m_byte_size == 0) - m_byte_size = GetClangType().GetByteSize(); + m_byte_size = GetClangType().GetByteSize(nullptr); return m_byte_size; } diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp index 5fbe87b6652..9f1953138f6 100644 --- a/lldb/source/Core/ValueObjectMemory.cpp +++ b/lldb/source/Core/ValueObjectMemory.cpp @@ -169,7 +169,7 @@ ValueObjectMemory::GetByteSize() { if (m_type_sp) return m_type_sp->GetByteSize(); - return m_clang_type.GetByteSize (); + return m_clang_type.GetByteSize (nullptr); } lldb::ValueType diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp index ab74a50e7cd..e4fd212cbfa 100644 --- a/lldb/source/Core/ValueObjectVariable.cpp +++ b/lldb/source/Core/ValueObjectVariable.cpp @@ -110,7 +110,7 @@ ValueObjectVariable::GetByteSize() if (!type.IsValid()) return 0; - return type.GetByteSize(); + return type.GetByteSize(nullptr); } lldb::ValueType |