[Lldb-commits] [PATCH] D11066: Introduce a MainLoop class and switch llgs to use it

Greg Clayton clayborg at gmail.com
Thu Jul 9 09:56:59 PDT 2015


clayborg added a comment.

The design is very signal centric right now. Not sure if that will bode well for windows.

What are the signals supposed to be for? Just handling "SIGHUP" and "SIGINT"? If so, you need to make sure no one does any real work inside any of these functions because it isn't safe to do 95% of any function calls in a signal handler function. It would be better to just create a lldb_private::Event into your loop that can be handled on the up and up and the signal handler would just post an event to the queue for the MainLoop to consume. Then you can do anything you want when you get the event because you aren't handling it from a signal handler callback. But of course this is usually the problem: something has locked up your lldb-server and you want to interrupt it. If the MainLoop is handling a packet that is deadlocked somehow, you will never be able to consume the event you just created for SIGHUP and you won't be able to cancel/kill/disconnect...

Are the signal handlers designed to handle the signals received from the program that is being debugged? If so this would be better served up using StopInfoSP objects for specific threads.

I look forward to seeing your responses.


http://reviews.llvm.org/D11066







More information about the lldb-commits mailing list