summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBThread.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2015-09-08 18:40:59 +0000
committerJim Ingham <jingham@apple.com>2015-09-08 18:40:59 +0000
commit989a7558b891ef576f6522fae3863de9bf5f0d73 (patch)
tree8b21eef2b28380eec17eee04063194f6aae1e627 /lldb/source/API/SBThread.cpp
parentc3c183554bc759d59288ac53e29f93d152e67f2a (diff)
downloadbcm5719-llvm-989a7558b891ef576f6522fae3863de9bf5f0d73.tar.gz
bcm5719-llvm-989a7558b891ef576f6522fae3863de9bf5f0d73.zip
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
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r--lldb/source/API/SBThread.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index 42b5c9affe5..c26beef1e5e 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -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,
OpenPOWER on IntegriCloud