[Lldb-commits] [lldb] r351065 - [Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild

Aleksandr Urakov via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 14 05:08:14 PST 2019


Author: aleksandr.urakov
Date: Mon Jan 14 05:08:13 2019
New Revision: 351065

URL: http://llvm.org/viewvc/llvm-project?rev=351065&view=rev
Log:
[Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild

Summary:
This patch allows to retrieve an address object for `ValueObject`'s children
retrieved through e.g. `GetChildAtIndex` or `GetChildMemberWithName`. It just
uses the corresponding method of the implementation object `m_impl` to achieve
that.

Reviewers: zturner, JDevlieghere, clayborg, labath, serge-sans-paille

Reviewed By: clayborg

Subscribers: leonid.mashinskiy, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D56147

Modified:
    lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
    lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
    lldb/trunk/source/Core/ValueObjectConstResultChild.cpp

Modified: lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h?rev=351065&r1=351064&r2=351065&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h Mon Jan 14 05:08:13 2019
@@ -63,6 +63,9 @@ public:
 
   lldb::ValueObjectSP AddressOf(Status &error) override;
 
+  lldb::addr_t GetAddressOf(bool scalar_is_load_address = true,
+                            AddressType *address_type = nullptr) override;
+
   size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0,
                         uint32_t item_count = 1) override;
 

Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py?rev=351065&r1=351064&r2=351065&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py Mon Jan 14 05:08:13 2019
@@ -153,6 +153,9 @@ class ValueAPITestCase(TestBase):
         val_s = target.EvaluateExpression('s')
         val_a = target.EvaluateExpression('a')
         self.assertTrue(
+            val_s.GetChildMemberWithName('a').GetAddress().IsValid(),
+            VALID_VARIABLE)
+        self.assertTrue(
             val_s.GetChildMemberWithName('a').AddressOf(),
             VALID_VARIABLE)
         self.assertTrue(

Modified: lldb/trunk/source/Core/ValueObjectConstResultChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectConstResultChild.cpp?rev=351065&r1=351064&r2=351065&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectConstResultChild.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectConstResultChild.cpp Mon Jan 14 05:08:13 2019
@@ -52,6 +52,11 @@ lldb::ValueObjectSP ValueObjectConstResu
   return m_impl.AddressOf(error);
 }
 
+lldb::addr_t ValueObjectConstResultChild::GetAddressOf(
+  bool scalar_is_load_address, AddressType* address_type) {
+  return m_impl.GetAddressOf(scalar_is_load_address, address_type);
+}
+
 ValueObject *ValueObjectConstResultChild::CreateChildAtIndex(
     size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
   return m_impl.CreateChildAtIndex(idx, synthetic_array_member,




More information about the lldb-commits mailing list