[Lldb-commits] [lldb] r279512 - Fix API usage in TestMultithreaded.test_sb_api_listener_event_process_state
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Tue Aug 23 05:10:04 PDT 2016
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) {
More information about the lldb-commits
mailing list