diff options
Diffstat (limited to 'source/API/SBValue.cpp')
| -rw-r--r-- | source/API/SBValue.cpp | 57 | 
1 files changed, 40 insertions, 17 deletions
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp index edecb93944ad..ef62c30e42cf 100644 --- a/source/API/SBValue.cpp +++ b/source/API/SBValue.cpp @@ -7,8 +7,6 @@  //  //===----------------------------------------------------------------------===// -#include "lldb/lldb-python.h" -  #include "lldb/API/SBValue.h"  #include "lldb/API/SBDeclaration.h" @@ -63,13 +61,19 @@ public:                 lldb::DynamicValueType use_dynamic,                 bool use_synthetic,                 const char *name = NULL) : -    m_valobj_sp(in_valobj_sp), +    m_valobj_sp(),      m_use_dynamic(use_dynamic),      m_use_synthetic(use_synthetic),      m_name (name)      { -        if (!m_name.IsEmpty() && m_valobj_sp) -            m_valobj_sp->SetName(m_name); +        if (in_valobj_sp) +        { +            if ( (m_valobj_sp = in_valobj_sp->GetQualifiedRepresentationIfAvailable(lldb::eNoDynamicValues, false)) ) +            { +                if (!m_name.IsEmpty()) +                    m_valobj_sp->SetName(m_name); +            } +        }      }      ValueImpl (const ValueImpl& rhs) : @@ -152,10 +156,20 @@ public:              return ValueObjectSP();          } -        if (value_sp->GetDynamicValue(m_use_dynamic)) -            value_sp = value_sp->GetDynamicValue(m_use_dynamic); -        if (value_sp->GetSyntheticValue(m_use_synthetic)) -            value_sp = value_sp->GetSyntheticValue(m_use_synthetic); +        if (m_use_dynamic != eNoDynamicValues) +        { +            ValueObjectSP dynamic_sp = value_sp->GetDynamicValue(m_use_dynamic); +            if (dynamic_sp) +                value_sp = dynamic_sp; +        } + +        if (m_use_synthetic) +        { +            ValueObjectSP synthetic_sp = value_sp->GetSyntheticValue(m_use_synthetic); +            if (synthetic_sp) +                value_sp = synthetic_sp; +        } +          if (!value_sp)              error.SetErrorString("invalid value object");          if (!m_name.IsEmpty()) @@ -969,14 +983,7 @@ SBValue::GetChildAtIndex (uint32_t idx, lldb::DynamicValueType use_dynamic, bool          child_sp = value_sp->GetChildAtIndex (idx, can_create);          if (can_create_synthetic && !child_sp)          { -            if (value_sp->IsPointerType()) -            { -                child_sp = value_sp->GetSyntheticArrayMemberFromPointer(idx, can_create); -            } -            else if (value_sp->IsArrayType()) -            { -                child_sp = value_sp->GetSyntheticArrayMemberFromArray(idx, can_create); -            } +            child_sp = value_sp->GetSyntheticArrayMember(idx, can_create);          }      } @@ -1244,6 +1251,22 @@ SBValue::MightHaveChildren ()      return has_children;  } +bool +SBValue::IsRuntimeSupportValue () +{ +    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); +    bool is_support = false; +    ValueLocker locker; +    lldb::ValueObjectSP value_sp(GetSP(locker)); +    if (value_sp) +        is_support = value_sp->IsRuntimeSupportValue(); +     +    if (log) +        log->Printf ("SBValue(%p)::IsRuntimeSupportValue() => %i", +                     static_cast<void*>(value_sp.get()), is_support); +    return is_support; +} +  uint32_t  SBValue::GetNumChildren ()  {  | 
