diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/api/multithreaded | |
parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/api/multithreaded')
-rw-r--r-- | packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py | 6 | ||||
-rw-r--r-- | packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp | 46 |
2 files changed, 21 insertions, 31 deletions
diff --git a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py index 9963cf23a8c6e..7959bb73de020 100644 --- a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py +++ b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py @@ -6,8 +6,9 @@ from __future__ import print_function import os, re +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil import subprocess class SBBreakpointCallbackCase(TestBase): @@ -36,7 +37,6 @@ class SBBreakpointCallbackCase(TestBase): @skipIfNoSBHeaders @skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD - @expectedFlakeyLinux # Driver occasionally returns '1' as exit status @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["x86_64"]) def test_sb_api_listener_event_process_state(self): """ Test that a registered SBListener receives events when a process @@ -51,7 +51,7 @@ class SBBreakpointCallbackCase(TestBase): @skipIfNoSBHeaders @skipIfWindows # clang-cl does not support throw or catch (llvm.org/pr24538) @expectedFlakeyFreeBSD - @expectedFailureLinux + @expectedFailureAll(oslist=["linux"]) def test_sb_api_listener_resume(self): """ Test that a process can be resumed from a non-main thread. """ self.build_and_test('driver.cpp listener_test.cpp test_listener_resume.cpp', diff --git a/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp b/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp index 0a698d1081d47..a79c5cb2a08bc 100644 --- a/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp +++ b/packages/Python/lldbsuite/test/api/multithreaded/test_listener_event_process_state.cpp @@ -18,7 +18,6 @@ using namespace std; // listener thread control extern atomic<bool> g_done; -multithreaded_queue<string> g_thread_descriptions; multithreaded_queue<string> g_frame_functions; extern SBListener g_listener; @@ -30,26 +29,21 @@ void listener_func() { if (got_event) { if (!event.IsValid()) throw Exception("event is not valid in listener thread"); - - // send process description - SBProcess process = SBProcess::GetProcessFromEvent(event); - SBStream description; - - for (int i = 0; i < process.GetNumThreads(); ++i) { - // send each thread description - description.Clear(); - SBThread thread = process.GetThreadAtIndex(i); - thread.GetDescription(description); - g_thread_descriptions.push(description.GetData()); - - // send each frame function name - uint32_t num_frames = thread.GetNumFrames(); - for(int j = 0; j < num_frames; ++j) { - const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName(); - if (function_name) - g_frame_functions.push(function_name); + // send process description + SBProcess process = SBProcess::GetProcessFromEvent(event); + SBStream description; + + for (int i = 0; i < process.GetNumThreads(); ++i) { + // send each thread description + SBThread thread = process.GetThreadAtIndex(i); + // send each frame function name + uint32_t num_frames = thread.GetNumFrames(); + for(int j = 0; j < num_frames; ++j) { + const char* function_name = thread.GetFrameAtIndex(j).GetSymbol().GetName(); + if (function_name) + g_frame_functions.push(string(function_name)); + } } - } } } } @@ -57,12 +51,8 @@ void listener_func() { void check_listener(SBDebugger &dbg) { // check thread description bool got_description = false; - string desc = g_thread_descriptions.pop(5, got_description); - if (!got_description) - throw Exception("Expected at least one thread description string"); - - // check at least one frame has a function name - desc = g_frame_functions.pop(5, got_description); - if (!got_description) - throw Exception("Expected at least one frame function name string"); + string func_name = g_frame_functions.pop(5, got_description); + + if(got_description == false) + throw Exception("Expected at least one frame function"); } |