diff options
author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-01-14 13:08:13 +0000 |
---|---|---|
committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2019-01-14 13:08:13 +0000 |
commit | b4c1e4c2fb035ea49974cfd7c0ef2497502e18be (patch) | |
tree | 58cb95738ba5c6c54252a5c0e53fbf5bbaa7d545 | |
parent | ceabe8b02f4cd355d018e34d93deef357aa80715 (diff) | |
download | bcm5719-llvm-b4c1e4c2fb035ea49974cfd7c0ef2497502e18be.tar.gz bcm5719-llvm-b4c1e4c2fb035ea49974cfd7c0ef2497502e18be.zip |
[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
llvm-svn: 351065
3 files changed, 11 insertions, 0 deletions
diff --git a/lldb/include/lldb/Core/ValueObjectConstResultChild.h b/lldb/include/lldb/Core/ValueObjectConstResultChild.h index 9ff62d167ef..f14fb75640e 100644 --- a/lldb/include/lldb/Core/ValueObjectConstResultChild.h +++ b/lldb/include/lldb/Core/ValueObjectConstResultChild.h @@ -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; diff --git a/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py b/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py index 8a4af0cc2b9..2299f1f1432 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py @@ -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( diff --git a/lldb/source/Core/ValueObjectConstResultChild.cpp b/lldb/source/Core/ValueObjectConstResultChild.cpp index bbfbd8ef2aa..441c16479f2 100644 --- a/lldb/source/Core/ValueObjectConstResultChild.cpp +++ b/lldb/source/Core/ValueObjectConstResultChild.cpp @@ -52,6 +52,11 @@ lldb::ValueObjectSP ValueObjectConstResultChild::AddressOf(Status &error) { 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, |