aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp')
-rw-r--r--contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp b/contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp
index 91b2c6084928..abf7b38ed89a 100644
--- a/contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp
+++ b/contrib/llvm-project/lldb/source/Core/ValueObjectMemory.cpp
@@ -139,10 +139,11 @@ size_t ValueObjectMemory::CalculateNumChildren(uint32_t max) {
return child_count <= max ? child_count : max;
}
-uint64_t ValueObjectMemory::GetByteSize() {
+llvm::Optional<uint64_t> ValueObjectMemory::GetByteSize() {
+ ExecutionContext exe_ctx(GetExecutionContextRef());
if (m_type_sp)
- return m_type_sp->GetByteSize().getValueOr(0);
- return m_compiler_type.GetByteSize(nullptr).getValueOr(0);
+ return m_type_sp->GetByteSize(exe_ctx.GetBestExecutionContextScope());
+ return m_compiler_type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
}
lldb::ValueType ValueObjectMemory::GetValueType() const {
@@ -167,9 +168,6 @@ bool ValueObjectMemory::UpdateValue() {
Value::ValueType value_type = m_value.GetValueType();
switch (value_type) {
- default:
- llvm_unreachable("Unhandled expression result value kind...");
-
case Value::eValueTypeScalar:
// The variable value is in the Scalar value inside the m_value. We can
// point our m_data right to it.