Skip to content

Commit 8f7f4aa

Browse files
DavidSpickettIanWood1
authored andcommitted
[lldb] Fix error that lead Windows to think it could reverse execute (llvm#137351)
The new test added in llvm#132783 was failing on Windows because it created a new error to say it did not support the feature, but then returned the existing, default constructed error. Which was a success value. This also changes the GDBRemote error message to the same phrasing used in all the other places so we don't have to special case any platform.
1 parent 9ae8142 commit 8f7f4aa

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid,
239239
Status ProcessWindows::DoResume(RunDirection direction) {
240240
Log *log = GetLog(WindowsLog::Process);
241241
llvm::sys::ScopedLock lock(m_mutex);
242-
Status error;
243242

244243
if (direction == RunDirection::eRunReverse) {
245-
error.FromErrorStringWithFormatv(
244+
return Status::FromErrorStringWithFormatv(
246245
"error: {0} does not support reverse execution of processes",
247246
GetPluginName());
248-
return error;
249247
}
250248

249+
Status error;
250+
251251
StateType private_state = GetPrivateState();
252252
if (private_state == eStateStopped || private_state == eStateCrashed) {
253253
LLDB_LOG(log, "process {0} is in state {1}. Resuming...",

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ Status ProcessGDBRemote::DoResume(RunDirection direction) {
14101410
LLDB_LOGF(log, "ProcessGDBRemote::DoResume: target does not "
14111411
"support reverse-continue");
14121412
return Status::FromErrorString(
1413-
"target does not support reverse-continue");
1413+
"target does not support reverse execution of processes");
14141414
}
14151415
14161416
if (num_continue_C_tids > 0) {

lldb/test/API/commands/process/reverse-continue/TestReverseContinueNotSupported.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212

1313
class TestReverseContinueNotSupported(TestBase):
14-
@skipIfWindows
1514
def test_reverse_continue_not_supported(self):
1615
target = self.connect()
1716

@@ -26,7 +25,9 @@ def test_reverse_continue_not_supported(self):
2625
self.expect(
2726
"process continue --reverse",
2827
error=True,
29-
substrs=["target does not support reverse-continue"],
28+
# This error is "<plugin name> does not support...". The plugin name changes
29+
# between platforms.
30+
substrs=["does not support reverse execution of processes"],
3031
)
3132

3233
def test_reverse_continue_forward_and_reverse(self):

0 commit comments

Comments
 (0)