Author: labath
Date: Tue Aug 23 07:10:03 2016
New Revision: 279512

URL: http://llvm.org/viewvc/llvm-project?rev=279512&view=rev
Log:
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.

Modified:
    
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp?rev=279512&r1=279511&r2=279512&view=diff
==============================================================================
--- 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp
 Tue Aug 23 07:10:03 2016
@@ -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) {


_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to