summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Value.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Core/Value.cpp')
-rw-r--r--lldb/source/Core/Value.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 723806ffd9d..98aac432231 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -524,7 +524,15 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, clang::ASTContext *ast_context
case eValueTypeScalar:
data.SetByteOrder (lldb::endian::InlHostByteOrder());
- data.SetAddressByteSize(sizeof(void *));
+ if (m_context_type == eContextTypeClangType && ast_context)
+ {
+ uint32_t ptr_bit_width = ClangASTType::GetClangTypeBitWidth (ast_context,
+ ClangASTContext::GetVoidPtrType(ast_context, false));
+ uint32_t ptr_byte_size = (ptr_bit_width + 7) / 8;
+ data.SetAddressByteSize (ptr_byte_size);
+ }
+ else
+ data.SetAddressByteSize(sizeof(void *));
if (m_value.GetData (data))
return error; // Success;
error.SetErrorStringWithFormat("extracting data from value failed");
OpenPOWER on IntegriCloud