summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index 9619f56bb35..8c9b3afa0d3 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -59,6 +59,8 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
if (!abi)
return;
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
+
SetBreakpoints();
lldb::addr_t spBelowRedZone = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
@@ -76,9 +78,16 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
m_start_addr = context.symbol->GetValue();
lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&target);
- if (!thread.SaveFrameZeroState(m_register_backup))
+ // Checkpoint the thread state so we can restore it later.
+ if (!thread.CheckpointThreadState (m_stored_thread_state))
+ {
+ if (log)
+ log->Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state.");
return;
-
+ }
+ // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
+ thread.SetStopInfoToNothing();
+
m_function_addr = function;
lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
@@ -91,8 +100,6 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
cmd_arg))
return;
- LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
-
if (log)
{
RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
@@ -115,24 +122,24 @@ ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
ThreadPlanCallFunction::~ThreadPlanCallFunction ()
{
- if (m_valid && !IsPlanComplete())
DoTakedown();
}
void
ThreadPlanCallFunction::DoTakedown ()
{
- m_thread.RestoreSaveFrameZero(m_register_backup);
- m_thread.ClearStackFrames();
- SetPlanComplete();
- ClearBreakpoints();
+ if (m_valid && !IsPlanComplete())
+ {
+ m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state);
+ SetPlanComplete();
+ ClearBreakpoints();
+ }
}
void
ThreadPlanCallFunction::WillPop ()
{
- if (m_valid && !IsPlanComplete())
- DoTakedown();
+ DoTakedown();
}
void
@@ -278,6 +285,7 @@ ThreadPlanCallFunction::DidPush ()
m_subplan_sp.reset(new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads));
m_thread.QueueThreadPlan(m_subplan_sp, false);
+ m_subplan_sp->SetPrivate (true);
#endif
}
OpenPOWER on IntegriCloud