Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Jim Ingham via lldb-dev
> On Apr 28, 2017, at 4:04 PM, Pavel Labath wrote: > > MainLoop was meant to be a general event multiplexer. One of those > events can certainly be "a certain amount of time expiring". > So, you could write something like: > loop.RegisterAlarm(seconds(N), [&] { loop.RequestTermination() }); > wh

Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Pavel Labath via lldb-dev
MainLoop was meant to be a general event multiplexer. One of those events can certainly be "a certain amount of time expiring". So, you could write something like: loop.RegisterAlarm(seconds(N), [&] { loop.RequestTermination() }); which would translate to an appropriate timeout argument to ppoll.

Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Chris Bieneman via lldb-dev
I think in the common case of listening for a remote connection infinite (or very very long) timeout with signal interrupt is the preferred approach. There are other situations where we use SelectHelper with smaller timeouts, and I think ultimately we should replace SelectHelper with MainLoop be

Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Jim Ingham via lldb-dev
(1) is okay, except pretty much every time so far I've ever said "operation X can't possibly take more than N seconds" somebody finds a case in which that assumption was wrong. So you end up having to make the timeouts so long they look like stalls anyway... An explicit cancellation gesture is

Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Chris Bieneman via lldb-dev
Ultimately I think the solution here is two changes (1) We should add a timeout to MainLoop so that it doesn't wait forever unless we really want to wait forever. (2) MainLoop can exit on sigint for any platform that has ppoll, pselect, or kevent, so we should probably set that up too. -Chris

Re: [lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Jim Ingham via lldb-dev
Seems to me a better UI would be to make ^C interrupt this wait. That seems to me better than putting in some arbitrary timeout. Jim > On Apr 28, 2017, at 10:21 AM, Ted Woodward via lldb-dev > wrote: > > Hi Chris, Pavel, > > I've got a problem launching the hexagon simulator from lldb. It's

[lldb-dev] remote server crash -> lldb waits forever in accept()

2017-04-28 Thread Ted Woodward via lldb-dev
Hi Chris, Pavel, I've got a problem launching the hexagon simulator from lldb. It's launched the same way that debugserver/lldb-server is launched, with reverse connect on a TCP socket. The user can modify the simulator command line (using target.run-args), and can easily give a set of options tha