From e92050f0446492be6eb52ca21bbb582e8ce7e717 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 23 Aug 2016 12:10:03 +0000 Subject: [PATCH] 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 --- .../test/api/multithreaded/test_listener_event_process_state.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lldb/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp b/lldb/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp index a79c5cb..574257e 100644 --- a/lldb/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp +++ b/lldb/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp @@ -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) { -- 2.7.4