diff options
| author | Enrico Granata <egranata@apple.com> | 2012-05-21 16:51:35 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2012-05-21 16:51:35 +0000 |
| commit | fd4c84ee9ffcea93879d65f7bbcab814c8245788 (patch) | |
| tree | 273dd05e4f003aec33fe137fb83d2baf143350e5 /lldb/source/Core/ValueObject.cpp | |
| parent | ea365131a2ff539ab8b052f299b85375b22e522f (diff) | |
| download | bcm5719-llvm-fd4c84ee9ffcea93879d65f7bbcab814c8245788.tar.gz bcm5719-llvm-fd4c84ee9ffcea93879d65f7bbcab814c8245788.zip | |
<rdar://problem/11355592> Fixing a bug where we would incorrectly try and determine a dynamic type for a variable of a pointer type that is not a valid generic type for dynamic pointers.
llvm-svn: 157190
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 46 |
1 files changed, 8 insertions, 38 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 4d8610fb222..07af307d755 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1766,15 +1766,14 @@ ValueObject::IsPointerOrReferenceType () } bool -ValueObject::IsPossibleCPlusPlusDynamicType () -{ - return ClangASTContext::IsPossibleCPlusPlusDynamicType (GetClangAST (), GetClangType()); -} - -bool ValueObject::IsPossibleDynamicType () { - return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType()); + ExecutionContext exe_ctx (GetExecutionContextRef()); + Process *process = exe_ctx.GetProcessPtr(); + if (process) + return process->IsPossibleDynamicValue(*this); + else + return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType()); } ValueObjectSP @@ -2058,37 +2057,8 @@ ValueObject::CalculateDynamicValue (DynamicValueType use_dynamic) { ExecutionContext exe_ctx (GetExecutionContextRef()); Process *process = exe_ctx.GetProcessPtr(); - if (process) - { - bool worth_having_dynamic_value = false; - - - // FIXME: Process should have some kind of "map over Runtimes" so we don't have to - // hard code this everywhere. - LanguageType known_type = GetObjectRuntimeLanguage(); - if (known_type != eLanguageTypeUnknown && known_type != eLanguageTypeC) - { - LanguageRuntime *runtime = process->GetLanguageRuntime (known_type); - if (runtime) - worth_having_dynamic_value = runtime->CouldHaveDynamicValue(*this); - } - else - { - LanguageRuntime *cpp_runtime = process->GetLanguageRuntime (eLanguageTypeC_plus_plus); - if (cpp_runtime) - worth_having_dynamic_value = cpp_runtime->CouldHaveDynamicValue(*this); - - if (!worth_having_dynamic_value) - { - LanguageRuntime *objc_runtime = process->GetLanguageRuntime (eLanguageTypeObjC); - if (objc_runtime) - worth_having_dynamic_value = objc_runtime->CouldHaveDynamicValue(*this); - } - } - - if (worth_having_dynamic_value) - m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic); - } + if (process && process->IsPossibleDynamicValue(*this)) + m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic); } } |

