[Lldb-commits] [lldb] r215937 - Cleanup how we listen for process events by using the broadcaster class name instead of having to catch each process instance as it comes alive.

Greg Clayton gclayton at apple.com
Mon Aug 18 14:09:51 PDT 2014


Author: gclayton
Date: Mon Aug 18 16:09:50 2014
New Revision: 215937

URL: http://llvm.org/viewvc/llvm-project?rev=215937&view=rev
Log:
Cleanup how we listen for process events by using the broadcaster class name instead of having to catch each process instance as it comes alive.

Modified:
    lldb/trunk/tools/lldb-perf/lib/TestCase.cpp

Modified: lldb/trunk/tools/lldb-perf/lib/TestCase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-perf/lib/TestCase.cpp?rev=215937&r1=215936&r2=215937&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-perf/lib/TestCase.cpp (original)
+++ lldb/trunk/tools/lldb-perf/lib/TestCase.cpp Mon Aug 18 16:09:50 2014
@@ -26,6 +26,7 @@ TestCase::TestCase () :
 	SBHostOS::ThreadCreated ("<lldb-tester.app.main>");
 	m_debugger = SBDebugger::Create(false);
 	m_listener = m_debugger.GetListener();
+    m_listener.StartListeningForEventClass (m_debugger, SBProcess::GetBroadcasterClass(), SBProcess::eBroadcastBitStateChanged | SBProcess::eBroadcastBitInterrupt);
 }
 
 static std::string
@@ -110,10 +111,7 @@ TestCase::Launch (lldb::SBLaunchInfo &la
     if (!error.Success())
         fprintf (stderr, "error: %s\n", error.GetCString());
     if (m_process.IsValid())
-    {
-        m_process.GetBroadcaster().AddListener(m_listener, SBProcess::eBroadcastBitStateChanged | SBProcess::eBroadcastBitInterrupt);
         return true;
-    }
     return false;
 }
 





More information about the lldb-commits mailing list