diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBValue.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/API/SBValue.cpp | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBValue.cpp b/contrib/llvm/tools/lldb/source/API/SBValue.cpp index ef62c30..a8584c5 100644 --- a/contrib/llvm/tools/lldb/source/API/SBValue.cpp +++ b/contrib/llvm/tools/lldb/source/API/SBValue.cpp @@ -632,7 +632,6 @@ SBValue::GetValueDidChange () return result; } -#ifndef LLDB_DISABLE_PYTHON const char * SBValue::GetSummary () { @@ -681,7 +680,6 @@ SBValue::GetSummary (lldb::SBStream& stream, } return cstr; } -#endif // LLDB_DISABLE_PYTHON const char * SBValue::GetLocation () @@ -753,7 +751,6 @@ SBValue::GetTypeFormat () return format; } -#ifndef LLDB_DISABLE_PYTHON lldb::SBTypeSummary SBValue::GetTypeSummary () { @@ -771,7 +768,6 @@ SBValue::GetTypeSummary () } return summary; } -#endif // LLDB_DISABLE_PYTHON lldb::SBTypeFilter SBValue::GetTypeFilter () @@ -831,7 +827,7 @@ SBValue::CreateChildAtOffset (const char *name, uint32_t offset, SBType type) TypeImplSP type_sp (type.GetSP()); if (type.IsValid()) { - sb_value.SetSP(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetClangASTType(false), true),GetPreferDynamicValue(),GetPreferSyntheticValue(), name); + sb_value.SetSP(value_sp->GetSyntheticChildAtOffset(offset, type_sp->GetCompilerType(false), true),GetPreferDynamicValue(),GetPreferSyntheticValue(), name); } } Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); @@ -856,7 +852,7 @@ SBValue::Cast (SBType type) lldb::ValueObjectSP value_sp(GetSP(locker)); TypeImplSP type_sp (type.GetSP()); if (value_sp && type_sp) - sb_value.SetSP(value_sp->Cast(type_sp->GetClangASTType(false)),GetPreferDynamicValue(),GetPreferSyntheticValue()); + sb_value.SetSP(value_sp->Cast(type_sp->GetCompilerType(false)),GetPreferDynamicValue(),GetPreferSyntheticValue()); return sb_value; } @@ -907,7 +903,7 @@ SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, SBType s lldb::TypeImplSP type_impl_sp (sb_type.GetSP()); if (value_sp && type_impl_sp) { - ClangASTType ast_type(type_impl_sp->GetClangASTType(true)); + CompilerType ast_type(type_impl_sp->GetCompilerType(true)); ExecutionContext exe_ctx (value_sp->GetExecutionContextRef()); new_value_sp = ValueObject::CreateValueObjectFromAddress(name, address, exe_ctx, ast_type); } @@ -936,7 +932,7 @@ SBValue::CreateValueFromData (const char* name, SBData data, SBType type) if (value_sp) { ExecutionContext exe_ctx (value_sp->GetExecutionContextRef()); - new_value_sp = ValueObject::CreateValueObjectFromData(name, **data, exe_ctx, type.GetSP()->GetClangASTType(true)); + new_value_sp = ValueObject::CreateValueObjectFromData(name, **data, exe_ctx, type.GetSP()->GetCompilerType(true)); new_value_sp->SetAddressTypeOfChildren(eAddressTypeLoad); } sb_value.SetSP(new_value_sp); @@ -1270,22 +1266,27 @@ SBValue::IsRuntimeSupportValue () uint32_t SBValue::GetNumChildren () { + return GetNumChildren (UINT32_MAX); +} + +uint32_t +SBValue::GetNumChildren (uint32_t max) +{ uint32_t num_children = 0; Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) - num_children = value_sp->GetNumChildren(); + num_children = value_sp->GetNumChildren(max); if (log) - log->Printf ("SBValue(%p)::GetNumChildren () => %u", - static_cast<void*>(value_sp.get()), num_children); + log->Printf ("SBValue(%p)::GetNumChildren (%u) => %u", + static_cast<void*>(value_sp.get()), max, num_children); return num_children; } - SBValue SBValue::Dereference () { @@ -1306,22 +1307,11 @@ SBValue::Dereference () return sb_value; } +// Deprecated - please use GetType().IsPointerType() instead. bool SBValue::TypeIsPointerType () { - bool is_ptr_type = false; - - ValueLocker locker; - lldb::ValueObjectSP value_sp(GetSP(locker)); - if (value_sp) - is_ptr_type = value_sp->IsPointerType(); - - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); - if (log) - log->Printf ("SBValue(%p)::TypeIsPointerType () => %i", - static_cast<void*>(value_sp.get()), is_ptr_type); - - return is_ptr_type; + return GetType().IsPointerType(); } void * @@ -1330,7 +1320,7 @@ SBValue::GetOpaqueType() ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) - return value_sp->GetClangType().GetOpaqueQualType(); + return value_sp->GetCompilerType().GetOpaqueQualType(); return NULL; } @@ -1435,7 +1425,10 @@ lldb::ValueObjectSP SBValue::GetSP (ValueLocker &locker) const { if (!m_opaque_sp || !m_opaque_sp->IsValid()) + { + locker.GetError().SetErrorString("No value"); return ValueObjectSP(); + } return locker.GetLockedSP(*m_opaque_sp.get()); } @@ -1823,7 +1816,7 @@ SBValue::Watch (bool resolve_location, bool read, bool write, SBError &error) watch_type |= LLDB_WATCH_TYPE_WRITE; Error rc; - ClangASTType type (value_sp->GetClangType()); + CompilerType type (value_sp->GetCompilerType()); WatchpointSP watchpoint_sp = target_sp->CreateWatchpoint(addr, byte_size, &type, watch_type, rc); error.SetError(rc); |