[Lldb-commits] [PATCH] D56147: [Core] Use the implementation method `GetAddressOf` in `ValueObjectConstResultChild`

Aleksandr Urakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Dec 29 03:24:17 PST 2018


aleksandr.urakov created this revision.
aleksandr.urakov added reviewers: zturner, JDevlieghere, clayborg, labath.
aleksandr.urakov added a project: LLDB.
Herald added a subscriber: lldb-commits.

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.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D56147

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


Index: source/Core/ValueObjectConstResultChild.cpp
===================================================================
--- source/Core/ValueObjectConstResultChild.cpp
+++ source/Core/ValueObjectConstResultChild.cpp
@@ -52,6 +52,11 @@
   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,
Index: packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
===================================================================
--- packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
+++ packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
@@ -153,6 +153,9 @@
         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(
Index: include/lldb/Core/ValueObjectConstResultChild.h
===================================================================
--- include/lldb/Core/ValueObjectConstResultChild.h
+++ include/lldb/Core/ValueObjectConstResultChild.h
@@ -63,6 +63,9 @@
 
   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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56147.179682.patch
Type: text/x-patch
Size: 1906 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181229/48afcd4e/attachment.bin>


More information about the lldb-commits mailing list