Skip to content

Commit bd56b86

Browse files
authored
Revert "[lldb] Implement basic support for reverse-continue (#112079)"
This reverts commit b7b9ccf.
1 parent bc6f84a commit bd56b86

40 files changed

+47
-1333
lines changed

lldb/include/lldb/API/SBProcess.h

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ class LLDB_API SBProcess {
159159
lldb::SBError Destroy();
160160

161161
lldb::SBError Continue();
162-
lldb::SBError ContinueInDirection(lldb::RunDirection direction);
163162

164163
lldb::SBError Stop();
165164

lldb/include/lldb/Target/Process.h

+2-26
Original file line numberDiff line numberDiff line change
@@ -1089,13 +1089,6 @@ class Process : public std::enable_shared_from_this<Process>,
10891089
/// Returns an error object.
10901090
virtual Status WillResume() { return Status(); }
10911091

1092-
/// Reports whether this process supports reverse execution.
1093-
///
1094-
/// \return
1095-
/// Returns true if the process supports reverse execution (at least
1096-
/// under some circumstances).
1097-
virtual bool SupportsReverseDirection() { return false; }
1098-
10991092
/// Resumes all of a process's threads as configured using the Thread run
11001093
/// control functions.
11011094
///
@@ -1111,13 +1104,9 @@ class Process : public std::enable_shared_from_this<Process>,
11111104
/// \see Thread:Resume()
11121105
/// \see Thread:Step()
11131106
/// \see Thread:Suspend()
1114-
virtual Status DoResume(lldb::RunDirection direction) {
1115-
if (direction == lldb::RunDirection::eRunForward)
1116-
return Status::FromErrorStringWithFormatv(
1117-
"error: {0} does not support resuming processes", GetPluginName());
1107+
virtual Status DoResume() {
11181108
return Status::FromErrorStringWithFormatv(
1119-
"error: {0} does not support reverse execution of processes",
1120-
GetPluginName());
1109+
"error: {0} does not support resuming processes", GetPluginName());
11211110
}
11221111

11231112
/// Called after resuming a process.
@@ -2687,18 +2676,6 @@ void PruneThreadPlans();
26872676
const AddressRange &range, size_t alignment,
26882677
Status &error);
26892678

2690-
/// Get the base run direction for the process.
2691-
/// The base direction is the direction the process will execute in
2692-
/// (forward or backward) if no thread plan overrides the direction.
2693-
lldb::RunDirection GetBaseDirection() const { return m_base_direction; }
2694-
/// Set the base run direction for the process.
2695-
/// As a side-effect, if this changes the base direction, then we
2696-
/// discard all non-base thread plans to ensure that when execution resumes
2697-
/// we definitely execute in the requested direction.
2698-
/// FIXME: this is overkill. In some situations ensuring the latter
2699-
/// would not require discarding all non-base thread plans.
2700-
void SetBaseDirection(lldb::RunDirection direction);
2701-
27022679
protected:
27032680
friend class Trace;
27042681

@@ -3098,7 +3075,6 @@ void PruneThreadPlans();
30983075
ThreadList
30993076
m_extended_thread_list; ///< Constituent for extended threads that may be
31003077
/// generated, cleared on natural stops
3101-
lldb::RunDirection m_base_direction; ///< ThreadPlanBase run direction
31023078
uint32_t m_extended_thread_stop_id; ///< The natural stop id when
31033079
///extended_thread_list was last updated
31043080
QueueList

lldb/include/lldb/Target/StopInfo.h

-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ namespace lldb_private {
2020
class StopInfo : public std::enable_shared_from_this<StopInfo> {
2121
friend class Process::ProcessEventData;
2222
friend class ThreadPlanBase;
23-
friend class ThreadPlanReverseContinue;
2423

2524
public:
2625
// Constructors and Destructors
@@ -155,12 +154,6 @@ class StopInfo : public std::enable_shared_from_this<StopInfo> {
155154
static lldb::StopInfoSP
156155
CreateStopReasonProcessorTrace(Thread &thread, const char *description);
157156

158-
// This creates a StopInfo indicating that execution stopped because
159-
// it was replaying some recorded execution history, and execution reached
160-
// the end of that recorded history.
161-
static lldb::StopInfoSP
162-
CreateStopReasonHistoryBoundary(Thread &thread, const char *description);
163-
164157
static lldb::StopInfoSP CreateStopReasonFork(Thread &thread,
165158
lldb::pid_t child_pid,
166159
lldb::tid_t child_tid);

lldb/include/lldb/Target/Thread.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,14 @@ class Thread : public std::enable_shared_from_this<Thread>,
200200
/// The User resume state for this thread.
201201
lldb::StateType GetResumeState() const { return m_resume_state; }
202202

203-
// This function is called to determine whether the thread needs to
204-
// step over a breakpoint and if so, push a step-over-breakpoint thread
205-
// plan.
203+
/// This function is called on all the threads before "ShouldResume" and
204+
/// "WillResume" in case a thread needs to change its state before the
205+
/// ThreadList polls all the threads to figure out which ones actually will
206+
/// get to run and how.
206207
///
207208
/// \return
208209
/// True if we pushed a ThreadPlanStepOverBreakpoint
209-
bool SetupToStepOverBreakpointIfNeeded(lldb::RunDirection direction);
210+
bool SetupForResume();
210211

211212
// Do not override this function, it is for thread plan logic only
212213
bool ShouldResume(lldb::StateType resume_state);

lldb/include/lldb/Target/ThreadList.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,14 @@ class ThreadList : public ThreadCollection {
115115
/// If a thread can "resume" without having to resume the target, it
116116
/// will return false for WillResume, and then the process will not be
117117
/// restarted.
118-
/// Sets *direction to the run direction of the thread(s) that will
119-
/// be resumed. If threads that we want to run disagree about the
120-
/// direction, we execute forwards and pop any of the thread plans
121-
/// that requested reverse execution.
122118
///
123119
/// \return
124120
/// \b true instructs the process to resume normally,
125121
/// \b false means start & stopped events will be generated, but
126122
/// the process will not actually run. The thread must then return
127123
/// the correct StopInfo when asked.
128124
///
129-
bool WillResume(lldb::RunDirection &direction);
125+
bool WillResume();
130126

131127
void DidResume();
132128

lldb/include/lldb/Target/ThreadPlan.h

-13
Original file line numberDiff line numberDiff line change
@@ -283,15 +283,6 @@ namespace lldb_private {
283283
// report_run_vote argument to the constructor works like report_stop_vote, and
284284
// is a way for a plan to instruct a sub-plan on how to respond to
285285
// ShouldReportStop.
286-
//
287-
// Reverse execution:
288-
//
289-
// Every thread plan has an associated RunDirection (forward or backward).
290-
// For ThreadPlanBase, this direction is the Process's base direction.
291-
// Whenever we resume the target, we need to ensure that the topmost thread
292-
// plans for each runnable thread all agree on their direction. This is
293-
// ensured in ThreadList::WillResume(), which chooses a direction and then
294-
// discards thread plans incompatible with that direction.
295286

296287
class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
297288
public UserID {
@@ -506,10 +497,6 @@ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
506497

507498
virtual lldb::StateType GetPlanRunState() = 0;
508499

509-
virtual lldb::RunDirection GetDirection() const {
510-
return lldb::RunDirection::eRunForward;
511-
}
512-
513500
protected:
514501
// Constructors and Destructors
515502
ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread,

lldb/include/lldb/Target/ThreadPlanBase.h

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ class ThreadPlanBase : public ThreadPlan {
3838

3939
bool IsBasePlan() override { return true; }
4040

41-
lldb::RunDirection GetDirection() const override;
42-
4341
protected:
4442
bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
4543
bool DoPlanExplainsStop(Event *event_ptr) override;

lldb/include/lldb/lldb-enumerations.h

-6
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ FLAGS_ENUM(LaunchFlags){
135135
/// Thread Run Modes.
136136
enum RunMode { eOnlyThisThread, eAllThreads, eOnlyDuringStepping };
137137

138-
/// Execution directions
139-
enum RunDirection { eRunForward, eRunReverse };
140-
141138
/// Byte ordering definitions.
142139
enum ByteOrder {
143140
eByteOrderInvalid = 0,
@@ -257,9 +254,6 @@ enum StopReason {
257254
eStopReasonVFork,
258255
eStopReasonVForkDone,
259256
eStopReasonInterrupt, ///< Thread requested interrupt
260-
// Indicates that execution stopped because the debugger backend relies
261-
// on recorded data and we reached the end of that data.
262-
eStopReasonHistoryBoundary,
263257
};
264258

265259
/// Command Return Status Types.

lldb/packages/Python/lldbsuite/test/gdbclientutils.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,8 @@ def start(self):
510510
self._thread.start()
511511

512512
def stop(self):
513-
if self._thread is not None:
514-
self._thread.join()
515-
self._thread = None
513+
self._thread.join()
514+
self._thread = None
516515

517516
def get_connect_address(self):
518517
return self._socket.get_connect_address()

lldb/packages/Python/lldbsuite/test/lldbgdbproxy.py

-175
This file was deleted.

0 commit comments

Comments
 (0)