[Lldb-commits] [lldb] r175573 - If RunThreadPlan is called on a thread that doesn't have a selected frame, select frame 0.
Jim Ingham
jingham at apple.com
Tue Feb 19 15:22:45 PST 2013
Author: jingham
Date: Tue Feb 19 17:22:45 2013
New Revision: 175573
URL: http://llvm.org/viewvc/llvm-project?rev=175573&view=rev
Log:
If RunThreadPlan is called on a thread that doesn't have a selected frame, select frame 0.
<rdar://problem/13093321>
Modified:
lldb/trunk/source/Target/Process.cpp
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=175573&r1=175572&r2=175573&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Feb 19 17:22:45 2013
@@ -4469,7 +4469,19 @@ Process::RunThreadPlan (ExecutionContext
// Save the thread & frame from the exe_ctx for restoration after we run
const uint32_t thread_idx_id = thread->GetIndexID();
- StackID ctx_frame_id = thread->GetSelectedFrame()->GetStackID();
+ StackFrameSP selected_frame_sp = thread->GetSelectedFrame();
+ if (!selected_frame_sp)
+ {
+ thread->SetSelectedFrame(0);
+ selected_frame_sp = thread->GetSelectedFrame();
+ if (!selected_frame_sp)
+ {
+ errors.Printf("RunThreadPlan called without a selected frame on thread %d", thread_idx_id);
+ return eExecutionSetupError;
+ }
+ }
+
+ StackID ctx_frame_id = selected_frame_sp->GetStackID();
// N.B. Running the target may unset the currently selected thread and frame. We don't want to do that either,
// so we should arrange to reset them as well.
More information about the lldb-commits
mailing list