diff options
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r-- | lldb/source/API/SBThread.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 47cf80ef29c..8318f041b60 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -1161,6 +1161,12 @@ SBThread::StepOverUntil (lldb::SBFrame &sb_frame, SBError SBThread::StepUsingScriptedThreadPlan (const char *script_class_name) { + StepUsingScriptedThreadPlan(script_class_name, true); +} + +SBError +SBThread::StepUsingScriptedThreadPlan (const char *script_class_name, bool resume_immediately) +{ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); SBError sb_error; @@ -1184,15 +1190,26 @@ SBThread::StepUsingScriptedThreadPlan (const char *script_class_name) Thread *thread = exe_ctx.GetThreadPtr(); ThreadPlanSP thread_plan_sp = thread->QueueThreadPlanForStepScripted(false, script_class_name, false); + if (!thread_plan_sp) + { + sb_error.SetErrorStringWithFormat("Error queueing thread plan for class: %s", script_class_name); + return sb_error; + } + + if (!resume_immediately) + { + return sb_error; + } + if (thread_plan_sp) sb_error = ResumeNewPlan(exe_ctx, thread_plan_sp.get()); else { - sb_error.SetErrorStringWithFormat("Error queuing thread plan for class: %s.", script_class_name); + sb_error.SetErrorStringWithFormat("Error resuming thread plan for class: %s.", script_class_name); if (log) - log->Printf ("SBThread(%p)::StepUsingScriptedThreadPlan: Error queuing thread plan for class: %s", - static_cast<void*>(exe_ctx.GetThreadPtr()), - script_class_name); + log->Printf ("SBThread(%p)::StepUsingScriptedThreadPlan: Error queuing thread plan for class: %s", + static_cast<void*>(exe_ctx.GetThreadPtr()), + script_class_name); } return sb_error; |