summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ExecutionContext.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2015-02-12 00:34:25 +0000
committerGreg Clayton <gclayton@apple.com>2015-02-12 00:34:25 +0000
commit526ae040bab73b5c9ae273d499a1ab8cb5fb0381 (patch)
tree6230dad5200ab6945fe18d81874c463dcfd0bd1c /lldb/source/Target/ExecutionContext.cpp
parent36f807c8603b170ad71e0f15ec0279aa1c40384c (diff)
downloadbcm5719-llvm-526ae040bab73b5c9ae273d499a1ab8cb5fb0381.tar.gz
bcm5719-llvm-526ae040bab73b5c9ae273d499a1ab8cb5fb0381.zip
Make a more complete fix for always supplying an execution context when getting byte sizes from types.
There was a test in the test suite that was triggering the backtrace logging output that requested that the client pass an execution context. Sometimes we need the process for Objective C types because our static notion of the type might not align with the reality when being run in a live runtime. Switched from an "ExecutionContext *" to an "ExecutionContextScope *" for greater ease of use. llvm-svn: 228892
Diffstat (limited to 'lldb/source/Target/ExecutionContext.cpp')
-rw-r--r--lldb/source/Target/ExecutionContext.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/lldb/source/Target/ExecutionContext.cpp b/lldb/source/Target/ExecutionContext.cpp
index e03a560bd06..750af92d759 100644
--- a/lldb/source/Target/ExecutionContext.cpp
+++ b/lldb/source/Target/ExecutionContext.cpp
@@ -119,31 +119,42 @@ ExecutionContext::ExecutionContext (const lldb::StackFrameWP &frame_wp) :
}
ExecutionContext::ExecutionContext (Target* t, bool fill_current_process_thread_frame) :
- m_target_sp (t->shared_from_this()),
+ m_target_sp (),
m_process_sp (),
m_thread_sp (),
m_frame_sp ()
{
- if (t && fill_current_process_thread_frame)
+ if (t)
{
- m_process_sp = t->GetProcessSP();
- if (m_process_sp)
+ m_target_sp = t->shared_from_this();
+ if (fill_current_process_thread_frame)
{
- m_thread_sp = m_process_sp->GetThreadList().GetSelectedThread();
- if (m_thread_sp)
- m_frame_sp = m_thread_sp->GetSelectedFrame();
+ m_process_sp = t->GetProcessSP();
+ if (m_process_sp)
+ {
+ m_thread_sp = m_process_sp->GetThreadList().GetSelectedThread();
+ if (m_thread_sp)
+ m_frame_sp = m_thread_sp->GetSelectedFrame();
+ }
}
}
}
ExecutionContext::ExecutionContext(Process* process, Thread *thread, StackFrame *frame) :
m_target_sp (),
- m_process_sp (process->shared_from_this()),
- m_thread_sp (thread->shared_from_this()),
- m_frame_sp (frame->shared_from_this())
+ m_process_sp (),
+ m_thread_sp (),
+ m_frame_sp ()
{
if (process)
+ {
+ m_process_sp = process->shared_from_this();
m_target_sp = process->GetTarget().shared_from_this();
+ }
+ if (thread)
+ m_thread_sp = thread->shared_from_this();
+ if (frame)
+ m_frame_sp = frame->shared_from_this();
}
ExecutionContext::ExecutionContext (const ExecutionContextRef &exe_ctx_ref) :
OpenPOWER on IntegriCloud