forked from OSchip/llvm-project
Fix a problem where LLDB could sometimes try to get the size of an Objective-C type without passing an appropriate ExecutionContext
llvm-svn: 250339
This commit is contained in:
parent
ddcf6b35a2
commit
9543803801
lldb
|
@ -265,7 +265,7 @@ public:
|
|||
GetValueDefaultFormat ();
|
||||
|
||||
uint64_t
|
||||
GetValueByteSize (Error *error_ptr);
|
||||
GetValueByteSize (Error *error_ptr, ExecutionContext *exe_ctx);
|
||||
|
||||
Error
|
||||
GetValueAsData (ExecutionContext *exe_ctx,
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue