diff options
author | Siva Chandra <sivachandra@google.com> | 2015-05-05 00:41:35 +0000 |
---|---|---|
committer | Siva Chandra <sivachandra@google.com> | 2015-05-05 00:41:35 +0000 |
commit | e32f2b57ffc1e1babacca392c560ba2723b2da0b (patch) | |
tree | f83625dd9c50b3984d8b3fa9fcfa2ef99af73efe /lldb/source/Core/ValueObject.cpp | |
parent | ac31a1f141c0daf31419c6d3c2502abda79d3d77 (diff) | |
download | bcm5719-llvm-e32f2b57ffc1e1babacca392c560ba2723b2da0b.tar.gz bcm5719-llvm-e32f2b57ffc1e1babacca392c560ba2723b2da0b.zip |
[ValueObject::GetPointeeData] Get addr from value for eValueHostAddress values.
Summary:
After r236447, ValueObject::GetAddressOf returns LLDB_INVALID_ADDRESS
when the value type is eValueHostAddress. For such a case, clients of
GetAddressOf should get the address from the scalar part of the value
instead of using the value returned by GetAddressOf directly.
This change also makes ValueObject::GetAddressOf set the address type to
eAddressTypeHost for values of eValueHostAddress so that clients can
recognize that they need to fetch the address from the scalar part
of the value.
Test Plan: ninja check-lldb on linux
Reviewers: clayborg, ovyalov
Reviewed By: ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9490
llvm-svn: 236473
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index b2f46104b59..503b9dfd66f 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1053,6 +1053,9 @@ ValueObject::GetPointeeData (DataExtractor& data, if (max_bytes > offset) { size_t bytes_read = std::min<uint64_t>(max_bytes - offset, bytes); + addr = m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS); + if (addr == LLDB_INVALID_ADDRESS) + break; heap_buf_ptr->CopyData((uint8_t*)(addr + offset), bytes_read); data.SetData(data_sp); return bytes_read; @@ -1828,6 +1831,11 @@ ValueObject::GetAddressOf (bool scalar_is_load_address, AddressType *address_typ } break; case Value::eValueTypeHostAddress: + { + if(address_type) + *address_type = m_value.GetValueAddressType (); + return LLDB_INVALID_ADDRESS; + } break; } if (address_type) |