[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
This commit is contained in:
Dave Lee 2021-02-14 22:49:16 -08:00
parent 32dc79c5ef
commit 65d91b40ae
5 changed files with 6 additions and 11 deletions

View File

@ -1050,8 +1050,7 @@ public:
virtual bool
RestoreRegisterStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
virtual bool
RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
void RestoreThreadStateFromCheckpoint(ThreadStateCheckpoint &saved_state);
void EnableTracer(bool value, bool single_step);

View File

@ -464,10 +464,7 @@ public:
// 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; }

View File

@ -90,7 +90,7 @@ public:
lldb::addr_t GetStopAddress() { return m_stop_address; }
bool RestoreThreadState() override;
void RestoreThreadState() override;
void ThreadDestroyed() override { m_takedown_done = true; }

View File

@ -530,7 +530,7 @@ bool Thread::RestoreRegisterStateFromCheckpoint(
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 @@ bool Thread::RestoreThreadStateFromCheckpoint(
saved_state.current_inlined_depth);
GetPlans().RestoreCompletedPlanCheckpoint(
saved_state.m_completed_plan_checkpoint);
return true;
}
StateType Thread::GetState() const {

View File

@ -454,8 +454,8 @@ void ThreadPlanCallFunction::SetStopOthers(bool new_value) {
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() {