Move several plugin to its own namespace

Affected paths:
* Plugins/Platform/Android/*
* Plugins/Platform/Linux/*
* Plugins/Platform/gdb-server/*
* Plugins/Process/Linux/*
* Plugins/Process/gdb-remote/*

Differential revision: http://reviews.llvm.org/D8654

llvm-svn: 233679
diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
index 78668e6..e3b72ef 100644
--- a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
+++ b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp
@@ -15,6 +15,7 @@
 
 using namespace lldb;
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 //------------------------------------------------------------------------------
 // Constructors and destructors.
diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.h b/lldb/source/Plugins/Process/Linux/LinuxThread.h
index 991950a..4a196f0 100644
--- a/lldb/source/Plugins/Process/Linux/LinuxThread.h
+++ b/lldb/source/Plugins/Process/Linux/LinuxThread.h
@@ -13,18 +13,20 @@
 // Other libraries and framework includes
 #include "Plugins/Process/POSIX/POSIXThread.h"
 
+namespace lldb_private {
+namespace process_linux {
+
 //------------------------------------------------------------------------------
 // @class LinuxThread
 // @brief Abstraction of a Linux thread.
-class LinuxThread
-    : public POSIXThread
+class LinuxThread : public POSIXThread
 {
 public:
 
     //------------------------------------------------------------------
     // Constructors and destructors
     //------------------------------------------------------------------
-    LinuxThread(lldb_private::Process &process, lldb::tid_t tid);
+    LinuxThread(Process &process, lldb::tid_t tid);
 
     virtual ~LinuxThread();
 
@@ -36,4 +38,7 @@
     RefreshStateAfterStop() override;
 };
 
+} // namespace process_linux
+} // namespace lldb_private
+
 #endif // #ifndef liblldb_LinuxThread_H_
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 410ad53..0dfee5e 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -138,6 +138,7 @@
 
 using namespace lldb;
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 using namespace llvm;
 
 // Private bits we only need internally.
@@ -178,7 +179,7 @@
         // Grab process info for the running process.
         ProcessInstanceInfo process_info;
         if (!platform.GetProcessInfo (pid, process_info))
-            return lldb_private::Error("failed to get process info");
+            return Error("failed to get process info");
 
         // Resolve the executable module.
         ModuleSP exe_module_sp;
@@ -201,7 +202,7 @@
     }
 
     void
-    DisplayBytes (lldb_private::StreamString &s, void *bytes, uint32_t count)
+    DisplayBytes (StreamString &s, void *bytes, uint32_t count)
     {
         uint8_t *ptr = (uint8_t *)bytes;
         const uint32_t loop_count = std::min<uint32_t>(DEBUG_PTRACE_MAXBYTES, count);
@@ -631,7 +632,7 @@
             PTRACE(PTRACE_GETREGSET, m_tid, &regset, &ioVec, sizeof regs, m_error);
             if (m_error.Success())
             {
-                lldb_private::ArchSpec arch;
+                ArchSpec arch;
                 if (monitor->GetArchitecture(arch))
                     m_value.SetBytes((void *)(((unsigned char *)(&regs)) + offset), 16, arch.GetByteOrder());
                 else
@@ -649,7 +650,7 @@
             PTRACE(PTRACE_GETREGSET, m_tid, &regset, &ioVec, sizeof regs, m_error);
             if (m_error.Success())
             {
-                lldb_private::ArchSpec arch;
+                ArchSpec arch;
                 if (monitor->GetArchitecture(arch))
                     m_value.SetBytes((void *)(((unsigned char *)(regs)) + m_offset), 8, arch.GetByteOrder());
                 else
@@ -1086,14 +1087,14 @@
 }
 
 NativeProcessLinux::LaunchArgs::LaunchArgs(NativeProcessLinux *monitor,
-                                       lldb_private::Module *module,
+                                       Module *module,
                                        char const **argv,
                                        char const **envp,
                                        const std::string &stdin_path,
                                        const std::string &stdout_path,
                                        const std::string &stderr_path,
                                        const char *working_dir,
-                                       const lldb_private::ProcessLaunchInfo &launch_info)
+                                       const ProcessLaunchInfo &launch_info)
     : OperationArgs(monitor),
       m_module(module),
       m_argv(argv),
@@ -1120,11 +1121,11 @@
 // Public Static Methods
 // -----------------------------------------------------------------------------
 
-lldb_private::Error
+Error
 NativeProcessLinux::LaunchProcess (
-    lldb_private::Module *exe_module,
-    lldb_private::ProcessLaunchInfo &launch_info,
-    lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+    Module *exe_module,
+    ProcessLaunchInfo &launch_info,
+    NativeProcessProtocol::NativeDelegate &native_delegate,
     NativeProcessProtocolSP &native_process_sp)
 {
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
@@ -1143,7 +1144,7 @@
       }
     }
 
-    const lldb_private::FileAction *file_action;
+    const FileAction *file_action;
 
     // Default of NULL will mean to use existing open file descriptors.
     std::string stdin_path;
@@ -1224,10 +1225,10 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeProcessLinux::AttachToProcess (
     lldb::pid_t pid,
-    lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+    NativeProcessProtocol::NativeDelegate &native_delegate,
     NativeProcessProtocolSP &native_process_sp)
 {
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
@@ -1304,8 +1305,8 @@
     const std::string &stdout_path,
     const std::string &stderr_path,
     const char *working_dir,
-    const lldb_private::ProcessLaunchInfo &launch_info,
-    lldb_private::Error &error)
+    const ProcessLaunchInfo &launch_info,
+    Error &error)
 {
     if (module)
         m_arch = module->GetArchitecture ();
@@ -1363,7 +1364,7 @@
 }
 
 void
-NativeProcessLinux::AttachToInferior (lldb::pid_t pid, lldb_private::Error &error)
+NativeProcessLinux::AttachToInferior (lldb::pid_t pid, Error &error)
 {
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
@@ -1744,7 +1745,7 @@
 }
 
 void
-NativeProcessLinux::StartAttachOpThread(AttachArgs *args, lldb_private::Error &error)
+NativeProcessLinux::StartAttachOpThread(AttachArgs *args, Error &error)
 {
     static const char *g_thread_name = "lldb.process.linux.operation";
 
@@ -3563,7 +3564,7 @@
     return op.GetError();
 }
 
-lldb_private::Error
+Error
 NativeProcessLinux::Detach(lldb::tid_t tid)
 {
     if (tid == LLDB_INVALID_THREAD_ID)
@@ -3960,7 +3961,7 @@
                                                                CoordinatorErrorHandler);
 }
 
-lldb_private::Error
+Error
 NativeProcessLinux::RequestThreadStop (const lldb::pid_t pid, const lldb::tid_t tid)
 {
     Log* log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
index b9aff86..3c597b6 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -27,13 +27,14 @@
 
 #include "lldb/Host/common/NativeProcessProtocol.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
     class Error;
     class Module;
-    class ThreadStateCoordinator;
     class Scalar;
 
+namespace process_linux {
+    class ThreadStateCoordinator;
+
     /// @class NativeProcessLinux
     /// @brief Manages communication with the inferior (debugee) process.
     ///
@@ -45,17 +46,17 @@
     {
     public:
 
-        static lldb_private::Error
+        static Error
         LaunchProcess (
             Module *exe_module,
             ProcessLaunchInfo &launch_info,
-            lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+            NativeProcessProtocol::NativeDelegate &native_delegate,
             NativeProcessProtocolSP &native_process_sp);
 
-        static lldb_private::Error
+        static Error
         AttachToProcess (
             lldb::pid_t pid,
-            lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+            NativeProcessProtocol::NativeDelegate &native_delegate,
             NativeProcessProtocolSP &native_process_sp);
 
         // ---------------------------------------------------------------------
@@ -122,7 +123,7 @@
         /// This method is provided for use by RegisterContextLinux derivatives.
         Error
         ReadRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name,
-                          unsigned size, lldb_private::RegisterValue &value);
+                          unsigned size, RegisterValue &value);
 
         /// Writes the given value to the register identified by the given
         /// (architecture dependent) offset.
@@ -130,7 +131,7 @@
         /// This method is provided for use by RegisterContextLinux derivatives.
         Error
         WriteRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name,
-                           const lldb_private::RegisterValue &value);
+                           const RegisterValue &value);
 
         /// Reads all general purpose registers into the specified buffer.
         Error
@@ -170,23 +171,23 @@
 
     private:
 
-        lldb_private::ArchSpec m_arch;
+        ArchSpec m_arch;
 
         HostThread m_operation_thread;
         HostThread m_monitor_thread;
 
         // current operation which must be executed on the priviliged thread
         void *m_operation;
-        lldb_private::Mutex m_operation_mutex;
+        Mutex m_operation_mutex;
 
         // semaphores notified when Operation is ready to be processed and when
         // the operation is complete.
         sem_t m_operation_pending;
         sem_t m_operation_done;
 
-        lldb_private::LazyBool m_supports_mem_region;
+        LazyBool m_supports_mem_region;
         std::vector<MemoryRegionInfo> m_mem_region_cache;
-        lldb_private::Mutex m_mem_region_cache_mutex;
+        Mutex m_mem_region_cache_mutex;
 
         std::unique_ptr<ThreadStateCoordinator> m_coordinator_up;
         HostThread m_coordinator_thread;
@@ -199,7 +200,7 @@
 
             NativeProcessLinux *m_monitor;      // The monitor performing the attach.
             sem_t m_semaphore;              // Posted to once operation complete.
-            lldb_private::Error m_error;    // Set if process operation failed.
+            Error m_error;    // Set if process operation failed.
         };
 
         /// @class LauchArgs
@@ -209,25 +210,25 @@
         struct LaunchArgs : OperationArgs
         {
             LaunchArgs(NativeProcessLinux *monitor,
-                    lldb_private::Module *module,
+                    Module *module,
                     char const **argv,
                     char const **envp,
                     const std::string &stdin_path,
                     const std::string &stdout_path,
                     const std::string &stderr_path,
                     const char *working_dir,
-                    const lldb_private::ProcessLaunchInfo &launch_info);
+                    const ProcessLaunchInfo &launch_info);
 
             ~LaunchArgs();
 
-            lldb_private::Module *m_module; // The executable image to launch.
-            char const **m_argv;            // Process arguments.
-            char const **m_envp;            // Process environment.
+            Module *m_module;                 // The executable image to launch.
+            char const **m_argv;              // Process arguments.
+            char const **m_envp;              // Process environment.
             const std::string &m_stdin_path;  // Redirect stdin if not empty.
             const std::string &m_stdout_path; // Redirect stdout if not empty.
             const std::string &m_stderr_path; // Redirect stderr if not empty.
-            const char *m_working_dir;      // Working directory or NULL.
-            const lldb_private::ProcessLaunchInfo &m_launch_info;
+            const char *m_working_dir;        // Working directory or NULL.
+            const ProcessLaunchInfo &m_launch_info;
         };
 
         struct AttachArgs : OperationArgs
@@ -256,7 +257,7 @@
             const std::string &stdout_path,
             const std::string &stderr_path,
             const char *working_dir,
-            const lldb_private::ProcessLaunchInfo &launch_info,
+            const ProcessLaunchInfo &launch_info,
             Error &error);
 
         /// Attaches to an existing process.  Forms the
@@ -265,7 +266,7 @@
         AttachToInferior (lldb::pid_t pid, Error &error);
 
         void
-        StartLaunchOpThread(LaunchArgs *args, lldb_private::Error &error);
+        StartLaunchOpThread(LaunchArgs *args, Error &error);
 
         static void *
         LaunchOpThread(void *arg);
@@ -274,7 +275,7 @@
         Launch(LaunchArgs *args);
 
         void
-        StartAttachOpThread(AttachArgs *args, lldb_private::Error &error);
+        StartAttachOpThread(AttachArgs *args, Error &error);
 
         static void *
         AttachOpThread(void *args);
@@ -412,12 +413,14 @@
                                                 lldb::tid_t skip_stop_request_tid,
                                                 const std::function<void (lldb::tid_t tid)> &call_after_function);
 
-        lldb_private::Error
+        Error
         Detach(lldb::tid_t tid);
 
-        lldb_private::Error
+        Error
         RequestThreadStop (const lldb::pid_t pid, const lldb::tid_t tid);
     };
-} // End lldb_private namespace.
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef liblldb_NativeProcessLinux_H_
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index 257ab05..faf5042 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -21,6 +21,7 @@
 
 using namespace lldb;
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 // ARM64 general purpose registers.
 static const uint32_t g_gpr_regnums_arm64[] =
@@ -115,7 +116,7 @@
 }
 
 // Register sets for ARM64.
-static const lldb_private::RegisterSet
+static const RegisterSet
 g_reg_sets_arm64[k_num_register_sets] =
 {
     { "General Purpose Registers",  "gpr", k_num_gpr_registers_arm64, g_gpr_regnums_arm64 },
@@ -156,7 +157,7 @@
     return k_num_register_sets;
 }
 
-const lldb_private::RegisterSet *
+const RegisterSet *
 NativeRegisterContextLinux_arm64::GetRegisterSet (uint32_t set_index) const
 {
     if (set_index < k_num_register_sets)
@@ -165,7 +166,7 @@
     return nullptr;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value)
 {
     Error error;
@@ -236,7 +237,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value)
 {
     if (!reg_info)
@@ -281,12 +282,12 @@
     return Error ("failed - register wasn't recognized to be a GPR or an FPR, write strategy unknown");
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
 {
     Error error;
 
-    data_sp.reset (new lldb_private::DataBufferHeap (REG_CONTEXT_SIZE, 0));
+    data_sp.reset (new DataBufferHeap (REG_CONTEXT_SIZE, 0));
     if (!data_sp)
         return Error ("failed to allocate DataBufferHeap instance of size %" PRIu64, REG_CONTEXT_SIZE);
 
@@ -316,7 +317,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)
 {
     Error error;
@@ -360,7 +361,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::WriteRegisterRaw (uint32_t reg_index, const RegisterValue &reg_value)
 {
     Error error;
@@ -430,7 +431,7 @@
                                          value_to_write);
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_arm64::ReadRegisterRaw (uint32_t reg_index, RegisterValue &reg_value)
 {
     Error error;
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index 92e0238..d64f5d1 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -14,8 +14,9 @@
 #include "lldb/Host/common/NativeRegisterContextRegisterInfo.h"
 #include "Plugins/Process/Utility/lldb-arm64-register-enums.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class NativeProcessLinux;
 
     class NativeRegisterContextLinux_arm64 : public NativeRegisterContextRegisterInfo
@@ -74,7 +75,7 @@
             uint32_t    fpcr;
         };
 
-        uint64_t m_gpr_arm64[lldb_private::k_num_gpr_registers_arm64]; // 64-bit general purpose registers.
+        uint64_t m_gpr_arm64[k_num_gpr_registers_arm64]; // 64-bit general purpose registers.
         RegInfo  m_reg_info;
         FPU m_fpr; // floating-point registers including extended register sets.
 
@@ -96,10 +97,10 @@
         bool
         WriteFPR ();
 
-        lldb_private::Error
+        Error
         ReadRegisterRaw (uint32_t reg_index, RegisterValue &reg_value);
 
-        lldb_private::Error
+        Error
         WriteRegisterRaw (uint32_t reg_index, const RegisterValue &reg_value);
 
         lldb::ByteOrder
@@ -108,7 +109,9 @@
         size_t
         GetGPRSize() const;
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef lldb_NativeRegisterContextLinux_arm64_h
 
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
index 3d798e6..0e4da37 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -18,6 +18,7 @@
 #include "Plugins/Process/Linux/NativeProcessLinux.h"
 
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 // ----------------------------------------------------------------------------
 // Private namespace.
@@ -103,7 +104,7 @@
     return k_num_register_sets;
 }
 
-const lldb_private::RegisterSet *
+const RegisterSet *
 NativeRegisterContextLinux_mips64::GetRegisterSet (uint32_t set_index) const
 {
     if (set_index >= k_num_register_sets)
@@ -122,7 +123,7 @@
     return nullptr;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_mips64::ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value)
 {
     Error error;
@@ -130,7 +131,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_mips64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value)
 {
     Error error;
@@ -138,7 +139,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_mips64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
 {
     Error error;
@@ -146,7 +147,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_mips64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)
 {
     Error error;
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
index 35218b7..a801406 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
@@ -15,57 +15,59 @@
 #include "Plugins/Process/Utility/RegisterContext_mips64.h"
 #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h"
 
-// ---------------------------------------------------------------------------
-// Internal codes for mips64 GP registers.
-// ---------------------------------------------------------------------------
-enum
-{
-    k_first_gp_reg_mips64,
-    gp_reg_r0_mips64 = k_first_gp_reg_mips64,
-    gp_reg_r1_mips64,
-    gp_reg_r2_mips64,
-    gp_reg_r3_mips64,
-    gp_reg_r4_mips64,
-    gp_reg_r5_mips64,
-    gp_reg_r6_mips64,
-    gp_reg_r7_mips64,
-    gp_reg_r8_mips64,
-    gp_reg_r9_mips64,
-    gp_reg_r10_mips64,
-    gp_reg_r11_mips64,
-    gp_reg_r12_mips64,
-    gp_reg_r13_mips64,
-    gp_reg_r14_mips64,
-    gp_reg_r15_mips64,
-    gp_reg_r16_mips64,
-    gp_reg_r17_mips64,
-    gp_reg_r18_mips64,
-    gp_reg_r19_mips64,
-    gp_reg_r20_mips64,
-    gp_reg_r21_mips64,
-    gp_reg_r22_mips64,
-    gp_reg_r23_mips64,
-    gp_reg_r24_mips64,
-    gp_reg_r25_mips64,
-    gp_reg_r26_mips64,
-    gp_reg_r27_mips64,
-    gp_reg_r28_mips64,
-    gp_reg_r29_mips64,
-    gp_reg_r30_mips64,
-    gp_reg_r31_mips64,
-    gp_reg_mullo_mips64,
-    gp_reg_mulhi_mips64,
-    gp_reg_pc_mips64,
-    gp_reg_badvaddr_mips64,
-    gp_reg_sr_mips64,
-    gp_reg_cause_mips64,
-    k_num_gp_reg_mips64,
-};
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class NativeProcessLinux;
 
+    // ---------------------------------------------------------------------------
+    // Internal codes for mips64 GP registers.
+    // ---------------------------------------------------------------------------
+    enum
+    {
+        k_first_gp_reg_mips64,
+        gp_reg_r0_mips64 = k_first_gp_reg_mips64,
+        gp_reg_r1_mips64,
+        gp_reg_r2_mips64,
+        gp_reg_r3_mips64,
+        gp_reg_r4_mips64,
+        gp_reg_r5_mips64,
+        gp_reg_r6_mips64,
+        gp_reg_r7_mips64,
+        gp_reg_r8_mips64,
+        gp_reg_r9_mips64,
+        gp_reg_r10_mips64,
+        gp_reg_r11_mips64,
+        gp_reg_r12_mips64,
+        gp_reg_r13_mips64,
+        gp_reg_r14_mips64,
+        gp_reg_r15_mips64,
+        gp_reg_r16_mips64,
+        gp_reg_r17_mips64,
+        gp_reg_r18_mips64,
+        gp_reg_r19_mips64,
+        gp_reg_r20_mips64,
+        gp_reg_r21_mips64,
+        gp_reg_r22_mips64,
+        gp_reg_r23_mips64,
+        gp_reg_r24_mips64,
+        gp_reg_r25_mips64,
+        gp_reg_r26_mips64,
+        gp_reg_r27_mips64,
+        gp_reg_r28_mips64,
+        gp_reg_r29_mips64,
+        gp_reg_r30_mips64,
+        gp_reg_r31_mips64,
+        gp_reg_mullo_mips64,
+        gp_reg_mulhi_mips64,
+        gp_reg_pc_mips64,
+        gp_reg_badvaddr_mips64,
+        gp_reg_sr_mips64,
+        gp_reg_cause_mips64,
+        k_num_gp_reg_mips64,
+    };
+
     class NativeRegisterContextLinux_mips64 : public NativeRegisterContextRegisterInfo
     {
     public:
@@ -116,7 +118,9 @@
         uint32_t
         NumSupportedHardwareWatchpoints () override;
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef lldb_NativeRegisterContextLinux_mips64_h
 
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index 06ad5f2..588d60c 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -19,6 +19,7 @@
 #include "Plugins/Process/Linux/NativeProcessLinux.h"
 
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 // ----------------------------------------------------------------------------
 // Private namespace.
@@ -415,14 +416,14 @@
     uint32_t count = 0;
     for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index)
     {
-        const lldb_private::RegisterSet* set = GetRegisterSet(set_index);
+        const RegisterSet* set = GetRegisterSet(set_index);
         if (set)
             count += set->num_registers;
     }
     return count;
 }
 
-const lldb_private::RegisterSet *
+const RegisterSet *
 NativeRegisterContextLinux_x86_64::GetRegisterSet (uint32_t set_index) const
 {
     if (!IsRegisterSetAvailable (set_index))
@@ -442,7 +443,7 @@
     return nullptr;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::ReadRegisterRaw (uint32_t reg_index, RegisterValue &reg_value)
 {
     Error error;
@@ -468,7 +469,7 @@
                                         reg_value);
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::ReadRegister (const RegisterInfo *reg_info, RegisterValue &reg_value)
 {
     Error error;
@@ -579,7 +580,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::WriteRegister(const uint32_t reg,
                                                  const RegisterValue &value)
 {
@@ -651,7 +652,7 @@
                                          value_to_write);
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue &reg_value)
 {
     assert (reg_info && "reg_info is null");
@@ -722,7 +723,7 @@
     return Error ("failed - register wasn't recognized to be a GPR or an FPR, write strategy unknown");
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp)
 {
     Error error;
@@ -783,7 +784,7 @@
     return error;
 }
 
-lldb_private::Error
+Error
 NativeRegisterContextLinux_x86_64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)
 {
     Error error;
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
index e183118..e8c7c65 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
@@ -15,8 +15,9 @@
 #include "Plugins/Process/Utility/RegisterContext_x86.h"
 #include "Plugins/Process/Utility/lldb-x86-register-enums.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class NativeProcessLinux;
 
     class NativeRegisterContextLinux_x86_64 : public NativeRegisterContextRegisterInfo
@@ -118,7 +119,7 @@
         uint64_t m_gpr_x86_64[k_num_gpr_registers_x86_64];
 
         // Private member methods.
-        lldb_private::Error
+        Error
         WriteRegister(const uint32_t reg, const RegisterValue &value);
 
         bool IsRegisterSetAvailable (uint32_t set_index) const;
@@ -152,7 +153,7 @@
         bool
         ReadFPR ();
 
-        lldb_private::Error
+        Error
         ReadRegisterRaw (uint32_t reg_index, RegisterValue &reg_value);
 
         bool
@@ -161,7 +162,9 @@
         bool
         WriteGPR();
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef lldb_NativeRegisterContextLinux_x86_64_h
 
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index 38dd025..240803a 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -37,6 +37,7 @@
 
 using namespace lldb;
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 namespace
 {
@@ -157,7 +158,7 @@
     llvm_unreachable("unhandled StateType!");
 }
 
-lldb_private::NativeRegisterContextSP
+NativeRegisterContextSP
 NativeThreadLinux::GetRegisterContext ()
 {
     // Return the register context if we already created it.
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
index 7f563d8..4170fd9 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h
@@ -16,8 +16,9 @@
 #include <map>
 #include <string>
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class NativeProcessLinux;
 
     class NativeThreadLinux : public NativeThreadProtocol
@@ -113,6 +114,8 @@
         using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>;
         WatchpointIndexMap m_watchpoint_index_map;
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef liblldb_NativeThreadLinux_H_
diff --git a/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp b/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp
index 6b259fd..4d1f231 100644
--- a/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp
@@ -23,8 +23,11 @@
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/Error.h"
 
+using namespace lldb_private;
+using namespace lldb_private::process_linux;
+
 lldb::DataBufferSP
-lldb_private::ProcFileReader::ReadIntoDataBuffer (lldb::pid_t pid, const char *name)
+ProcFileReader::ReadIntoDataBuffer (lldb::pid_t pid, const char *name)
 {
     int fd;
     char path[PATH_MAX];
@@ -73,10 +76,10 @@
     return buf_sp;
 }
 
-lldb_private::Error
-lldb_private::ProcFileReader::ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser)
+Error
+ProcFileReader::ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser)
 {
-    lldb_private::Error error;
+    Error error;
 
     // Try to open the /proc/{pid}/maps entry.
     char filename [PATH_MAX];
diff --git a/lldb/source/Plugins/Process/Linux/ProcFileReader.h b/lldb/source/Plugins/Process/Linux/ProcFileReader.h
index dfd77d3..7b38124 100644
--- a/lldb/source/Plugins/Process/Linux/ProcFileReader.h
+++ b/lldb/source/Plugins/Process/Linux/ProcFileReader.h
@@ -15,8 +15,9 @@
 #include "lldb/lldb-forward.h"
 #include "lldb/lldb-types.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class ProcFileReader
     {
     public:
@@ -26,9 +27,11 @@
 
         /// Parse the /proc/{@a pid}/{@a name} file line by line, passing each line to line_parser, until
         /// either end of file or until line_parser returns false.
-        static lldb_private::Error
+        static Error
         ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser);
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif // #ifndef liblldb_ProcFileReader_h_
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
index d635284..bc9e68a 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp
@@ -29,6 +29,7 @@
 
 using namespace lldb;
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 namespace
 {
@@ -224,7 +225,7 @@
 
     // If we're using llgs for local debugging, we must not say that this process
     // is used for debugging.
-    if (PlatformLinux::UseLlgsForLocalDebugging ())
+    if (platform_linux::PlatformLinux::UseLlgsForLocalDebugging ())
         return false;
 
     return ProcessPOSIX::CanDebug(target, plugin_specified_by_name);
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
index 1d332af..1d8232d 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h
@@ -22,17 +22,19 @@
 
 class ProcessMonitor;
 
-class ProcessLinux :
-    public ProcessPOSIX
+namespace lldb_private {
+namespace process_linux {
+
+class ProcessLinux : public ProcessPOSIX
 {
 public:
     //------------------------------------------------------------------
     // Static functions.
     //------------------------------------------------------------------
     static lldb::ProcessSP
-    CreateInstance(lldb_private::Target& target,
-                   lldb_private::Listener &listener,
-                   const lldb_private::FileSpec *);
+    CreateInstance(Target& target,
+                   Listener &listener,
+                   const FileSpec *);
 
     static void
     Initialize();
@@ -40,7 +42,7 @@
     static void
     Terminate();
 
-    static lldb_private::ConstString
+    static ConstString
     GetPluginNameStatic();
 
     static const char *
@@ -49,41 +51,41 @@
     //------------------------------------------------------------------
     // Constructors and destructors
     //------------------------------------------------------------------
-    ProcessLinux(lldb_private::Target& target,
-                 lldb_private::Listener &listener,
-                 lldb_private::FileSpec *core_file);
+    ProcessLinux(Target& target,
+                 Listener &listener,
+                 FileSpec *core_file);
 
-    lldb_private::Error
+    Error
     DoDetach(bool keep_stopped) override;
 
     bool
     DetachRequiresHalt() override { return true; }
 
     bool
-    UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override;
+    UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) override;
 
     //------------------------------------------------------------------
     // PluginInterface protocol
     //------------------------------------------------------------------
-    lldb_private::ConstString
+    ConstString
     GetPluginName() override;
 
     uint32_t
     GetPluginVersion() override;
 
     virtual void
-    GetPluginCommandHelp(const char *command, lldb_private::Stream *strm);
+    GetPluginCommandHelp(const char *command, Stream *strm);
 
-    virtual lldb_private::Error
-    ExecutePluginCommand(lldb_private::Args &command,
-                         lldb_private::Stream *strm);
+    virtual Error
+    ExecutePluginCommand(Args &command,
+                         Stream *strm);
 
-    virtual lldb_private::Log *
-    EnablePluginLogging(lldb_private::Stream *strm,
-                        lldb_private::Args &command);
+    virtual Log *
+    EnablePluginLogging(Stream *strm,
+                        Args &command);
 
     bool
-    CanDebug(lldb_private::Target &target, bool plugin_specified_by_name) override;
+    CanDebug(Target &target, bool plugin_specified_by_name) override;
 
     //------------------------------------------------------------------
     // ProcessPOSIX overrides
@@ -92,14 +94,17 @@
     StopAllThreads(lldb::tid_t stop_tid) override;
 
     POSIXThread *
-    CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid) override;
+    CreateNewPOSIXThread(Process &process, lldb::tid_t tid) override;
 
 private:
 
-    lldb_private::FileSpec *m_core_file;
+    FileSpec *m_core_file;
 
     // Flag to avoid recursion when stopping all threads.
     bool m_stopping_threads;
 };
 
+} // namespace process_linux
+} // namespace lldb_private
+
 #endif  // liblldb_ProcessLinux_H_
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index dff4e8d..4b29a09 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -92,6 +92,7 @@
     syscall(SYS_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), sig)
 
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 static Operation* EXIT_OPERATION = nullptr;
 
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
index 0543e93..9b4baf7 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h
@@ -20,14 +20,20 @@
 #include "lldb/Host/HostThread.h"
 #include "lldb/Host/Mutex.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
+
 class Error;
 class Module;
 class Scalar;
-} // End lldb_private namespace.
+
+namespace process_linux {
 
 class ProcessLinux;
+
+} // namespace process_linux
+
+} // namespace lldb_private
+
 class Operation;
 
 /// @class ProcessMonitor
@@ -75,7 +81,7 @@
     GetPID() const { return m_pid; }
 
     /// Returns the process associated with this ProcessMonitor.
-    ProcessLinux &
+    lldb_private::process_linux::ProcessLinux &
     GetProcess() { return *m_process; }
 
     /// Returns a file descriptor to the controlling terminal of the inferior
@@ -195,7 +201,7 @@
     WaitForInitialTIDStop(lldb::tid_t tid);
 
 private:
-    ProcessLinux *m_process;
+    lldb_private::process_linux::ProcessLinux *m_process;
 
     lldb_private::HostThread m_operation_thread;
     lldb_private::HostThread m_monitor_thread;
diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
index 16ba858..da1c33f 100644
--- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
+++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp
@@ -20,6 +20,7 @@
 #include <sstream>
 
 using namespace lldb_private;
+using namespace lldb_private::process_linux;
 
 //===----------------------------------------------------------------------===//
 
diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h
index 67c5f8a..17184f6 100644
--- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h
+++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h
@@ -21,8 +21,9 @@
 
 #include "lldb/Core/Error.h"
 
-namespace lldb_private
-{
+namespace lldb_private {
+namespace process_linux {
+
     class ThreadStateCoordinator
     {
     public:
@@ -229,6 +230,8 @@
 
         bool m_log_event_processing;
     };
-}
+
+} // namespace process_linux
+} // namespace lldb_private
 
 #endif