Revert "[platform process list] add a flag for showing the processes of all users"

This reverts commit 90d0de4999354a5223f08ad714222b0a5dca3cad.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@374625 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py
deleted file mode 100644
index 338d27d..0000000
--- a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestPlatformClient.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import lldb
-import binascii
-import os
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test.decorators import *
-from gdbclientutils import *
-
-
-class TestPlatformClient(GDBRemoteTestBase):
-
-    def test_process_list_with_all_users(self):
-        """Test connecting to a remote linux platform"""
-
-        self.runCmd("log enable gdb-remote all")
-        self.runCmd("platform select remote-linux")
-
-        try:
-            self.runCmd("platform connect connect://localhost:%d" %
-                        self.server.port)
-            self.assertTrue(self.dbg.GetSelectedPlatform().IsConnected())
-            self.expect("platform process list -x",
-                        substrs=["1 matching process was found", "test_process"])
-            self.expect("platform process list",
-                        error=True,
-                        substrs=["error: no processes were found on the \"remote-linux\" platform"])
-        finally:
-            self.dbg.GetSelectedPlatform().DisconnectRemote()
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
index 94129c0..621279a 100644
--- a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
@@ -3,8 +3,6 @@
 import threading
 import socket
 import lldb
-import binascii
-import traceback
 from lldbsuite.support import seven
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbtest_config
@@ -162,37 +160,9 @@
             return self.QListThreadsInStopReply()
         if packet.startswith("qMemoryRegionInfo:"):
             return self.qMemoryRegionInfo()
-        if packet == "qQueryGDBServer":
-            return self.qQueryGDBServer()
-        if packet == "qHostInfo":
-            return self.qHostInfo()
-        if packet == "qGetWorkingDir":
-            return self.qGetWorkingDir()
-        if packet == "qsProcessInfo":
-            return self.qsProcessInfo()
-        if packet.startswith("qfProcessInfo"):
-            return self.qfProcessInfo(packet)
 
         return self.other(packet)
 
-    def qsProcessInfo(self):
-        return "E04"
-
-    def qfProcessInfo(self, packet):
-        if "all_users:1" in packet:
-            return "pid:10;ppid:1;uid:1;gid:1;euid:1;egid:1;name:" + binascii.hexlify("/a/test_process") + ";"
-        else:
-            return "E04"
-
-    def qGetWorkingDir(self):
-        return "2f"
-
-    def qHostInfo(self):
-        return "ptrsize:8;endian:little;"
-
-    def qQueryGDBServer(self):
-        return "E04"
-
     def interrupt(self):
         raise self.UnexpectedPacketException()
 
@@ -201,7 +171,7 @@
 
     def vCont(self, packet):
         raise self.UnexpectedPacketException()
-
+    
     def readRegisters(self):
         return "00000000" * self.registerCount
 
@@ -345,8 +315,6 @@
                     break
                 self._receive(data)
             except Exception as e:
-                print("An exception happened when receiving the response from the gdb server. Closing the client...")
-                traceback.print_exc()
                 self._client.close()
                 break
 
@@ -457,6 +425,7 @@
     class InvalidPacketException(Exception):
         pass
 
+
 class GDBRemoteTestBase(TestBase):
     """
     Base class for GDB client tests.
diff --git a/source/Commands/CommandObjectPlatform.cpp b/source/Commands/CommandObjectPlatform.cpp
index fbd13aa..7fb3783 100644
--- a/source/Commands/CommandObjectPlatform.cpp
+++ b/source/Commands/CommandObjectPlatform.cpp
@@ -1264,10 +1264,6 @@
         verbose = true;
         break;
 
-      case 'x':
-        match_info.SetMatchAllUsers(true);
-        break;
-
       default:
         llvm_unreachable("Unimplemented option");
       }
diff --git a/source/Commands/Options.td b/source/Commands/Options.td
index 87f5506..477b553 100644
--- a/source/Commands/Options.td
+++ b/source/Commands/Options.td
@@ -591,9 +591,6 @@
   def platform_process_list_show_args : Option<"show-args", "A">,
     GroupRange<1, 6>,
     Desc<"Show process arguments instead of the process executable basename.">;
-  def platform_process_list_all_users: Option<"all-users", "x">,
-    GroupRange<1,6>,
-    Desc<"Show processes matching all user IDs.">;
   def platform_process_list_verbose : Option<"verbose", "v">, GroupRange<1, 6>,
     Desc<"Enable verbose output.">;
 }
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index f6ef457..51e3133 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2176,7 +2176,8 @@
       if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
         packet.Printf("egid:%u;",
                       match_info.GetProcessInfo().GetEffectiveGroupID());
-      packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
+      if (match_info.GetProcessInfo().EffectiveGroupIDIsValid())
+        packet.Printf("all_users:%u;", match_info.GetMatchAllUsers() ? 1 : 0);
       if (match_info.GetProcessInfo().GetArchitecture().IsValid()) {
         const ArchSpec &match_arch =
             match_info.GetProcessInfo().GetArchitecture();