[Lldb-commits] [lldb] r270593 - Lock out Process::RunThreadPlan so only one can be in flight at a time.
Jim Ingham via lldb-commits
lldb-commits at lists.llvm.org
Tue May 24 11:29:36 PDT 2016
Date: Tue May 24 13:29:36 2016
New Revision: 270593
Lock out Process::RunThreadPlan so only one can be in flight at a time.
What with all sorts of folks (TSAN, ASAN, queue detection, etc...) trying to
gather info by calling functions down in the lower layers of lldb, we've started
to see people running expressions simultaneously. The expression evaluation part
is okay, but only one RunThreadPlan can be active at a time. I added a lock to
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Tue May 24 13:29:36 2016
@@ -3402,6 +3402,7 @@ protected:
bool m_can_interpret_function_calls; // Some targets, e.g the OSX kernel, don't support the ability to modify the stack.
WarningsCollection m_warnings_issued; // A set of object pointers which have already had warnings printed
+ std::mutex m_run_thread_plan_lock;
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue May 24 13:29:36 2016
@@ -771,6 +771,7 @@ Process::Process(lldb::TargetSP target_s
@@ -5195,6 +5196,8 @@ Process::RunThreadPlan(ExecutionContext
const EvaluateExpressionOptions &options, DiagnosticManager &diagnostic_manager)
ExpressionResults return_value = eExpressionSetupError;
+ std::lock_guard<std::mutex> run_thread_plan_locker(m_run_thread_plan_lock);
@@ -5223,7 +5226,7 @@ Process::RunThreadPlan(ExecutionContext
// We need to change some of the thread plan attributes for the thread plan runner. This will restore them
// when we are done:
// We rely on the thread plan we are running returning "PlanCompleted" if when it successfully completes.
More information about the lldb-commits