mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user