From 2837b766f594f6aa0ec17c96bc8d257e2569d65e Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Wed, 4 May 2011 03:43:18 +0000 Subject: Change "frame var" over to using OptionGroups (and thus the OptionGroupVariableObjectDisplay). Change the boolean "use_dynamic" over to a tri-state, no-dynamic, dynamic-w/o running target, and dynamic with running target. llvm-svn: 130832 --- lldb/source/Core/ValueObjectDynamicValue.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'lldb/source/Core/ValueObjectDynamicValue.cpp') diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index b43c6519baf..ee50d45433f 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -34,10 +34,11 @@ using namespace lldb_private; -ValueObjectDynamicValue::ValueObjectDynamicValue (ValueObject &parent) : +ValueObjectDynamicValue::ValueObjectDynamicValue (ValueObject &parent, lldb::DynamicValueType use_dynamic) : ValueObject(parent), m_address (), - m_type_sp() + m_type_sp(), + m_use_dynamic (use_dynamic) { SetName (parent.GetName().AsCString()); } @@ -122,6 +123,14 @@ ValueObjectDynamicValue::UpdateValue () return false; } + // Setting our type_sp to NULL will route everything back through our + // parent which is equivalent to not using dynamic values. + if (m_use_dynamic == lldb::eNoDynamicValues) + { + m_type_sp.reset(); + return true; + } + ExecutionContext exe_ctx (GetExecutionContextScope()); if (exe_ctx.target) @@ -144,19 +153,19 @@ ValueObjectDynamicValue::UpdateValue () { LanguageRuntime *runtime = process->GetLanguageRuntime (known_type); if (runtime) - found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, class_type_or_name, dynamic_address); + found_dynamic_type = runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); } else { LanguageRuntime *cpp_runtime = process->GetLanguageRuntime (lldb::eLanguageTypeC_plus_plus); if (cpp_runtime) - found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, class_type_or_name, dynamic_address); + found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); if (!found_dynamic_type) { LanguageRuntime *objc_runtime = process->GetLanguageRuntime (lldb::eLanguageTypeObjC); if (objc_runtime) - found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, class_type_or_name, dynamic_address); + found_dynamic_type = cpp_runtime->GetDynamicTypeAndAddress (*m_parent, m_use_dynamic, class_type_or_name, dynamic_address); } } -- cgit v1.2.3