diff options
Diffstat (limited to 'source/Core/ValueObjectChild.cpp')
-rw-r--r-- | source/Core/ValueObjectChild.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/source/Core/ValueObjectChild.cpp b/source/Core/ValueObjectChild.cpp index 019daa2fd3d2..0f7be8317dec 100644 --- a/source/Core/ValueObjectChild.cpp +++ b/source/Core/ValueObjectChild.cpp @@ -9,21 +9,21 @@ #include "lldb/Core/ValueObjectChild.h" -#include "lldb/Core/Scalar.h" // for Scalar -#include "lldb/Core/Value.h" // for Value, Value::ValueType::e... +#include "lldb/Core/Value.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Target/Process.h" -#include "lldb/Utility/Flags.h" // for Flags -#include "lldb/Utility/Status.h" // for Status -#include "lldb/lldb-forward.h" // for ProcessSP, ModuleSP +#include "lldb/Utility/Flags.h" +#include "lldb/Utility/Scalar.h" +#include "lldb/Utility/Status.h" +#include "lldb/lldb-forward.h" -#include <functional> // for _Func_impl<>::_Mybase -#include <memory> // for shared_ptr -#include <vector> // for vector +#include <functional> +#include <memory> +#include <vector> -#include <stdio.h> // for snprintf, size_t -#include <string.h> // for strlen +#include <stdio.h> +#include <string.h> using namespace lldb_private; @@ -51,7 +51,8 @@ lldb::ValueType ValueObjectChild::GetValueType() const { } size_t ValueObjectChild::CalculateNumChildren(uint32_t max) { - auto children_count = GetCompilerType().GetNumChildren(true); + ExecutionContext exe_ctx(GetExecutionContextRef()); + auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx); return children_count <= max ? children_count : max; } @@ -123,7 +124,7 @@ bool ValueObjectChild::UpdateValue() { Flags parent_type_flags(parent_type.GetTypeInfo()); const bool is_instance_ptr_base = - ((m_is_base_class == true) && + ((m_is_base_class) && (parent_type_flags.AnySet(lldb::eTypeInstanceIsPointer))); if (parent->GetCompilerType().ShouldTreatScalarValueAsAddress()) { @@ -141,7 +142,7 @@ bool ValueObjectChild::UpdateValue() { switch (addr_type) { case eAddressTypeFile: { lldb::ProcessSP process_sp(GetProcessSP()); - if (process_sp && process_sp->IsAlive() == true) + if (process_sp && process_sp->IsAlive()) m_value.SetValueType(Value::eValueTypeLoadAddress); else m_value.SetValueType(Value::eValueTypeFileAddress); @@ -201,12 +202,9 @@ bool ValueObjectChild::UpdateValue() { ExecutionContext exe_ctx( GetExecutionContextRef().Lock(thread_and_frame_only_if_stopped)); if (GetCompilerType().GetTypeInfo() & lldb::eTypeHasValue) { - if (!is_instance_ptr_base) - m_error = - m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get()); - else - m_error = m_parent->GetValue().GetValueAsData(&exe_ctx, m_data, 0, - GetModule().get()); + Value &value = is_instance_ptr_base ? m_parent->GetValue() : m_value; + m_error = + value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get()); } else { m_error.Clear(); // No value so nothing to read... } |