diff options
Diffstat (limited to 'source/Core/ValueObject.cpp')
-rw-r--r-- | source/Core/ValueObject.cpp | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/source/Core/ValueObject.cpp b/source/Core/ValueObject.cpp index 297365b4ecbd6..74176eeace3a2 100644 --- a/source/Core/ValueObject.cpp +++ b/source/Core/ValueObject.cpp @@ -73,7 +73,6 @@ class SymbolContextScope; using namespace lldb; using namespace lldb_private; -using namespace lldb_utility; static user_id_t g_value_obj_uid = 0; @@ -226,12 +225,12 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) { bool ValueObject::UpdateFormatsIfNeeded() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_DATAFORMATTERS)); - if (log) - log->Printf("[%s %p] checking for FormatManager revisions. ValueObject " - "rev: %d - Global rev: %d", - GetName().GetCString(), static_cast<void *>(this), - m_last_format_mgr_revision, - DataVisualization::GetCurrentRevision()); + LLDB_LOGF(log, + "[%s %p] checking for FormatManager revisions. ValueObject " + "rev: %d - Global rev: %d", + GetName().GetCString(), static_cast<void *>(this), + m_last_format_mgr_revision, + DataVisualization::GetCurrentRevision()); bool any_change = false; @@ -811,7 +810,7 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx, uint64_t ValueObject::GetData(DataExtractor &data, Status &error) { UpdateValueIfNeeded(false); ExecutionContext exe_ctx(GetExecutionContextRef()); - error = m_value.GetValueAsData(&exe_ctx, data, 0, GetModule().get()); + error = m_value.GetValueAsData(&exe_ctx, data, GetModule().get()); if (error.Fail()) { if (m_data.GetByteSize()) { data = m_data; @@ -1672,16 +1671,7 @@ bool ValueObject::IsRuntimeSupportValue() { if (!GetVariable() || !GetVariable()->IsArtificial()) return false; - LanguageType lang = eLanguageTypeUnknown; - if (auto *sym_ctx_scope = GetSymbolContextScope()) { - if (auto *func = sym_ctx_scope->CalculateSymbolContextFunction()) - lang = func->GetLanguage(); - else if (auto *comp_unit = - sym_ctx_scope->CalculateSymbolContextCompileUnit()) - lang = comp_unit->GetLanguage(); - } - - if (auto *runtime = process->GetLanguageRuntime(lang)) + if (auto *runtime = process->GetLanguageRuntime(GetVariable()->GetLanguage())) if (runtime->IsWhitelistedRuntimeValue(GetName())) return false; @@ -2726,9 +2716,9 @@ ValueObjectSP ValueObject::CreateConstantValue(ConstString name) { if (IsBitfield()) { Value v(Scalar(GetValueAsUnsigned(UINT64_MAX))); - m_error = v.GetValueAsData(&exe_ctx, data, 0, GetModule().get()); + m_error = v.GetValueAsData(&exe_ctx, data, GetModule().get()); } else - m_error = m_value.GetValueAsData(&exe_ctx, data, 0, GetModule().get()); + m_error = m_value.GetValueAsData(&exe_ctx, data, GetModule().get()); valobj_sp = ValueObjectConstResult::Create( exe_ctx.GetBestExecutionContextScope(), GetCompilerType(), name, data, @@ -3310,32 +3300,32 @@ lldb::ValueObjectSP ValueObjectManager::GetSP() { lldb::ProcessSP process_sp = GetProcessSP(); if (!process_sp) return lldb::ValueObjectSP(); - + const uint32_t current_stop_id = process_sp->GetLastNaturalStopID(); if (current_stop_id == m_stop_id) return m_user_valobj_sp; - + m_stop_id = current_stop_id; - + if (!m_root_valobj_sp) { m_user_valobj_sp.reset(); return m_root_valobj_sp; } - + m_user_valobj_sp = m_root_valobj_sp; - + if (m_use_dynamic != lldb::eNoDynamicValues) { lldb::ValueObjectSP dynamic_sp = m_user_valobj_sp->GetDynamicValue(m_use_dynamic); if (dynamic_sp) m_user_valobj_sp = dynamic_sp; } - + if (m_use_synthetic) { lldb::ValueObjectSP synthetic_sp = m_user_valobj_sp->GetSyntheticValue(m_use_synthetic); if (synthetic_sp) m_user_valobj_sp = synthetic_sp; } - + return m_user_valobj_sp; } |