LLDB now has "Platform" plug-ins. Platform plug-ins are plug-ins that provide
an interface to a local or remote debugging platform. By default each host OS
that supports LLDB should be registering a "default" platform that will be
used unless a new platform is selected. Platforms are responsible for things
such as:
- getting process information by name or by processs ID
- finding platform files. This is useful for remote debugging where there is 
  an SDK with files that might already or need to be cached for debug access.
- getting a list of platform supported architectures in the exact order they
  should be selected. This helps the native x86 platform on MacOSX select the
  correct x86_64/i386 slice from universal binaries.
- Connect to remote platforms for remote debugging
- Resolving an executable including finding an executable inside platform
  specific bundles (macosx uses .app bundles that contain files) and also
  selecting the appropriate slice of universal files for a given platform.

So by default there is always a local platform, but remote platforms can be
connected to. I will soon be adding a new "platform" command that will support
the following commands:
(lldb) platform connect --name machine1 macosx connect://host:port
Connected to "machine1" platform.
(lldb) platform disconnect macosx

This allows LLDB to be well setup to do remote debugging and also once 
connected process listing and finding for things like:
(lldb) process attach --name x<TAB>

The currently selected platform plug-in can now auto complete any available
processes that start with "x". The responsibilities for the platform plug-in
will soon grow and expand.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127286 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
index 464500c..3106e34 100644
--- a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
+++ b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
@@ -269,40 +269,6 @@
     return 1;
 }
 
-void
-ProcessMacOSX::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-    strm->Printf("The following arguments can be supplied to the 'log %s' command:\n", GetShortPluginName());
-    strm->PutCString("\tverbose - enable verbose logging\n");
-    strm->PutCString("\tprocess - enable process logging\n");
-    strm->PutCString("\tthread - enable thread logging\n");
-    strm->PutCString("\texceptions - enable exception logging\n");
-    strm->PutCString("\tdynamic - enable DynamicLoader logging\n");
-    strm->PutCString("\tmemory-calls - enable memory read and write call logging\n");
-    strm->PutCString("\tmemory-data-short - log short memory read and write byte data\n");
-    strm->PutCString("\tmemory-data-long - log all memory read and write byte data\n");
-    strm->PutCString("\tmemory-protections - log memory protection calls\n");
-    strm->PutCString("\tbreakpoints - log breakpoint calls\n");
-    strm->PutCString("\twatchpoints - log watchpoint calls\n");
-    strm->PutCString("\tevents - log event and event queue status\n");
-    strm->PutCString("\tstep - log step related activity\n");
-    strm->PutCString("\ttask - log task functions\n");
-}
-
-Error
-ProcessMacOSX::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-ProcessMacOSX::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
 //----------------------------------------------------------------------
 // Process Control
 //----------------------------------------------------------------------
@@ -2178,10 +2144,10 @@
     }
 }
 
-uint32_t
-ProcessMacOSX::ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids)
-{
-    return Host::ListProcessesMatchingName (name, matches, pids);
-}
+//uint32_t
+//ProcessMacOSX::ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids)
+//{
+//    return Host::ListProcessesMatchingName (name, matches, pids);
+//}
 
 
diff --git a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
index f2ab6cf..85ce151 100644
--- a/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
+++ b/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
@@ -114,8 +114,8 @@
     virtual void
     DidAttach ();
     
-    virtual uint32_t
-    ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids);
+//    virtual uint32_t
+//    ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids);
 
     //------------------------------------------------------------------
     // PluginInterface protocol
@@ -129,15 +129,6 @@
     virtual uint32_t
     GetPluginVersion();
 
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
     //------------------------------------------------------------------
     // Process Control
     //------------------------------------------------------------------
diff --git a/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.cpp b/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.cpp
index 20e3ef7..f73bdde 100644
--- a/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.cpp
+++ b/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.cpp
@@ -68,26 +68,6 @@
 {
     return 1;
 }
-
-void
-ArchDefaultUnwindPlan_x86_64::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-}
-
-Error
-ArchDefaultUnwindPlan_x86_64::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-ArchDefaultUnwindPlan_x86_64::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
 void
 ArchDefaultUnwindPlan_x86_64::Initialize()
 {
@@ -178,25 +158,6 @@
 }
 
 void
-ArchDefaultUnwindPlan_i386::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-}
-
-Error
-ArchDefaultUnwindPlan_i386::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-ArchDefaultUnwindPlan_i386::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
-void
 ArchDefaultUnwindPlan_i386::Initialize()
 {
     PluginManager::RegisterPlugin (GetPluginNameStatic(),
diff --git a/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.h b/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.h
index d3f4b26..a0d315c 100644
--- a/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.h
+++ b/source/Plugins/Process/Utility/ArchDefaultUnwindPlan-x86.h
@@ -53,15 +53,6 @@
     virtual uint32_t
     GetPluginVersion();
     
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
 private:
     ArchDefaultUnwindPlan_x86_64();        // Call CreateInstance instead.
 
@@ -104,15 +95,6 @@
     virtual uint32_t
     GetPluginVersion();
     
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
 private:
     ArchDefaultUnwindPlan_i386();        // Call CreateInstance instead.
 
diff --git a/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp b/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp
index 19eda66..b47f54a 100644
--- a/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp
+++ b/source/Plugins/Process/Utility/ArchVolatileRegs-x86.cpp
@@ -121,25 +121,6 @@
 }
 
 void
-ArchVolatileRegs_x86::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-}
-
-Error
-ArchVolatileRegs_x86::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-ArchVolatileRegs_x86::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
-void
 ArchVolatileRegs_x86::Initialize()
 {
     PluginManager::RegisterPlugin (GetPluginNameStatic(),
diff --git a/source/Plugins/Process/Utility/ArchVolatileRegs-x86.h b/source/Plugins/Process/Utility/ArchVolatileRegs-x86.h
index 516f126..4aa5828 100644
--- a/source/Plugins/Process/Utility/ArchVolatileRegs-x86.h
+++ b/source/Plugins/Process/Utility/ArchVolatileRegs-x86.h
@@ -53,15 +53,6 @@
     virtual uint32_t
     GetPluginVersion();
     
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
 private:
     ArchVolatileRegs_x86(llvm::Triple::ArchType cpu);        // Call CreateInstance instead.
 
diff --git a/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp b/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
index 8f0f7d4..83255e2 100644
--- a/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
+++ b/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.cpp
@@ -880,25 +880,6 @@
 }
 
 void
-UnwindAssemblyProfiler_x86::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-}
-
-Error
-UnwindAssemblyProfiler_x86::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in command are currently supported.");
-    return error;
-}
-
-Log *
-UnwindAssemblyProfiler_x86::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
-void
 UnwindAssemblyProfiler_x86::Initialize()
 {
     PluginManager::RegisterPlugin (GetPluginNameStatic(),
diff --git a/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.h b/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.h
index 2e99ebd..637c504 100644
--- a/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.h
+++ b/source/Plugins/Process/Utility/UnwindAssemblyProfiler-x86.h
@@ -60,15 +60,6 @@
     virtual uint32_t
     GetPluginVersion();
     
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-    
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
 private:
     UnwindAssemblyProfiler_x86(int cpu) : 
           lldb_private::UnwindAssemblyProfiler(), m_cpu(cpu) { } // Call CreateInstance instead.
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index df09bf3..ab6c915 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -164,26 +164,6 @@
 }
 
 void
-ProcessGDBRemote::GetPluginCommandHelp (const char *command, Stream *strm)
-{
-    strm->Printf("TODO: fill this in\n");
-}
-
-Error
-ProcessGDBRemote::ExecutePluginCommand (Args &command, Stream *strm)
-{
-    Error error;
-    error.SetErrorString("No plug-in commands are currently supported.");
-    return error;
-}
-
-Log *
-ProcessGDBRemote::EnablePluginLogging (Stream *strm, Args &command)
-{
-    return NULL;
-}
-
-void
 ProcessGDBRemote::BuildDynamicRegisterInfo (bool force)
 {
     if (!force && m_register_info.GetNumRegisters() > 0)
@@ -2456,23 +2436,23 @@
     return dispatch_queue_name.c_str();
 }
 
-uint32_t
-ProcessGDBRemote::ListProcessesMatchingName (const char *name, StringList &matches, std::vector<lldb::pid_t> &pids)
-{
-    // If we are planning to launch the debugserver remotely, then we need to fire up a debugserver
-    // process and ask it for the list of processes. But if we are local, we can let the Host do it.
-    if (m_local_debugserver)
-    {
-        return Host::ListProcessesMatchingName (name, matches, pids);
-    }
-    else 
-    {
-        // FIXME: Implement talking to the remote debugserver.
-        return 0;
-    }
-
-}
-
+//uint32_t
+//ProcessGDBRemote::ListProcessesMatchingName (const char *name, StringList &matches, std::vector<lldb::pid_t> &pids)
+//{
+//    // If we are planning to launch the debugserver remotely, then we need to fire up a debugserver
+//    // process and ask it for the list of processes. But if we are local, we can let the Host do it.
+//    if (m_local_debugserver)
+//    {
+//        return Host::ListProcessesMatchingName (name, matches, pids);
+//    }
+//    else 
+//    {
+//        // FIXME: Implement talking to the remote debugserver.
+//        return 0;
+//    }
+//
+//}
+//
 bool
 ProcessGDBRemote::NewThreadNotifyBreakpointHit (void *baton,
                              lldb_private::StoppointCallbackContext *context,
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index bd61ed2..c8fb6fc 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -68,8 +68,8 @@
     virtual bool
     CanDebug (lldb_private::Target &target);
 
-    virtual uint32_t
-    ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids);
+//    virtual uint32_t
+//    ListProcessesMatchingName (const char *name, lldb_private::StringList &matches, std::vector<lldb::pid_t> &pids);
 
     //------------------------------------------------------------------
     // Creating a new process, or attaching to an existing one
@@ -123,15 +123,6 @@
     virtual uint32_t
     GetPluginVersion();
 
-    virtual void
-    GetPluginCommandHelp (const char *command, lldb_private::Stream *strm);
-
-    virtual lldb_private::Error
-    ExecutePluginCommand (lldb_private::Args &command, lldb_private::Stream *strm);
-
-    virtual lldb_private::Log *
-    EnablePluginLogging (lldb_private::Stream *strm, lldb_private::Args &command);
-
     //------------------------------------------------------------------
     // Process Control
     //------------------------------------------------------------------