diff options
author | Ed Maste <emaste@FreeBSD.org> | 2014-02-18 16:23:10 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2014-02-18 16:23:10 +0000 |
commit | 866dcdacfe59f5f448e008fe2c4cb9dfcf72b2ec (patch) | |
tree | 95cb16075f0af1b3a05b9b84eb18dda8e6c903e9 /source/Target/ExecutionContext.cpp | |
parent | de889deb2c386f2a7831befaf226e5c86685fa53 (diff) |
Diffstat (limited to 'source/Target/ExecutionContext.cpp')
-rw-r--r-- | source/Target/ExecutionContext.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp index 7a8b60189bc8..db4025f40c05 100644 --- a/source/Target/ExecutionContext.cpp +++ b/source/Target/ExecutionContext.cpp @@ -154,7 +154,7 @@ ExecutionContext::ExecutionContext (const ExecutionContextRef &exe_ctx_ref) : { } -ExecutionContext::ExecutionContext (const ExecutionContextRef *exe_ctx_ref_ptr) : +ExecutionContext::ExecutionContext (const ExecutionContextRef *exe_ctx_ref_ptr, bool thread_and_frame_only_if_stopped) : m_target_sp (), m_process_sp (), m_thread_sp (), @@ -164,8 +164,11 @@ ExecutionContext::ExecutionContext (const ExecutionContextRef *exe_ctx_ref_ptr) { m_target_sp = exe_ctx_ref_ptr->GetTargetSP(); m_process_sp = exe_ctx_ref_ptr->GetProcessSP(); - m_thread_sp = exe_ctx_ref_ptr->GetThreadSP(); - m_frame_sp = exe_ctx_ref_ptr->GetFrameSP(); + if (!thread_and_frame_only_if_stopped || (m_process_sp && StateIsStoppedState(m_process_sp->GetState(), true))) + { + m_thread_sp = exe_ctx_ref_ptr->GetThreadSP(); + m_frame_sp = exe_ctx_ref_ptr->GetFrameSP(); + } } } @@ -824,9 +827,9 @@ ExecutionContextRef::GetFrameSP () const } ExecutionContext -ExecutionContextRef::Lock () const +ExecutionContextRef::Lock (bool thread_and_frame_only_if_stopped) const { - return ExecutionContext(this); + return ExecutionContext(this, thread_and_frame_only_if_stopped); } |