[Lldb-commits] [PATCH] D96689: [lldb] Remove ThreadPlan::ShouldAutoContinue (NFC)
Dave Lee via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Sun Feb 14 23:31:55 PST 2021
kastiglione created this revision.
kastiglione added a reviewer: jingham.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Remove `ShouldAutoContinue`, implemented in only one subclass.
In the `ShouldAutoContinue::ShouldAutoContinue`, the value will always be the inverse of
`ShouldStop`. In the one call site of `ShouldAutoContinue`, its value only matters if
`ShouldStop` is also true. Since that can never be the case, this function doesn't need
to exist.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D96689
Files:
lldb/include/lldb/Target/ThreadPlan.h
lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
lldb/source/Target/Thread.cpp
lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
Index: lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
===================================================================
--- lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
+++ lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp
@@ -107,7 +107,7 @@
}
bool ThreadPlanStepOverBreakpoint::ShouldStop(Event *event_ptr) {
- return !ShouldAutoContinue(event_ptr);
+ return !m_auto_continue;
}
bool ThreadPlanStepOverBreakpoint::StopOthers() { return true; }
@@ -173,10 +173,6 @@
m_auto_continue = do_it;
}
-bool ThreadPlanStepOverBreakpoint::ShouldAutoContinue(Event *event_ptr) {
- return m_auto_continue;
-}
-
bool ThreadPlanStepOverBreakpoint::IsPlanStale() {
return GetThread().GetRegisterContext()->GetPC() != m_breakpoint_addr;
}
Index: lldb/source/Target/Thread.cpp
===================================================================
--- lldb/source/Target/Thread.cpp
+++ lldb/source/Target/Thread.cpp
@@ -861,10 +861,7 @@
}
if (!done_processing_current_plan) {
- bool over_ride_stop = current_plan->ShouldAutoContinue(event_ptr);
-
- LLDB_LOGF(log, "Plan %s explains stop, auto-continue %i.",
- current_plan->GetName(), over_ride_stop);
+ LLDB_LOGF(log, "Plan %s explains stop.", current_plan->GetName());
// We're starting from the base plan, so just let it decide;
if (current_plan->IsBasePlan()) {
@@ -905,9 +902,6 @@
}
}
}
-
- if (over_ride_stop)
- should_stop = false;
}
// One other potential problem is that we set up a master plan, then stop in
Index: lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
===================================================================
--- lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+++ lldb/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
@@ -30,7 +30,6 @@
bool MischiefManaged() override;
void ThreadDestroyed() override;
void SetAutoContinue(bool do_it);
- bool ShouldAutoContinue(Event *event_ptr) override;
bool IsPlanStale() override;
lldb::addr_t GetBreakpointLoadAddress() const { return m_breakpoint_addr; }
Index: lldb/include/lldb/Target/ThreadPlan.h
===================================================================
--- lldb/include/lldb/Target/ThreadPlan.h
+++ lldb/include/lldb/Target/ThreadPlan.h
@@ -360,8 +360,6 @@
virtual bool ShouldStop(Event *event_ptr) = 0;
- virtual bool ShouldAutoContinue(Event *event_ptr) { return false; }
-
// Whether a "stop class" event should be reported to the "outside world".
// In general if a thread plan is active, events should not be reported.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96689.323674.patch
Type: text/x-patch
Size: 2612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210215/a153e5e2/attachment.bin>
More information about the lldb-commits
mailing list