aboutsummaryrefslogtreecommitdiff
path: root/source/Core/ValueObjectRegister.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-02-18 05:35:26 +0000
committerGreg Clayton <gclayton@apple.com>2012-02-18 05:35:26 +0000
commit289afcb5e26c2527a0d2e71f84e780b86bbcf90a (patch)
treeefb088e1115b29cfad18f9fba3ad23f426e98b2a /source/Core/ValueObjectRegister.cpp
parent70c6cf4b614cd79a54cf1a8696f7b4c963229868 (diff)
downloadlldb-289afcb5e26c2527a0d2e71f84e780b86bbcf90a.tar.gz
The second part in thread hardening the internals of LLDB where we make
the lldb_private::StackFrame objects hold onto a weak pointer to the thread object. The lldb_private::StackFrame objects the the most volatile objects we have as when we are doing single stepping, frames can often get lost or thrown away, only to be re-created as another object that still refers to the same frame. We have another bug tracking that. But we need to be able to have frames no longer be able to get the thread when they are not part of a thread anymore, and this is the first step (this fix makes that possible but doesn't implement it yet). Also changed lldb_private::ExecutionContextScope to return shared pointers to all objects in the execution context to further thread harden the internals. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@150871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'source/Core/ValueObjectRegister.cpp')
-rw-r--r--source/Core/ValueObjectRegister.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/Core/ValueObjectRegister.cpp b/source/Core/ValueObjectRegister.cpp
index f0896094e..e257165ae 100644
--- a/source/Core/ValueObjectRegister.cpp
+++ b/source/Core/ValueObjectRegister.cpp
@@ -307,10 +307,11 @@ ValueObjectRegister::GetClangType ()
{
if (m_clang_type == NULL)
{
- Process *process = m_reg_ctx_sp->CalculateProcess ();
- if (process)
+ ExecutionContext exe_ctx (GetExecutionContextRef());
+ Target *target = exe_ctx.GetTargetPtr();
+ if (target)
{
- Module *exe_module = process->GetTarget().GetExecutableModulePointer();
+ Module *exe_module = target->GetExecutableModulePointer();
if (exe_module)
{
m_clang_type = exe_module->GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize (m_reg_info.encoding,
@@ -338,10 +339,11 @@ ValueObjectRegister::CalculateNumChildren()
clang::ASTContext *
ValueObjectRegister::GetClangAST ()
{
- Process *process = m_reg_ctx_sp->CalculateProcess ();
- if (process)
+ ExecutionContext exe_ctx (GetExecutionContextRef());
+ Target *target = exe_ctx.GetTargetPtr();
+ if (target)
{
- Module *exe_module = process->GetTarget().GetExecutableModulePointer();
+ Module *exe_module = target->GetExecutableModulePointer();
if (exe_module)
return exe_module->GetClangASTContext().getASTContext();
}