Skip to content

Commit 892482e

Browse files
Revert "[platform process list] add a flag for showing the processes of all users"
This reverts commit 90d0de4999354a5223f08ad714222b0a5dca3cad. llvm-svn: 374625
1 parent e3250b0 commit 892482e

File tree

5 files changed

+4
-68
lines changed

5 files changed

+4
-68
lines changed

lldb/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

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

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import threading
44
import socket
55
import lldb
6-
import binascii
7-
import traceback
86
from lldbsuite.support import seven
97
from lldbsuite.test.lldbtest import *
108
from lldbsuite.test import lldbtest_config
@@ -162,37 +160,9 @@ def respond(self, packet):
162160
return self.QListThreadsInStopReply()
163161
if packet.startswith("qMemoryRegionInfo:"):
164162
return self.qMemoryRegionInfo()
165-
if packet == "qQueryGDBServer":
166-
return self.qQueryGDBServer()
167-
if packet == "qHostInfo":
168-
return self.qHostInfo()
169-
if packet == "qGetWorkingDir":
170-
return self.qGetWorkingDir()
171-
if packet == "qsProcessInfo":
172-
return self.qsProcessInfo()
173-
if packet.startswith("qfProcessInfo"):
174-
return self.qfProcessInfo(packet)
175163

176164
return self.other(packet)
177165

178-
def qsProcessInfo(self):
179-
return "E04"
180-
181-
def qfProcessInfo(self, packet):
182-
if "all_users:1" in packet:
183-
return "pid:10;ppid:1;uid:1;gid:1;euid:1;egid:1;name:" + binascii.hexlify("/a/test_process") + ";"
184-
else:
185-
return "E04"
186-
187-
def qGetWorkingDir(self):
188-
return "2f"
189-
190-
def qHostInfo(self):
191-
return "ptrsize:8;endian:little;"
192-
193-
def qQueryGDBServer(self):
194-
return "E04"
195-
196166
def interrupt(self):
197167
raise self.UnexpectedPacketException()
198168

@@ -201,7 +171,7 @@ def cont(self):
201171

202172
def vCont(self, packet):
203173
raise self.UnexpectedPacketException()
204-
174+
205175
def readRegisters(self):
206176
return "00000000" * self.registerCount
207177

@@ -345,8 +315,6 @@ def _run(self):
345315
break
346316
self._receive(data)
347317
except Exception as e:
348-
print("An exception happened when receiving the response from the gdb server. Closing the client...")
349-
traceback.print_exc()
350318
self._client.close()
351319
break
352320

@@ -457,6 +425,7 @@ def _handlePacket(self, packet):
457425
class InvalidPacketException(Exception):
458426
pass
459427

428+
460429
class GDBRemoteTestBase(TestBase):
461430
"""
462431
Base class for GDB client tests.

lldb/source/Commands/CommandObjectPlatform.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,6 @@ class CommandObjectPlatformProcessList : public CommandObjectParsed {
12641264
verbose = true;
12651265
break;
12661266

1267-
case 'x':
1268-
match_info.SetMatchAllUsers(true);
1269-
break;
1270-
12711267
default:
12721268
llvm_unreachable("Unimplemented option");
12731269
}

lldb/source/Commands/Options.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,6 @@ let Command = "platform process list" in {
591591
def platform_process_list_show_args : Option<"show-args", "A">,
592592
GroupRange<1, 6>,
593593
Desc<"Show process arguments instead of the process executable basename.">;
594-
def platform_process_list_all_users: Option<"all-users", "x">,
595-
GroupRange<1,6>,
596-
Desc<"Show processes matching all user IDs.">;
597594
def platform_process_list_verbose : Option<"verbose", "v">, GroupRange<1, 6>,
598595
Desc<"Enable verbose output.">;
599596
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,8 @@ uint32_t GDBRemoteCommunicationClient::FindProcesses(
21762176
if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
21772177
packet.Printf("egid:%u;",
21782178
match_info.GetProcessInfo().GetEffectiveGroupID());
2179-
packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
2179+
if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
2180+
packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
21802181
if (match_info.GetProcessInfo().GetArchitecture().IsValid()) {
21812182
const ArchSpec &match_arch =
21822183
match_info.GetProcessInfo().GetArchitecture();

0 commit comments

Comments
 (0)