diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-23 21:36:25 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-23 21:36:25 +0000 |
commit | 9dba64be9536c28e4800e06512b7f29b43ade345 (patch) | |
tree | 7f0f30947225ecb30ab0fdae8059a936537b0dfe /contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp | |
parent | 85868e8a1daeaae7a0e48effb2ea2310ae3b02c6 (diff) | |
parent | ead246455adf1a215ec2715dad6533073a6beb4e (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp b/contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp index 8b30c4ea7cb1..df432a0af3da 100644 --- a/contrib/llvm-project/lldb/source/Target/ThreadPlanPython.cpp +++ b/contrib/llvm-project/lldb/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; } |