diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 |
commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /source/Core/ValueObjectMemory.cpp | |
parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
download | src-94994d372d014ce4c8758b9605d63fae651bd8aa.tar.gz src-94994d372d014ce4c8758b9605d63fae651bd8aa.zip |
Vendor import of lldb trunk r351319 (just before the release_80 branchvendor/lldb/lldb-trunk-r351319
Notes
Notes:
svn path=/vendor/lldb/dist/; revision=343181
svn path=/vendor/lldb/lldb-trunk-r351319/; revision=343182; tag=vendor/lldb/lldb-trunk-r351319
Diffstat (limited to 'source/Core/ValueObjectMemory.cpp')
-rw-r--r-- | source/Core/ValueObjectMemory.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/source/Core/ValueObjectMemory.cpp b/source/Core/ValueObjectMemory.cpp index 3e71fea6bb35..24103204ee47 100644 --- a/source/Core/ValueObjectMemory.cpp +++ b/source/Core/ValueObjectMemory.cpp @@ -8,19 +8,19 @@ //===----------------------------------------------------------------------===// #include "lldb/Core/ValueObjectMemory.h" -#include "lldb/Core/Scalar.h" // for Scalar, operator!= #include "lldb/Core/Value.h" #include "lldb/Core/ValueObject.h" #include "lldb/Symbol/Type.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Target.h" -#include "lldb/Utility/DataExtractor.h" // for DataExtractor -#include "lldb/Utility/Status.h" // for Status -#include "lldb/lldb-types.h" // for addr_t -#include "llvm/Support/ErrorHandling.h" // for llvm_unreachable +#include "lldb/Utility/DataExtractor.h" +#include "lldb/Utility/Scalar.h" +#include "lldb/Utility/Status.h" +#include "lldb/lldb-types.h" +#include "llvm/Support/ErrorHandling.h" -#include <assert.h> // for assert -#include <memory> // for shared_ptr +#include <assert.h> +#include <memory> namespace lldb_private { class ExecutionContextScope; @@ -128,15 +128,19 @@ size_t ValueObjectMemory::CalculateNumChildren(uint32_t max) { return child_count <= max ? child_count : max; } + ExecutionContext exe_ctx(GetExecutionContextRef()); const bool omit_empty_base_classes = true; - auto child_count = m_compiler_type.GetNumChildren(omit_empty_base_classes); + auto child_count = + m_compiler_type.GetNumChildren(omit_empty_base_classes, &exe_ctx); return child_count <= max ? child_count : max; } uint64_t ValueObjectMemory::GetByteSize() { if (m_type_sp) return m_type_sp->GetByteSize(); - return m_compiler_type.GetByteSize(nullptr); + if (llvm::Optional<uint64_t> size = m_compiler_type.GetByteSize(nullptr)) + return *size; + return 0; } lldb::ValueType ValueObjectMemory::GetValueType() const { |