diff options
author | Enrico Granata <egranata@apple.com> | 2012-04-24 01:23:23 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2012-04-24 01:23:23 +0000 |
commit | b046e0320c428a403814337bd37c59de751b3e5c (patch) | |
tree | 6300f3848edd3e472fb820d994a578a0ea2d65df /lldb/source/Core/Value.cpp | |
parent | 8701d38c93e4edcc3b5d9eaf4d36f86251cdca1f (diff) | |
download | bcm5719-llvm-b046e0320c428a403814337bd37c59de751b3e5c.tar.gz bcm5719-llvm-b046e0320c428a403814337bd37c59de751b3e5c.zip |
This patch fixes a bug where LLDB was incorrectly setting the address-size on a DataExtractor to be sizeof(void*) when the ValueObject came out of the expression parser
This worked correctly for 64-bit targets, but broke down data formatters in i386 mode. The formatters would try to read pointers out of the frozen-dried objects,
but were unable to do so because they would try fetching 8 bytes from a DataExtractor with only 4 bytes in it. This patch fixes the issue by always making the pointer-size
for a DataExtractor match the target setting.
llvm-svn: 155418
Diffstat (limited to 'lldb/source/Core/Value.cpp')
-rw-r--r-- | lldb/source/Core/Value.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp index e685390112e..8fc7f7c5a10 100644 --- a/lldb/source/Core/Value.cpp +++ b/lldb/source/Core/Value.cpp @@ -492,9 +492,20 @@ Value::GetValueAsData (ExecutionContext *exe_ctx, case eValueTypeHostAddress: address = m_value.ULongLong(LLDB_INVALID_ADDRESS); + address_type = eAddressTypeHost; + if (exe_ctx) + { + Target *target = exe_ctx->GetTargetPtr(); + if (target) + { + data.SetByteOrder(target->GetArchitecture().GetByteOrder()); + data.SetAddressByteSize(target->GetArchitecture().GetAddressByteSize()); + break; + } + } + // fallback to host settings data.SetByteOrder(lldb::endian::InlHostByteOrder()); data.SetAddressByteSize(sizeof(void *)); - address_type = eAddressTypeHost; break; } |