diff options
Diffstat (limited to 'source/Target/ThreadPlanPython.cpp')
-rw-r--r-- | source/Target/ThreadPlanPython.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/source/Target/ThreadPlanPython.cpp b/source/Target/ThreadPlanPython.cpp index 8b30c4ea7cb1..df432a0af3da 100644 --- a/source/Target/ThreadPlanPython.cpp +++ b/source/Target/ThreadPlanPython.cpp @@ -25,10 +25,11 @@ using namespace lldb_private; // ThreadPlanPython -ThreadPlanPython::ThreadPlanPython(Thread &thread, const char *class_name) +ThreadPlanPython::ThreadPlanPython(Thread &thread, const char *class_name, + StructuredDataImpl *args_data) : ThreadPlan(ThreadPlan::eKindPython, "Python based Thread Plan", thread, eVoteNoOpinion, eVoteNoOpinion), - m_class_name(class_name), m_did_push(false) { + m_class_name(class_name), m_args_data(args_data), m_did_push(false) { SetIsMasterPlan(true); SetOkayToDiscard(true); SetPrivate(false); @@ -45,7 +46,9 @@ bool ThreadPlanPython::ValidatePlan(Stream *error) { if (!m_implementation_sp) { if (error) - error->Printf("Python thread plan does not have an implementation"); + error->Printf("Error constructing Python ThreadPlan: %s", + m_error_str.empty() ? "<unknown error>" + : m_error_str.c_str()); return false; } @@ -63,16 +66,16 @@ void ThreadPlanPython::DidPush() { .GetScriptInterpreter(); if (script_interp) { m_implementation_sp = script_interp->CreateScriptedThreadPlan( - m_class_name.c_str(), this->shared_from_this()); + m_class_name.c_str(), m_args_data, m_error_str, + this->shared_from_this()); } } } bool ThreadPlanPython::ShouldStop(Event *event_ptr) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); bool should_stop = true; if (m_implementation_sp) { @@ -93,9 +96,8 @@ bool ThreadPlanPython::ShouldStop(Event *event_ptr) { bool ThreadPlanPython::IsPlanStale() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); bool is_stale = true; if (m_implementation_sp) { @@ -116,9 +118,8 @@ bool ThreadPlanPython::IsPlanStale() { bool ThreadPlanPython::DoPlanExplainsStop(Event *event_ptr) { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); bool explains_stop = true; if (m_implementation_sp) { @@ -139,9 +140,8 @@ bool ThreadPlanPython::DoPlanExplainsStop(Event *event_ptr) { bool ThreadPlanPython::MischiefManaged() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); bool mischief_managed = true; if (m_implementation_sp) { // I don't really need mischief_managed, since it's simpler to just call @@ -155,9 +155,8 @@ bool ThreadPlanPython::MischiefManaged() { lldb::StateType ThreadPlanPython::GetPlanRunState() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); lldb::StateType run_state = eStateRunning; if (m_implementation_sp) { ScriptInterpreter *script_interp = m_thread.GetProcess() @@ -188,8 +187,7 @@ void ThreadPlanPython::GetDescription(Stream *s, lldb::DescriptionLevel level) { bool ThreadPlanPython::WillStop() { Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD)); - if (log) - log->Printf("%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, - m_class_name.c_str()); + LLDB_LOGF(log, "%s called on Python Thread Plan: %s )", LLVM_PRETTY_FUNCTION, + m_class_name.c_str()); return true; } |