void listener_func() { while (!g_done) { SBEvent event; bool got_event = g_listener.WaitForEvent(1, event); if (got_event) { if (!event.IsValid()) 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) { // 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)); } } } } }
void listener_func() { while (!g_done) { SBEvent event; bool got_event = g_listener.WaitForEvent(1, event); 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); } } } } }
void listener_func() { while (!g_done) { SBEvent event; bool got_event = g_listener.WaitForEvent(1, event); if (got_event) { if (!event.IsValid()) throw Exception("event is not valid in listener thread"); SBStream description; event.GetDescription(description); string str(description.GetData()); g_event_descriptions.push(str); } } }
void listener_func() { while (!g_done) { SBEvent event; bool got_event = g_listener.WaitForEvent(1, event); if (got_event) { if (!event.IsValid()) throw Exception("event is not valid in listener thread"); SBProcess process = SBProcess::GetProcessFromEvent(event); if (process.GetState() == eStateStopped) { SBError error = process.Continue(); if (!error.Success()) throw Exception(string("Cannot continue process from listener thread: ") + error.GetCString()); g_process_started.push(true); } } } }