summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/API/SBValue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBValue.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/API/SBValue.cpp60
1 files changed, 42 insertions, 18 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBValue.cpp b/contrib/llvm/tools/lldb/source/API/SBValue.cpp
index 0d3d7ad..ef62c30 100644
--- a/contrib/llvm/tools/lldb/source/API/SBValue.cpp
+++ b/contrib/llvm/tools/lldb/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())
@@ -608,7 +622,8 @@ SBValue::GetValueDidChange ()
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
{
- result = value_sp->GetValueDidChange ();
+ if (value_sp->UpdateValueIfNeeded(false))
+ result = value_sp->GetValueDidChange ();
}
if (log)
log->Printf ("SBValue(%p)::GetValueDidChange() => %i",
@@ -968,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);
}
}
@@ -1243,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 ()
{
OpenPOWER on IntegriCloud