2 // LLDB C++ API Test: verify the event description as obtained by calling
3 // SBEvent::GetCStringFromEvent that is received by an
4 // SBListener object registered with a process with a breakpoint.
18 // listener thread control
19 extern atomic<bool> g_done;
21 // used by listener thread to communicate a successful process continue command
22 // back to the checking thread.
24 multithreaded_queue<bool> g_process_started;
26 extern SBListener g_listener;
28 void listener_func() {
31 bool got_event = g_listener.WaitForEvent(1, event);
34 throw Exception("event is not valid in listener thread");
36 SBProcess process = SBProcess::GetProcessFromEvent(event);
37 if (process.GetState() == eStateStopped) {
38 SBError error = process.Continue();
40 throw Exception(string("Cannot continue process from listener thread: ")
41 + error.GetCString());
42 g_process_started.push(true);
48 void check_listener(SBDebugger &dbg) {
49 bool got_message = false;
51 g_process_started.pop(5, got_message);