From 0b6003f3e6cb0ab883bdffe56d91accf05898a30 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 17 Sep 2015 22:56:38 +0000 Subject: Make LanguageRuntime::GetDynamicTypeAndAddress return a ValueType For C++ and ObjC, dynamic values are always (at least somewhat) pointer-like in nature, so a ValueType of scalar is actually good enough that it could originally be hardcoded as the right choice Other languages, might have broader notions of things that are dynamic (e.g. a language where a value type can be dynamic). In those cases, it might actually be the case that a dynamic value is a pointer-to the data, or even a host address if dynamic expression results entirely in host space are being talked about This patch enables the language runtime to make that decision, and makes ValueObjectDynamicValue comply with it llvm-svn: 247957 --- lldb/source/Core/ValueObjectDynamicValue.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lldb/source/Core/ValueObjectDynamicValue.cpp') diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index 794c537b23a..d22de6498fc 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -210,25 +210,26 @@ ValueObjectDynamicValue::UpdateValue () TypeAndOrName class_type_or_name; Address dynamic_address; bool found_dynamic_type = false; + Value::ValueType value_type; lldb::LanguageType known_type = m_parent->GetObjectRuntimeLanguage(); if (known_type != lldb::eLanguageTypeUnknown && known_type != lldb::eLanguageTypeC) { LanguageRuntime *runtime = process->GetLanguageRuntime (known_type); if (runtime) - found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); + found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type); } else { LanguageRuntime *cpp_runtime = process->GetLanguageRuntime (lldb::eLanguageTypeC_plus_plus); if (cpp_runtime) - found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); + found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type); if (!found_dynamic_type) { LanguageRuntime *objc_runtime = process->GetLanguageRuntime (lldb::eLanguageTypeObjC); if (objc_runtime) - found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); + found_dynamic_type = objc_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address, value_type); } } @@ -305,9 +306,7 @@ ValueObjectDynamicValue::UpdateValue () //m_value.SetContext (Value::eContextTypeClangType, corrected_type); m_value.SetCompilerType (m_dynamic_type_info.GetCompilerType()); - // Our address is the location of the dynamic type stored in memory. It isn't a load address, - // because we aren't pointing to the LOCATION that stores the pointer to us, we're pointing to us... - m_value.SetValueType(Value::eValueTypeScalar); + m_value.SetValueType(value_type); if (has_changed_type && log) log->Printf("[%s %p] has a new dynamic type %s", GetName().GetCString(), -- cgit v1.2.3