SBThread::StepOutOfFrame should check that the SBStackFrame it gets passed

is valid, and that its thread is the same as this SBThread.

llvm-svn: 247046
This commit is contained in:
Jim Ingham 2015-09-08 18:40:59 +00:00
parent c3c183554b
commit 989a7558b8
1 changed files with 15 additions and 1 deletions

View File

@ -826,7 +826,6 @@ SBThread::StepOut ()
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
if (log)
log->Printf ("SBThread(%p)::StepOut ()",
static_cast<void*>(exe_ctx.GetThreadPtr()));
@ -861,6 +860,14 @@ SBThread::StepOutOfFrame (lldb::SBFrame &sb_frame)
Mutex::Locker api_locker;
ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
if (!sb_frame.IsValid())
{
if (log)
log->Printf("SBThread(%p)::StepOutOfFrame passed an invalid frame, returning.",
static_cast<void*>(exe_ctx.GetThreadPtr()));
return;
}
StackFrameSP frame_sp (sb_frame.GetFrameSP());
if (log)
{
@ -877,6 +884,13 @@ SBThread::StepOutOfFrame (lldb::SBFrame &sb_frame)
bool abort_other_plans = false;
bool stop_other_threads = false;
Thread *thread = exe_ctx.GetThreadPtr();
if (sb_frame.GetThread().GetThreadID() != thread->GetID())
{
log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another thread (0x" PRIx64 " vrs. 0x" PRIx64 ", returning.",
static_cast<void*>(exe_ctx.GetThreadPtr()),
sb_frame.GetThread().GetThreadID(),
thread->GetID());
}
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut (abort_other_plans,
NULL,