summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/FormatClasses.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-02-17 07:49:44 +0000
committerGreg Clayton <gclayton@apple.com>2012-02-17 07:49:44 +0000
commitcc4d0146b4f5edf4cebf06697f52959409136591 (patch)
tree9aa64046056d513eb1e506b126f89584e8ef9aee /lldb/source/Core/FormatClasses.cpp
parentdd19169988da4fca1149852c67019e448f13c75f (diff)
downloadbcm5719-llvm-cc4d0146b4f5edf4cebf06697f52959409136591.tar.gz
bcm5719-llvm-cc4d0146b4f5edf4cebf06697f52959409136591.zip
This checking is part one of trying to add some threading safety to our
internals. The first part of this is to use a new class: lldb_private::ExecutionContextRef This class holds onto weak pointers to the target, process, thread and frame and it also contains the thread ID and frame Stack ID in case the thread and frame objects go away and come back as new objects that represent the same logical thread/frame. ExecutionContextRef objcets have accessors to access shared pointers for the target, process, thread and frame which might return NULL if the backing object is no longer available. This allows for references to persistent program state without needing to hold a shared pointer to each object and potentially keeping that object around for longer than it needs to be. You can also "Lock" and ExecutionContextRef (which contains weak pointers) object into an ExecutionContext (which contains strong, or shared pointers) with code like ExecutionContext exe_ctx (my_obj->GetExectionContextRef().Lock()); llvm-svn: 150801
Diffstat (limited to 'lldb/source/Core/FormatClasses.cpp')
-rw-r--r--lldb/source/Core/FormatClasses.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Core/FormatClasses.cpp b/lldb/source/Core/FormatClasses.cpp
index ded4938568b..d59da37c487 100644
--- a/lldb/source/Core/FormatClasses.cpp
+++ b/lldb/source/Core/FormatClasses.cpp
@@ -85,8 +85,7 @@ StringSummaryFormat::FormatObject(lldb::ValueObjectSP object)
return "NULL";
StreamString s;
- ExecutionContext exe_ctx;
- object->GetExecutionContextScope()->CalculateExecutionContext(exe_ctx);
+ ExecutionContext exe_ctx (object->GetExecutionContextRef());
SymbolContext sc;
StackFrame *frame = exe_ctx.GetFramePtr();
if (frame)
@@ -237,8 +236,7 @@ SyntheticArrayView::GetDescription()
#ifndef LLDB_DISABLE_PYTHON
-TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass,
- lldb::ValueObjectSP be) :
+TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass, lldb::ValueObjectSP be) :
SyntheticChildrenFrontEnd(be),
m_python_class(pclass)
{
@@ -249,7 +247,7 @@ TypeSyntheticImpl::FrontEnd::FrontEnd(std::string pclass,
return;
}
- m_interpreter = m_backend->GetUpdatePoint().GetTargetSP()->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+ m_interpreter = m_backend->GetTargetSP()->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
if (m_interpreter == NULL)
m_wrapper = NULL;
OpenPOWER on IntegriCloud