diff options
author | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2015-07-03 16:57:06 +0000 |
commit | 5e95aa85bb660d45e9905ef1d7180b2678280660 (patch) | |
tree | 3c2e41c3be19b7fc7666ed45a5f91ec3b6e35f2a /source/Target/ExecutionContext.cpp | |
parent | 12bd4897ff0678fa663e09d78ebc22dd255ceb86 (diff) |
Notes
Diffstat (limited to 'source/Target/ExecutionContext.cpp')
-rw-r--r-- | source/Target/ExecutionContext.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp index e03a560bd0635..03714728559cb 100644 --- a/source/Target/ExecutionContext.cpp +++ b/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) : @@ -238,9 +249,9 @@ uint32_t ExecutionContext::GetAddressByteSize() const { if (m_target_sp && m_target_sp->GetArchitecture().IsValid()) - m_target_sp->GetArchitecture().GetAddressByteSize(); + return m_target_sp->GetArchitecture().GetAddressByteSize(); if (m_process_sp) - m_process_sp->GetAddressByteSize(); + return m_process_sp->GetAddressByteSize(); return sizeof(void *); } |