Index: lldb/include/lldb/Target/Thread.h =================================================================== --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -539,9 +539,12 @@ /// This function is designed to be used by commands where the /// process is publicly stopped. /// + /// \param[in] frame_idx + /// The frame index to step out of. + /// /// \return /// An error that describes anything that went wrong - virtual Status StepOut(); + virtual Status StepOut(uint32_t frame_idx = 0); /// Retrieves the per-thread data area. /// Most OSs maintain a per-thread pointer (e.g. the FS register on @@ -836,7 +839,7 @@ /// See standard meanings for the stop & run votes in ThreadPlan.h. /// /// \param[in] frame_idx - /// The fame index. + /// The frame index. /// /// \param[out] status /// A status with an error if queuing failed. Index: lldb/source/Core/IOHandlerCursesGUI.cpp =================================================================== --- lldb/source/Core/IOHandlerCursesGUI.cpp +++ lldb/source/Core/IOHandlerCursesGUI.cpp @@ -6402,8 +6402,11 @@ if (exe_ctx.HasThreadScope()) { Process *process = exe_ctx.GetProcessPtr(); if (process && process->IsAlive() && - StateIsStoppedState(process->GetState(), true)) - exe_ctx.GetThreadRef().StepOut(); + StateIsStoppedState(process->GetState(), true)) { + Thread *thread = exe_ctx.GetThreadPtr(); + uint32_t frame_idx = thread->GetSelectedFrameIndex(); + exe_ctx.GetThreadRef().StepOut(frame_idx); + } } } return MenuActionResult::Handled; @@ -7361,7 +7364,9 @@ m_debugger.GetCommandInterpreter().GetExecutionContext(); if (exe_ctx.HasThreadScope() && StateIsStoppedState(exe_ctx.GetProcessRef().GetState(), true)) { - exe_ctx.GetThreadRef().StepOut(); + Thread *thread = exe_ctx.GetThreadPtr(); + uint32_t frame_idx = thread->GetSelectedFrameIndex(); + exe_ctx.GetThreadRef().StepOut(frame_idx); } } return eKeyHandled; Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -1953,7 +1953,7 @@ return error; } -Status Thread::StepOut() { +Status Thread::StepOut(uint32_t frame_idx) { Status error; Process *process = GetProcess().get(); if (StateIsStoppedState(process->GetState(), true)) { @@ -1963,7 +1963,7 @@ ThreadPlanSP new_plan_sp(QueueThreadPlanForStepOut( abort_other_plans, nullptr, first_instruction, stop_other_threads, - eVoteYes, eVoteNoOpinion, 0, error)); + eVoteYes, eVoteNoOpinion, frame_idx, error)); new_plan_sp->SetIsControllingPlan(true); new_plan_sp->SetOkayToDiscard(false);