[Lldb-commits] [lldb] r236473 - [ValueObject::GetPointeeData] Get addr from value for eValueHostAddress values.

Siva Chandra sivachandra at google.com
Mon May 4 17:41:36 PDT 2015


Author: sivachandra
Date: Mon May  4 19:41:35 2015
New Revision: 236473

URL: http://llvm.org/viewvc/llvm-project?rev=236473&view=rev
Log:
[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

Modified:
    lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=236473&r1=236472&r2=236473&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Mon May  4 19:41:35 2015
@@ -1053,6 +1053,9 @@ ValueObject::GetPointeeData (DataExtract
                     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_i
         }
         break;
     case Value::eValueTypeHostAddress:
+        {
+            if(address_type)
+                *address_type = m_value.GetValueAddressType ();
+            return LLDB_INVALID_ADDRESS;
+        }
         break;
     }
     if (address_type)





More information about the lldb-commits mailing list