summaryrefslogtreecommitdiff
path: root/source/Core/ValueObjectConstResultImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Core/ValueObjectConstResultImpl.cpp')
-rw-r--r--source/Core/ValueObjectConstResultImpl.cpp56
1 files changed, 3 insertions, 53 deletions
diff --git a/source/Core/ValueObjectConstResultImpl.cpp b/source/Core/ValueObjectConstResultImpl.cpp
index d3e2758835095..733d767b7ee19 100644
--- a/source/Core/ValueObjectConstResultImpl.cpp
+++ b/source/Core/ValueObjectConstResultImpl.cpp
@@ -30,13 +30,6 @@
using namespace lldb;
using namespace lldb_private;
-// this macro enables a simpler implementation for some method calls in this object that relies only upon
-// ValueObject knowing how to set the address type of its children correctly. the alternative implementation
-// relies on being able to create a target copy of the frozen object, which makes it less bug-prone but less
-// efficient as well. once we are confident the faster implementation is bug-free, this macro (and the slower
-// implementations) can go
-#define TRIVIAL_IMPL 1
-
ValueObjectConstResultImpl::ValueObjectConstResultImpl (ValueObject* valobj,
lldb::addr_t live_address) :
m_impl_backend(valobj),
@@ -48,38 +41,12 @@ ValueObjectConstResultImpl::ValueObjectConstResultImpl (ValueObject* valobj,
}
lldb::ValueObjectSP
-ValueObjectConstResultImpl::DerefOnTarget()
-{
- if (m_load_addr_backend.get() == NULL)
- {
- lldb::addr_t tgt_address = m_impl_backend->GetPointerValue();
- ExecutionContext exe_ctx (m_impl_backend->GetExecutionContextRef());
- m_load_addr_backend = ValueObjectConstResult::Create (exe_ctx.GetBestExecutionContextScope(),
- m_impl_backend->GetClangType(),
- m_impl_backend->GetName(),
- tgt_address,
- eAddressTypeLoad,
- exe_ctx.GetAddressByteSize());
- }
- return m_load_addr_backend;
-}
-
-lldb::ValueObjectSP
ValueObjectConstResultImpl::Dereference (Error &error)
{
if (m_impl_backend == NULL)
return lldb::ValueObjectSP();
-#if defined (TRIVIAL_IMPL) && TRIVIAL_IMPL == 1
return m_impl_backend->ValueObject::Dereference(error);
-#else
- m_impl_backend->UpdateValueIfNeeded(false);
-
- if (NeedsDerefOnTarget())
- return DerefOnTarget()->Dereference(error);
- else
- return m_impl_backend->ValueObject::Dereference(error);
-#endif
}
ValueObject *
@@ -139,7 +106,8 @@ ValueObjectConstResultImpl::CreateChildAtIndex (size_t idx, bool synthetic_array
child_bitfield_bit_offset,
child_is_base_class,
child_is_deref_of_parent);
- valobj->m_impl.SetLiveAddress(m_live_address+child_byte_offset);
+ if (m_live_address != LLDB_INVALID_ADDRESS)
+ valobj->m_impl.SetLiveAddress(m_live_address+child_byte_offset);
}
return valobj;
@@ -151,16 +119,7 @@ ValueObjectConstResultImpl::GetSyntheticChildAtOffset (uint32_t offset, const Cl
if (m_impl_backend == NULL)
return lldb::ValueObjectSP();
-#if defined (TRIVIAL_IMPL) && TRIVIAL_IMPL == 1
return m_impl_backend->ValueObject::GetSyntheticChildAtOffset(offset, type, can_create);
-#else
- m_impl_backend->UpdateValueIfNeeded(false);
-
- if (NeedsDerefOnTarget())
- return DerefOnTarget()->GetSyntheticChildAtOffset(offset, type, can_create);
- else
- return m_impl_backend->ValueObject::GetSyntheticChildAtOffset(offset, type, can_create);
-#endif
}
lldb::ValueObjectSP
@@ -193,7 +152,7 @@ ValueObjectConstResultImpl::AddressOf (Error &error)
return m_address_of_backend;
}
else
- return lldb::ValueObjectSP();
+ return m_impl_backend->ValueObject::AddressOf(error);
}
lldb::addr_t
@@ -223,14 +182,5 @@ ValueObjectConstResultImpl::GetPointeeData (DataExtractor& data,
{
if (m_impl_backend == NULL)
return 0;
-#if defined (TRIVIAL_IMPL) && TRIVIAL_IMPL == 1
return m_impl_backend->ValueObject::GetPointeeData(data, item_idx, item_count);
-#else
- m_impl_backend->UpdateValueIfNeeded(false);
-
- if (NeedsDerefOnTarget() && m_impl_backend->IsPointerType())
- return DerefOnTarget()->GetPointeeData(data, item_idx, item_count);
- else
- return m_impl_backend->ValueObject::GetPointeeData(data, item_idx, item_count);
-#endif
}