[lldb-dev] C++ API get stray process stopped event

Eugene Birukov eugenebi at hotmail.com
Thu Jun 25 10:36:15 PDT 2015


Hi,
 
I am running on Linux Ubuntu 14.04 with lldb-4.7 I built from sources about a month ago.
 
My C++ debugger does pretty much the following:
Initializes LLDB, sets it to async modeGets listener from debugger, subscribes for process and target events Sets a few breakpointsWaits for event on the listenerIf event is a process event If event type is eBroadcastBitSTDOUT or eBroadcastBitSTERRcall SBDebugger::HandleProcessEvent() to get it printedelse if process state is eStateStoppedscan all the target threads and checks their stop reason, registers, etc.call SBProcess::Continue()Loop to 4 
Now, the program behavior varies - so it might be I am doing something wrong...
 
One version of the program always gets stray stopped event in the very beginning after reporting several module loads. In this case it has only one thread yet and the thread stop reason is eStopReasonNone. when it happens, I have to skip calling SBProcess::Continue() - i.e. just ignore this event as if the target state was eStateRunning and reissue wait for event. This is a bit annoying but detection and workaround are simple.
 
Another version of the program does not subscribe for target events. It often works smooth, but once in a while gets stray stopped event and the thread state is eStopReasonTrace. I should not call SBProcess::Continue() in this case too. Now the problem is that I do turn on tracing sometimes, and if it is genuine trace event I have to call continue.
 
Any advice - how to investigate this problem - if it is my bug or something in LLDB?
 
Thanks,
Eugene
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150625/db3cfbc3/attachment.html>


More information about the lldb-dev mailing list