<div dir="ltr">> <span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">I’d like to be able to have “run” be able to launch a supplied executable, then connect to it via gdb-remote (or another protocol).</span><p class="MsoNormal" style="font-family:arial,sans-serif;font-size:13px"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt"><br></span></div><div><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">That sounds a lot like running an lldb-platform for a platform, and having the lldb-platform launch the stub. That scenario sounds like it would map well to the 'platform select remote-{something}', 'platform connect connect://{remote-address}:{remote-port}' paradigm?</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 16, 2014 at 1:59 PM, Ted Woodward <span dir="ltr"><<a href="mailto:ted.woodward@codeaurora.org" target="_blank">ted.woodward@codeaurora.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’d like to add another use case. On Hexagon, we talk to a simulator using gdb-remote. We hacked gdb to have “run” launch and connect to the simulator, and “start” do a “run”, then break at main and continue. I’ve implemented this in our lldb solution using python.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I’d like to be able to have “run” be able to launch a supplied executable, then connect to it via gdb-remote (or another protocol).<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:lldb-dev-bounces@cs.uiuc.edu" target="_blank">lldb-dev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Zachary Turner<br><b>Sent:</b> Tuesday, September 16, 2014 3:26 PM<br><b>To:</b> Todd Fiala<br><b>Cc:</b> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br><b>Subject:</b> Re: [lldb-dev] Process spawning and shutdown<u></u><u></u></span></p><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">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 :)<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Sep 16, 2014 at 1:12 PM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<u></u><u></u></p><div><p class="MsoNormal">> <span style="font-size:10.0pt;font-family:"Arial","sans-serif"">For now, the abstraction I'm creating deals only with local processes. </span><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">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><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"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).</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">Not sure that affects anything but wanted to be clear on it.</span><u></u><u></u></p></div></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Sep 16, 2014 at 12:26 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<u></u><u></u></p><div><p class="MsoNormal">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.<u></u><u></u></p></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Tue, Sep 16, 2014 at 12:07 PM, Todd Fiala <<a href="mailto:tfiala@google.com" target="_blank">tfiala@google.com</a>> wrote:<u></u><u></u></p><div><p class="MsoNormal">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).<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Also, ProcessGDBRemote is capable of kicking those off if it's using gdb-remote locally.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">So, if nothing else, there's the concept of a "launch via another mechanism."<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><div><div><p class="MsoNormal">On Tue, Sep 16, 2014 at 11:55 AM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<u></u><u></u></p></div></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in"><div><div><div><p class="MsoNormal">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:<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">MacOSX:<u></u><u></u></p></div><div><p class="MsoNormal"> * Applescript<u></u><u></u></p></div><div><p class="MsoNormal"> * XPC<u></u><u></u></p></div><div><p class="MsoNormal"> * posix_spawn<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Other posix variants:<u></u><u></u></p></div><div><p class="MsoNormal"> * posix_spawn<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Windows:<u></u><u></u></p></div><div><p class="MsoNormal"> * Native windows launcher<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Among these, there are a couple of different ways to reap processes on exit and/or "join" on them. These are:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><p class="MsoNormal">MacOSX:<u></u><u></u></p></div><div><p class="MsoNormal"> * Applescript [ No process reaping or monitoring occurs. ]<u></u><u></u></p></div><div><p class="MsoNormal"> * XPC [ Uses MacOSX-specific dispatch library for monitoring ]<u></u><u></u></p></div><div><p class="MsoNormal"> * posix_spawn [ Uses MacOSX-specific dispatch library for monitoring ]<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Other posix variants:<u></u><u></u></p></div><div><p class="MsoNormal"> * posix_spawn [ Launches a background thread to monitor for process exit, join on the thread to join on the process ]<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Windows:<u></u><u></u></p></div><div><p class="MsoNormal"> * Native windows launcher [ WaitForSingleObject ]<u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">A few questions: <u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">1) Is Join() on a process a useful operation that people would be interested in seeing implemented for all platforms?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">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?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">3) Speaking of the Applescript launcher, what is it and what is it used for?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I'll probably have more questions as I wrap my head around this a little more. Thanks<u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt">_______________________________________________<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><u></u><u></u></p></blockquote></div><p class="MsoNormal"><span style="color:#888888"><br><br clear="all"><u></u><u></u></span></p><div><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div><p class="MsoNormal"><span style="color:#888888">-- <u></u><u></u></span></p><div><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td nowrap style="border:none;border-top:solid #d50f25 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555">Todd Fiala |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #3369e8 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555"> Software Engineer |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #009939 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555"> <a href="mailto:tfiala@google.com" target="_blank"><span style="color:#222222;background:#ffffcc">tfiala@google.com</span></a> |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #eeb211 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1155cc"> <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a></span><span style="font-family:"Arial","sans-serif";color:#555555"><u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p></div></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- <u></u><u></u></p><div><table border="0" cellspacing="0" cellpadding="0"><tbody><tr><td nowrap style="border:none;border-top:solid #d50f25 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555">Todd Fiala |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #3369e8 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555"> Software Engineer |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #009939 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#555555"> <a href="mailto:tfiala@google.com" target="_blank"><span style="color:#222222;background:#ffffcc">tfiala@google.com</span></a> |<u></u><u></u></span></p></td><td nowrap style="border:none;border-top:solid #eeb211 1.5pt;padding:0in 0in 0in 0in"><p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1155cc"> <a href="tel:650-943-3180" value="+16509433180" target="_blank">650-943-3180</a></span><span style="font-family:"Arial","sans-serif";color:#555555"><u></u><u></u></span></p></td></tr></tbody></table><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div><p class="MsoNormal"><u></u> <u></u></p></div></div></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>