Author: jingham Date: Thu Feb 27 20:52:06 2014 New Revision: 202464 URL: http://llvm.org/viewvc/llvm-project?rev=202464&view=rev Log: Plumb the EvaluateExpressionOptions::{Set,Get}StopOthers through the SB API, and make it work in RunThreadPlan. Also remove SetStopOthers from the ThreadPlanCallFunction, because if the value you have doesn't match what is in the EvaluateExpressionOptions the plan was passed when created it won't work correctly.
Modified: lldb/trunk/include/lldb/API/SBExpressionOptions.h lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h lldb/trunk/scripts/Python/interface/SBExpressionOptions.i lldb/trunk/source/API/SBExpressionOptions.cpp lldb/trunk/source/Target/Process.cpp lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Modified: lldb/trunk/include/lldb/API/SBExpressionOptions.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBExpressionOptions.h?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/include/lldb/API/SBExpressionOptions.h (original) +++ lldb/trunk/include/lldb/API/SBExpressionOptions.h Thu Feb 27 20:52:06 2014 @@ -64,6 +64,12 @@ public: void SetTryAllThreads (bool run_others = true); + + bool + GetStopOthers() const; + + void + SetStopOthers(bool stop_others = true); bool GetTrapExceptions () const; Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h (original) +++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h Thu Feb 27 20:52:06 2014 @@ -52,9 +52,6 @@ public: virtual bool StopOthers (); - virtual void - SetStopOthers (bool new_value); - virtual lldb::StateType GetPlanRunState (); Modified: lldb/trunk/scripts/Python/interface/SBExpressionOptions.i URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBExpressionOptions.i?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/scripts/Python/interface/SBExpressionOptions.i (original) +++ lldb/trunk/scripts/Python/interface/SBExpressionOptions.i Thu Feb 27 20:52:06 2014 @@ -72,6 +72,13 @@ public: SetTryAllThreads (bool run_others = true); bool + GetStopOthers () const; + + %feature("docstring", "Sets whether to stop other threads at all while running expressins. If false, TryAllThreads does nothing.") SetTryAllThreads; + void + SetStopOthers (bool stop_others = true); + + bool GetTrapExceptions () const; %feature("docstring", "Sets whether to abort expression evaluation if an exception is thrown while executing. Don't set this to false unless you know the function you are calling traps all exceptions itself.") SetTryAllThreads; Modified: lldb/trunk/source/API/SBExpressionOptions.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBExpressionOptions.cpp?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/source/API/SBExpressionOptions.cpp (original) +++ lldb/trunk/source/API/SBExpressionOptions.cpp Thu Feb 27 20:52:06 2014 @@ -114,6 +114,18 @@ SBExpressionOptions::SetTryAllThreads (b } bool +SBExpressionOptions::GetStopOthers () const +{ + return m_opaque_ap->GetStopOthers (); +} + +void +SBExpressionOptions::SetStopOthers (bool run_others) +{ + m_opaque_ap->SetStopOthers (run_others); +} + +bool SBExpressionOptions::GetTrapExceptions () const { return m_opaque_ap->GetTrapExceptions (); Modified: lldb/trunk/source/Target/Process.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/source/Target/Process.cpp (original) +++ lldb/trunk/source/Target/Process.cpp Thu Feb 27 20:52:06 2014 @@ -5118,7 +5118,12 @@ Process::RunThreadPlan (ExecutionContext TimeValue final_timeout = one_thread_timeout; uint32_t timeout_usec = options.GetTimeoutUsec(); - if (options.GetTryAllThreads()) + if (!options.GetStopOthers()) + { + before_first_timeout = false; + final_timeout.OffsetWithMicroSeconds(timeout_usec); + } + else if (options.GetTryAllThreads()) { // If we are running all threads then we take half the time to run all threads, bounded by // .25 sec. Modified: lldb/trunk/source/Target/ThreadPlanCallFunction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanCallFunction.cpp?rev=202464&r1=202463&r2=202464&view=diff ============================================================================== --- lldb/trunk/source/Target/ThreadPlanCallFunction.cpp (original) +++ lldb/trunk/source/Target/ThreadPlanCallFunction.cpp Thu Feb 27 20:52:06 2014 @@ -425,17 +425,6 @@ ThreadPlanCallFunction::StopOthers () return m_stop_other_threads; } -void -ThreadPlanCallFunction::SetStopOthers (bool new_value) -{ - if (m_subplan_sp) - { - ThreadPlanRunToAddress *address_plan = static_cast<ThreadPlanRunToAddress *>(m_subplan_sp.get()); - address_plan->SetStopOthers(new_value); - } - m_stop_other_threads = new_value; -} - StateType ThreadPlanCallFunction::GetPlanRunState () { _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits