summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/Thread.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Target/Thread.cpp104
1 files changed, 33 insertions, 71 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/Thread.cpp b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
index de33145..07f5321 100644
--- a/contrib/llvm/tools/lldb/source/Target/Thread.cpp
+++ b/contrib/llvm/tools/lldb/source/Target/Thread.cpp
@@ -496,7 +496,19 @@ Thread::ThreadStoppedForAReason (void)
bool
Thread::CheckpointThreadState (ThreadStateCheckpoint &saved_state)
{
- if (!SaveFrameZeroState(saved_state.register_backup))
+ saved_state.register_backup_sp.reset();
+ lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
+ if (frame_sp)
+ {
+ lldb::RegisterCheckpointSP reg_checkpoint_sp(new RegisterCheckpoint(RegisterCheckpoint::Reason::eExpression));
+ if (reg_checkpoint_sp)
+ {
+ lldb::RegisterContextSP reg_ctx_sp (frame_sp->GetRegisterContext());
+ if (reg_ctx_sp && reg_ctx_sp->ReadAllRegisterValues (*reg_checkpoint_sp))
+ saved_state.register_backup_sp = reg_checkpoint_sp;
+ }
+ }
+ if (!saved_state.register_backup_sp)
return false;
saved_state.stop_info_sp = GetStopInfo();
@@ -511,7 +523,26 @@ Thread::CheckpointThreadState (ThreadStateCheckpoint &saved_state)
bool
Thread::RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
{
- return RestoreSaveFrameZero(saved_state.register_backup);
+ if (saved_state.register_backup_sp)
+ {
+ lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
+ if (frame_sp)
+ {
+ lldb::RegisterContextSP reg_ctx_sp (frame_sp->GetRegisterContext());
+ if (reg_ctx_sp)
+ {
+ bool ret = reg_ctx_sp->WriteAllRegisterValues (*saved_state.register_backup_sp);
+
+ // Clear out all stack frames as our world just changed.
+ ClearStackFrames();
+ reg_ctx_sp->InvalidateIfNeeded(true);
+ if (m_unwinder_ap.get())
+ m_unwinder_ap->Clear();
+ return ret;
+ }
+ }
+ }
+ return false;
}
bool
@@ -1419,14 +1450,6 @@ Thread::QueueThreadPlanForStepInRange
ThreadPlanSP
-Thread::QueueThreadPlanForStepOverBreakpointPlan (bool abort_other_plans)
-{
- ThreadPlanSP thread_plan_sp (new ThreadPlanStepOverBreakpoint (*this));
- QueueThreadPlan (thread_plan_sp, abort_other_plans);
- return thread_plan_sp;
-}
-
-ThreadPlanSP
Thread::QueueThreadPlanForStepOut
(
bool abort_other_plans,
@@ -1469,25 +1492,6 @@ Thread::QueueThreadPlanForStepThrough (StackID &return_stack_id, bool abort_othe
}
ThreadPlanSP
-Thread::QueueThreadPlanForCallFunction (bool abort_other_plans,
- Address& function,
- lldb::addr_t arg,
- bool stop_other_threads,
- bool unwind_on_error,
- bool ignore_breakpoints)
-{
- ThreadPlanSP thread_plan_sp (new ThreadPlanCallFunction (*this,
- function,
- ClangASTType(),
- arg,
- stop_other_threads,
- unwind_on_error,
- ignore_breakpoints));
- QueueThreadPlan (thread_plan_sp, abort_other_plans);
- return thread_plan_sp;
-}
-
-ThreadPlanSP
Thread::QueueThreadPlanForRunToAddress (bool abort_other_plans,
Address &target_addr,
bool stop_other_threads)
@@ -1993,48 +1997,6 @@ Thread::GetStackFrameStatus (Stream& strm,
num_frames_with_source);
}
-bool
-Thread::SaveFrameZeroState (RegisterCheckpoint &checkpoint)
-{
- lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
- if (frame_sp)
- {
- checkpoint.SetStackID(frame_sp->GetStackID());
- lldb::RegisterContextSP reg_ctx_sp (frame_sp->GetRegisterContext());
- if (reg_ctx_sp)
- return reg_ctx_sp->ReadAllRegisterValues (checkpoint.GetData());
- }
- return false;
-}
-
-bool
-Thread::RestoreSaveFrameZero (const RegisterCheckpoint &checkpoint)
-{
- return ResetFrameZeroRegisters (checkpoint.GetData());
-}
-
-bool
-Thread::ResetFrameZeroRegisters (lldb::DataBufferSP register_data_sp)
-{
- lldb::StackFrameSP frame_sp(GetStackFrameAtIndex (0));
- if (frame_sp)
- {
- lldb::RegisterContextSP reg_ctx_sp (frame_sp->GetRegisterContext());
- if (reg_ctx_sp)
- {
- bool ret = reg_ctx_sp->WriteAllRegisterValues (register_data_sp);
-
- // Clear out all stack frames as our world just changed.
- ClearStackFrames();
- reg_ctx_sp->InvalidateIfNeeded(true);
- if (m_unwinder_ap.get())
- m_unwinder_ap->Clear();
- return ret;
- }
- }
- return false;
-}
-
Unwind *
Thread::GetUnwinder ()
{
OpenPOWER on IntegriCloud