From 583bbb1dd46e1665c2d5f31d4e4772bf6207c1c0 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Mon, 7 Mar 2016 21:50:25 +0000 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863 --- .../Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index da04d48..e61999d 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -786,8 +786,8 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse // In order to stop async notifications from being processed in the middle of the // send/receive sequence Hijack the broadcast. Then rebroadcast any events when we are done. - static Listener hijack_listener("lldb.NotifyHijacker"); - HijackBroadcaster(&hijack_listener, eBroadcastBitGdbReadThreadGotNotify); + static ListenerSP hijack_listener_sp(Listener::MakeListener("lldb.NotifyHijacker")); + HijackBroadcaster(hijack_listener_sp, eBroadcastBitGdbReadThreadGotNotify); if (GetSequenceMutex (locker)) { @@ -886,7 +886,7 @@ GDBRemoteCommunicationClient::SendPacketAndWaitForResponse // If a notification event occurred, rebroadcast since it can now be processed safely. EventSP event_sp; - if (hijack_listener.GetNextEvent(event_sp)) + if (hijack_listener_sp->GetNextEvent(event_sp)) BroadcastEvent(event_sp); return packet_result; -- cgit v1.1