[lldb] Minor refinements to ThreadPlan::RestoreThreadState (NFC)
Correct `RestoreThreadState` to a `void` return type. Also, update the signature of its
callee, `Thread::RestoreThreadStateFromCheckpoint`, by updating it to a `void` return
type, and making it non-`virtual`.
Differential Revision: https://reviews.llvm.org/D96688
GitOrigin-RevId: 65d91b40ae1d273586a8265d7cf598f0e56e17a3
diff --git a/include/lldb/Target/Thread.h b/include/lldb/Target/Thread.h
index 4b14806..04fa210 100644
--- a/include/lldb/Target/Thread.h
+++ b/include/lldb/Target/Thread.h
@@ -1050,8 +1050,7 @@
virtual bool
RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
- virtual bool
- RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
+ void RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
void EnableTracer(bool value, bool single_step);
diff --git a/include/lldb/Target/ThreadPlan.h b/include/lldb/Target/ThreadPlan.h
index 17bbfc9..74d49ce 100644
--- a/include/lldb/Target/ThreadPlan.h
+++ b/include/lldb/Target/ThreadPlan.h
@@ -464,10 +464,7 @@
// to restore the state when it is done. This will do that job. This is
// mostly useful for artificial plans like CallFunction plans.
- virtual bool RestoreThreadState() {
- // Nothing to do in general.
- return true;
- }
+ virtual void RestoreThreadState() {}
virtual bool IsVirtualStep() { return false; }
diff --git a/include/lldb/Target/ThreadPlanCallFunction.h b/include/lldb/Target/ThreadPlanCallFunction.h
index 5b432e5..8874c6c 100644
--- a/include/lldb/Target/ThreadPlanCallFunction.h
+++ b/include/lldb/Target/ThreadPlanCallFunction.h
@@ -90,7 +90,7 @@
lldb::addr_t GetStopAddress() { return m_stop_address; }
- bool RestoreThreadState() override;
+ void RestoreThreadState() override;
void ThreadDestroyed() override { m_takedown_done = true; }
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 660d5f8..1fb19ae 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -530,7 +530,7 @@
return false;
}
-bool Thread::RestoreThreadStateFromCheckpoint(
+void Thread::RestoreThreadStateFromCheckpoint(
ThreadStateCheckpoint &saved_state) {
if (saved_state.stop_info_sp)
saved_state.stop_info_sp->MakeStopInfoValid();
@@ -539,7 +539,6 @@
saved_state.current_inlined_depth);
GetPlans().RestoreCompletedPlanCheckpoint(
saved_state.m_completed_plan_checkpoint);
- return true;
}
StateType Thread::GetState() const {
diff --git a/source/Target/ThreadPlanCallFunction.cpp b/source/Target/ThreadPlanCallFunction.cpp
index f525173..3699a50 100644
--- a/source/Target/ThreadPlanCallFunction.cpp
+++ b/source/Target/ThreadPlanCallFunction.cpp
@@ -454,8 +454,8 @@
m_subplan_sp->SetStopOthers(new_value);
}
-bool ThreadPlanCallFunction::RestoreThreadState() {
- return GetThread().RestoreThreadStateFromCheckpoint(m_stored_thread_state);
+void ThreadPlanCallFunction::RestoreThreadState() {
+ GetThread().RestoreThreadStateFromCheckpoint(m_stored_thread_state);
}
void ThreadPlanCallFunction::SetReturnValue() {