Change over the broadcaster/listener process to hold shared or weak pointers
to each other.  This should remove some infrequent teardown crashes when the
listener is not the debugger's listener.

Processes now need to take a ListenerSP, not a Listener&.

This required changing over the Process plugin class constructors to take a ListenerSP, instead
of a Listener&.   Other than that there should be no functional change.
 
<rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39

llvm-svn: 262863
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 70633e7..5f02822 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -45,13 +45,13 @@
 class ProcessGDBRemote : public Process
 {
 public:
-    ProcessGDBRemote(lldb::TargetSP target_sp, Listener &listener);
+    ProcessGDBRemote(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
 
     ~ProcessGDBRemote() override;
 
     static lldb::ProcessSP
     CreateInstance (lldb::TargetSP target_sp,
-                    Listener &listener,
+                    lldb::ListenerSP listener_sp,
                     const FileSpec *crash_file_path);
 
     static void
@@ -282,7 +282,7 @@
     Mutex m_last_stop_packet_mutex;
     GDBRemoteDynamicRegisterInfo m_register_info;
     Broadcaster m_async_broadcaster;
-    Listener m_async_listener;
+    lldb::ListenerSP m_async_listener_sp;
     HostThread m_async_thread;
     Mutex m_async_thread_state_mutex;
     typedef std::vector<lldb::tid_t> tid_collection;