<div dir="ltr">Sure, but debugserver still has to launch processes locally w/r/t itself, so this code would jsut be used there instead of in lldb. Also, it's not clear what the timeline is and waiting would jsut be lost time, so even if some of what I do now has to be redone in the debugserver world, it's still better than being blocked now and not being able to do anything :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 1:12 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class="">> <span style="font-family:arial,sans-serif;font-size:13px">For now, the abstraction I'm creating deals only with local processes. </span><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></span><div><span style="font-family:arial,sans-serif;font-size:13px">For MacOSX, the local process uses debugserver for debugging (i.e. it is always remote w/r/t process startup --- lldb will launch and debugserver will attach).</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Linux is moving this way as well once we (1) get llgs passing the local test suite with llgs in place of ProcessLinux/ProcessMonitor, and (2) get llgs supporting the existing set of ProcessLinux/ProcessMonitor cpu architectures. It will be on a PlatformLinux switch that defaults to current TOT behavior until then. (See <a href="http://github.com/tfiala/lldb" target="_blank">http://github.com/tfiala/lldb</a> in the dev-llgs-local-launch branch for current state).</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Not sure that affects anything but wanted to be clear on it.</font></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 12:26 PM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yea, I saw that as well. For now, the abstraction I'm creating deals only with local processes. However, it has an interface that would in theory allow a RemoteProcess to derive from it, so that local and remote processes could be managed transparently.</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 12:07 PM, Todd Fiala <span dir="ltr"><<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Don't forget we also have launching via Platform classes, which can end up kicking off a gdb-remote request to a lldb-platform or gdb-remote stub (llgs/debugserver).<div><br></div><div>Also, ProcessGDBRemote is capable of kicking those off if it's using gdb-remote locally.</div><div><br></div><div>So, if nothing else, there's the concept of a "launch via another mechanism."</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Sep 16, 2014 at 11:55 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">The last major piece of the Host layer I'd like to address is process launching and cleanup. From looking over the code it seems we have the following different ways to launch a process:<div><br></div><div>MacOSX:</div><div> * Applescript</div><div> * XPC</div><div> * posix_spawn</div><div><br></div><div>Other posix variants:</div><div> * posix_spawn</div><div><br></div><div>Windows:</div><div> * Native windows launcher</div><div><br></div><div><br></div><div>Among these, there are a couple of different ways to reap processes on exit and/or "join" on them. These are:</div><div><br></div><div><div>MacOSX:</div><div> * Applescript [ No process reaping or monitoring occurs. ]</div><div> * XPC [ Uses MacOSX-specific dispatch library for monitoring ]</div><div> * posix_spawn [ Uses MacOSX-specific dispatch library for monitoring ]</div><div><br></div><div>Other posix variants:</div><div> * posix_spawn [ Launches a background thread to monitor for process exit, join on the thread to join on the process ]</div><div><br></div><div>Windows:</div><div> * Native windows launcher [ WaitForSingleObject ]</div></div><div><br></div><div>A few questions: </div><div><br></div><div>1) Is Join() on a process a useful operation that people would be interested in seeing implemented for all platforms?</div><div><br></div><div>2) On Linux at least, if you don't waitpid() on a process you'll end up with zombies. It seems this is true on MacOSX as well, because I see waitpid() in StartMonitoringChildProcess. Is this not true for the Applescript launcher? Why doesn't the Applescript launching code path call StartMonitoringChildProcess() anywhere?</div><div><br></div><div>3) Speaking of the Applescript launcher, what is it and what is it used for?</div><div><br></div><div><br></div><div>I'll probably have more questions as I wrap my head around this a little more. Thanks</div></div>
<br></div></div>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</font></span></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small"><td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>
</div></div></blockquote></div><br></div>