diff options
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 8bb542263f9..e083b8dc086 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -81,12 +81,13 @@ static user_id_t g_value_obj_uid = 0; // ValueObject constructor ValueObject::ValueObject(ValueObject &parent) : UserID(++g_value_obj_uid), // Unique identifier for every value object - m_parent(&parent), m_root(NULL), m_update_point(parent.GetUpdatePoint()), - m_name(), m_data(), m_value(), m_error(), m_value_str(), - m_old_value_str(), m_location_str(), m_summary_str(), m_object_desc_str(), - m_validation_result(), m_manager(parent.GetManager()), m_children(), - m_synthetic_children(), m_dynamic_value(NULL), m_synthetic_value(NULL), - m_deref_valobj(NULL), m_format(eFormatDefault), + m_parent(&parent), m_root(nullptr), + m_update_point(parent.GetUpdatePoint()), m_name(), m_data(), m_value(), + m_error(), m_value_str(), m_old_value_str(), m_location_str(), + m_summary_str(), m_object_desc_str(), m_validation_result(), + m_manager(parent.GetManager()), m_children(), m_synthetic_children(), + m_dynamic_value(nullptr), m_synthetic_value(nullptr), + m_deref_valobj(nullptr), m_format(eFormatDefault), m_last_format(eFormatDefault), m_last_format_mgr_revision(0), m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(), m_type_validator_sp(), m_user_id_of_forced_summary(), @@ -108,15 +109,15 @@ ValueObject::ValueObject(ValueObject &parent) ValueObject::ValueObject(ExecutionContextScope *exe_scope, AddressType child_ptr_or_ref_addr_type) : UserID(++g_value_obj_uid), // Unique identifier for every value object - m_parent(NULL), m_root(NULL), m_update_point(exe_scope), m_name(), + m_parent(nullptr), m_root(nullptr), m_update_point(exe_scope), m_name(), m_data(), m_value(), m_error(), m_value_str(), m_old_value_str(), m_location_str(), m_summary_str(), m_object_desc_str(), m_validation_result(), m_manager(), m_children(), m_synthetic_children(), - m_dynamic_value(NULL), m_synthetic_value(NULL), m_deref_valobj(NULL), - m_format(eFormatDefault), m_last_format(eFormatDefault), - m_last_format_mgr_revision(0), m_type_summary_sp(), m_type_format_sp(), - m_synthetic_children_sp(), m_type_validator_sp(), - m_user_id_of_forced_summary(), + m_dynamic_value(nullptr), m_synthetic_value(nullptr), + m_deref_valobj(nullptr), m_format(eFormatDefault), + m_last_format(eFormatDefault), m_last_format_mgr_revision(0), + m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(), + m_type_validator_sp(), m_user_id_of_forced_summary(), m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type), m_value_checksum(), m_preferred_display_language(lldb::eLanguageTypeUnknown), @@ -465,7 +466,7 @@ ValueObjectSP ValueObject::GetChildAtIndex(size_t idx, bool can_create) { } ValueObject *child = m_children.GetChildAtIndex(idx); - if (child != NULL) + if (child != nullptr) return child->GetSP(); } return child_sp; @@ -617,7 +618,7 @@ void ValueObject::SetName(ConstString name) { m_name = name; } ValueObject *ValueObject::CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) { - ValueObject *valobj = NULL; + ValueObject *valobj = nullptr; bool omit_empty_base_classes = true; bool ignore_array_bounds = synthetic_array_member; @@ -710,7 +711,7 @@ const char *ValueObject::GetSummaryAsCString(lldb::LanguageType lang) { summary_options); } if (m_summary_str.empty()) - return NULL; + return nullptr; return m_summary_str.c_str(); } @@ -763,12 +764,12 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx, if (is_pointer_type) { Status error; ValueObjectSP pointee_sp = Dereference(error); - if (error.Fail() || pointee_sp.get() == NULL) + if (error.Fail() || pointee_sp.get() == nullptr) return 0; return pointee_sp->GetData(data, error); } else { ValueObjectSP child_sp = GetChildAtIndex(0, true); - if (child_sp.get() == NULL) + if (child_sp.get() == nullptr) return 0; Status error; return child_sp->GetData(data, error); @@ -777,7 +778,7 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx, } else /* (items > 1) */ { Status error; - lldb_private::DataBufferHeap *heap_buf_ptr = NULL; + lldb_private::DataBufferHeap *heap_buf_ptr = nullptr; lldb::DataBufferSP data_sp(heap_buf_ptr = new lldb_private::DataBufferHeap()); @@ -964,7 +965,7 @@ ValueObject::ReadPointedString(lldb::DataBufferSP &buffer_sp, Status &error, if (is_array) { // We have an array uint64_t array_size = 0; - if (compiler_type.IsArrayType(NULL, &array_size, NULL)) { + if (compiler_type.IsArrayType(nullptr, &array_size, nullptr)) { cstr_len = array_size; if (cstr_len > max_length) { capped_data = true; @@ -1170,7 +1171,7 @@ const char *ValueObject::GetValueAsCString() { } } if (m_value_str.empty()) - return NULL; + return nullptr; return m_value_str.c_str(); } @@ -1281,7 +1282,7 @@ bool ValueObject::DumpPrintableRepresentation( buffer_sp, lldb::eByteOrderInvalid, 8)); // none of this matters for a string - pass some defaults options.SetStream(&s); - options.SetPrefixToken(0); + options.SetPrefixToken(nullptr); options.SetQuote('"'); options.SetSourceSize(buffer_sp->GetByteSize()); options.SetIsTruncated(read_string.second); @@ -1670,7 +1671,7 @@ ValueObject::GetTypeInfo(CompilerType *pointee_or_element_compiler_type) { bool ValueObject::IsPointerType() { return GetCompilerType().IsPointerType(); } bool ValueObject::IsArrayType() { - return GetCompilerType().IsArrayType(NULL, NULL, NULL); + return GetCompilerType().IsArrayType(nullptr, nullptr, nullptr); } bool ValueObject::IsScalarType() { return GetCompilerType().IsScalarType(); } @@ -1689,7 +1690,7 @@ bool ValueObject::IsPossibleDynamicType() { if (process) return process->IsPossibleDynamicValue(*this); else - return GetCompilerType().IsPossibleDynamicType(NULL, true, true); + return GetCompilerType().IsPossibleDynamicType(nullptr, true, true); } bool ValueObject::IsRuntimeSupportValue() { @@ -1900,7 +1901,7 @@ ValueObject::GetSyntheticExpressionPathChild(const char *expression, // We haven't made a synthetic array member for expression yet, so lets // make one and cache it for any future reference. synthetic_child_sp = GetValueForExpressionPath( - expression, NULL, NULL, + expression, nullptr, nullptr, GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal( GetValueForExpressionPathOptions::SyntheticChildrenTraversal:: None)); @@ -1923,7 +1924,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) { TargetSP target_sp(GetTargetSP()); if (target_sp && !target_sp->GetEnableSyntheticValue()) { - m_synthetic_value = NULL; + m_synthetic_value = nullptr; return; } @@ -1932,7 +1933,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) { if (!UpdateFormatsIfNeeded() && m_synthetic_value) return; - if (m_synthetic_children_sp.get() == NULL) + if (m_synthetic_children_sp.get() == nullptr) return; if (current_synth_sp == m_synthetic_children_sp && m_synthetic_value) @@ -1959,7 +1960,7 @@ ValueObjectSP ValueObject::GetDynamicValue(DynamicValueType use_dynamic) { if (use_dynamic == eNoDynamicValues) return ValueObjectSP(); - if (!IsDynamic() && m_dynamic_value == NULL) { + if (!IsDynamic() && m_dynamic_value == nullptr) { CalculateDynamicValue(use_dynamic); } if (m_dynamic_value) @@ -1987,7 +1988,7 @@ ValueObjectSP ValueObject::GetSyntheticValue(bool use_synthetic) { bool ValueObject::HasSyntheticValue() { UpdateFormatsIfNeeded(); - if (m_synthetic_children_sp.get() == NULL) + if (m_synthetic_children_sp.get() == nullptr) return false; CalculateSyntheticValue(true); @@ -2020,7 +2021,7 @@ ValueObject *ValueObject::GetNonBaseClassParent() { else return GetParent(); } - return NULL; + return nullptr; } bool ValueObject::IsBaseClass(uint32_t &depth) { @@ -3005,12 +3006,12 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState( ExecutionContext exe_ctx( m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped)); - if (exe_ctx.GetTargetPtr() == NULL) + if (exe_ctx.GetTargetPtr() == nullptr) return false; // If we don't have a process nothing can change. Process *process = exe_ctx.GetProcessPtr(); - if (process == NULL) + if (process == nullptr) return false; // If our stop id is the current stop ID, nothing has changed: @@ -3091,7 +3092,7 @@ void ValueObject::ClearUserVisibleData(uint32_t clear_mask) { if ((clear_mask & eClearUserVisibleDataItemsSyntheticChildren) == eClearUserVisibleDataItemsSyntheticChildren) { if (m_synthetic_value) - m_synthetic_value = NULL; + m_synthetic_value = nullptr; } if ((clear_mask & eClearUserVisibleDataItemsValidator) == @@ -3104,7 +3105,7 @@ SymbolContextScope *ValueObject::GetSymbolContextScope() { if (!m_parent->IsPointerOrReferenceType()) return m_parent->GetSymbolContextScope(); } - return NULL; + return nullptr; } lldb::ValueObjectSP |