summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ValueObjectDynamicValue.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-09-17 22:56:38 +0000
committerEnrico Granata <egranata@apple.com>2015-09-17 22:56:38 +0000
commit0b6003f3e6cb0ab883bdffe56d91accf05898a30 (patch)
tree51255380493be90c9f413f826bb7f2d5f93656f9 /lldb/source/Core/ValueObjectDynamicValue.cpp
parent4151972c22cfc914c91734a9bfc066ea6d3b5dc4 (diff)
downloadbcm5719-llvm-0b6003f3e6cb0ab883bdffe56d91accf05898a30.tar.gz
bcm5719-llvm-0b6003f3e6cb0ab883bdffe56d91accf05898a30.zip
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
Diffstat (limited to 'lldb/source/Core/ValueObjectDynamicValue.cpp')
-rw-r--r--lldb/source/Core/ValueObjectDynamicValue.cpp11
1 files changed, 5 insertions, 6 deletions
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(),
OpenPOWER on IntegriCloud