diff options
author | Greg Clayton <gclayton@apple.com> | 2012-07-07 01:22:45 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-07-07 01:22:45 +0000 |
commit | 9407302d37cdcb8f2b3a64e956b495f4ec746887 (patch) | |
tree | db4a5eaf9015bdb9be9f873abb0b5279813c9a58 /lldb/source/Core/ValueObjectConstResult.cpp | |
parent | 3b18fbd983052d53019d8f7dc26660f16651363a (diff) | |
download | bcm5719-llvm-9407302d37cdcb8f2b3a64e956b495f4ec746887.tar.gz bcm5719-llvm-9407302d37cdcb8f2b3a64e956b495f4ec746887.zip |
Make const result value objects able to return dynamic types.
Modified the heap.py to be able to correctly indentify the exact ivar for the "ptr_refs" command no matter how deep the ivar is in a class hierarchy. Also fixed the ability for the heap command to symbolicate the stack backtrace when MallocStackLogging is set in the environment and the "--stack" option was specified.
llvm-svn: 159883
Diffstat (limited to 'lldb/source/Core/ValueObjectConstResult.cpp')
-rw-r--r-- | lldb/source/Core/ValueObjectConstResult.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObjectConstResult.cpp b/lldb/source/Core/ValueObjectConstResult.cpp index f5ddde59c7e..7d705a2f0cb 100644 --- a/lldb/source/Core/ValueObjectConstResult.cpp +++ b/lldb/source/Core/ValueObjectConstResult.cpp @@ -13,6 +13,7 @@ #include "lldb/Core/ValueObjectConstResultChild.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Module.h" +#include "lldb/Core/ValueObjectDynamicValue.h" #include "lldb/Core/ValueObjectList.h" #include "lldb/Symbol/ClangASTType.h" @@ -375,3 +376,24 @@ ValueObjectConstResult::GetPointeeData (DataExtractor& data, { return m_impl.GetPointeeData(data, item_idx, item_count); } + +lldb::ValueObjectSP +ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic) +{ + // Always recalculate dynamic values for const results as the memory that + // they might point to might have changed at any time. + if (use_dynamic != eNoDynamicValues) + { + if (!IsDynamic()) + { + ExecutionContext exe_ctx (GetExecutionContextRef()); + Process *process = exe_ctx.GetProcessPtr(); + if (process && process->IsPossibleDynamicValue(*this)) + m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic); + } + if (m_dynamic_value) + return m_dynamic_value->GetSP(); + } + return ValueObjectSP(); +} + |