Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_state

The test was attempting to backtrace a process after every state change event (including the
"running", and "restarted" ones), which is not a good idea.

llvm-svn: 279512
This commit is contained in:
Pavel Labath 2016-08-23 12:10:03 +00:00
parent 2ed547513d
commit e92050f044
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,11 @@ void listener_func() {
throw Exception("event is not valid in listener thread");
// send process description
SBProcess process = SBProcess::GetProcessFromEvent(event);
if (!process.IsValid())
throw Exception("process is not valid");
if (SBProcess::GetStateFromEvent(event) != lldb::eStateStopped || SBProcess::GetRestartedFromEvent(event))
continue; // Only interested in "stopped" events.
SBStream description;
for (int i = 0; i < process.GetNumThreads(); ++i) {