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.

llvm-svn: 215937
This commit is contained in:
Greg Clayton 2014-08-18 21:09:50 +00:00
parent 994740fb1a
commit baac2afccf
1 changed files with 1 additions and 3 deletions

View File

@ -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 &launch_info)
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;
}