diff options
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/include/lldb/Core/Value.h | 2 | ||||
-rw-r--r-- | lldb/source/Core/Value.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectCast.cpp | 3 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectDynamicValue.cpp | 5 |
4 files changed, 11 insertions, 7 deletions
diff --git a/lldb/include/lldb/Core/Value.h b/lldb/include/lldb/Core/Value.h index f0dc3249ead..214fb829216 100644 --- a/lldb/include/lldb/Core/Value.h +++ b/lldb/include/lldb/Core/Value.h @@ -265,7 +265,7 @@ public: GetValueDefaultFormat (); uint64_t - GetValueByteSize (Error *error_ptr); + GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx); Error GetValueAsData (ExecutionContext *exe_ctx, diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp index 349f7780c70..49c8a3807fe 100644 --- a/lldb/source/Core/Value.cpp +++ b/lldb/source/Core/Value.cpp @@ -260,7 +260,7 @@ Value::ValueOf(ExecutionContext *exe_ctx) } uint64_t -Value::GetValueByteSize (Error *error_ptr) +Value::GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx) { uint64_t byte_size = 0; @@ -277,7 +277,7 @@ Value::GetValueByteSize (Error *error_ptr) { const CompilerType &ast_type = GetCompilerType(); if (ast_type.IsValid()) - byte_size = ast_type.GetByteSize(nullptr); + byte_size = ast_type.GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : 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(nullptr); + limit_byte_size = ast_type.GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr); } if (m_value.GetData (data, limit_byte_size)) @@ -639,7 +639,7 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, } // If we got here, we need to read the value from memory - size_t byte_size = GetValueByteSize (&error); + size_t byte_size = GetValueByteSize (&error, exe_ctx); // Bail if we encountered any errors getting the byte size if (error.Fail()) diff --git a/lldb/source/Core/ValueObjectCast.cpp b/lldb/source/Core/ValueObjectCast.cpp index c05d0395d96..ac7562024ac 100644 --- a/lldb/source/Core/ValueObjectCast.cpp +++ b/lldb/source/Core/ValueObjectCast.cpp @@ -76,7 +76,8 @@ ValueObjectCast::CalculateNumChildren() uint64_t ValueObjectCast::GetByteSize() { - return m_value.GetValueByteSize(NULL); + ExecutionContext exe_ctx (GetExecutionContextRef()); + return m_value.GetValueByteSize(nullptr, &exe_ctx); } lldb::ValueType diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index 329d3c149e8..3de12e5a66f 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -127,7 +127,10 @@ ValueObjectDynamicValue::GetByteSize() { const bool success = UpdateValueIfNeeded(false); if (success && m_dynamic_type_info.HasType()) - return m_value.GetValueByteSize(nullptr); + { + ExecutionContext exe_ctx (GetExecutionContextRef()); + return m_value.GetValueByteSize(nullptr, &exe_ctx); + } else return m_parent->GetByteSize(); } |