<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I will be too busy this week to get to this, so please do have a stab at it.<div class=""><br class=""></div><div class="">Basically the flow that debug server does is:</div><div class="">1 - get a list of all processes whose basename matches and remember those pids so we don't try to attach to them since we are waiting for a new process to show up</div><div class="">2 - poll the OS for the process list and wait for a new pid to show up with the basename and attach to the first one that matches whose pid isn't i the list from step #1</div><div class=""><br class=""></div><div class="">On MacOSX we don't have a way to be notified of new processes are spawned, not sure on other unix variants. If it is possible, we would want change to:</div><div class="">1 - sign up to be notified about new processes</div><div class="">2 - as each process gets launched, check for a match and attach as quickly as possible</div><div class=""><br class=""></div><div class="">Hope this helps and I look forward to seeing your patch!</div><div class=""><br class=""></div><div class="">Greg</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 4, 2018, at 5:56 AM, Ryan Lovelett <<a href="mailto:ryan@lovelett.me" class="">ryan@lovelett.me</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Greg,<br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Is there anything I can do to help you implement or test this feature? Obviously I'm willing to roll-up my sleeves and work on this myself too if you've become more busy than you expected. That happens to us all and I completely understand.<br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Not being able to debug in this manner is blocking me from adding Linux support to a Swift program. As you might imagine, I'm a little antsy to get past this so I can start writing some code.<span class="Apple-converted-space"> </span><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">On Thu, May 31, 2018, at 5:08 PM, Greg Clayton wrote:<br class=""></div><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><br class=""></div><div class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class="">On May 31, 2018, at 12:40 PM, Ryan Lovelett <<a href="mailto:ryan@lovelett.me" class="">ryan@lovelett.me</a>> wrote:<br class=""></div><div class=""><br class=""></div><div class=""><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Well at least there is a little good news. I understood way more of those logs than I thought I did.<br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class=""><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">So two issues here:</span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">1 - we need a better error message when vAttachWait returns unsupported</span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">2 - fix lldb-server to support vAttachWait</span></span><br class=""></div></div></blockquote><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">A few questions.<br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">What is the protocol here? Can/should I report the issues at<span class=""> </span><a href="https://bugs.llvm.org/" class="">https://bugs.llvm.org/</a><span class=""> </span>? Or is that something that a project member needs to do? Assuming that I can, would this be two seperate issues or one "large" issue?<br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Barring that this is not something someone else might implement better/faster than me. Considering I have zero LLDB development experience is this something that I could tackle?<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">I didn't realize this functionality was missing in lldb-server. I can take a stab at implementing it and see what I can do. Stay tuned.<br class=""></div></div><div class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br class=""></div><div style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">On Thu, May 31, 2018, at 3:02 PM, Greg Clayton wrote:<br class=""></div><blockquote type="cite" style="font-family: Menlo-Regular; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><div class="">lldb-server claims it doesn't support it:<br class=""></div><div class=""><br class=""></div><div class=""><div class="">lldb             <  48> send packet: $vAttachWait;6c616e677365727665722d7377696674#d6<br class=""></div><div class="">lldb             <   4> read packet: $#00<br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Returning the empty packet ("$#00") means it is not supported, but we really should give a better error message than this. <br class=""></div><div class=""><br class=""></div><div class="">It isn't that hard to implement. It would be easy to copy the code that is in debugserver in DNB.cpp in the <span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">DNBProcessAttachWait function. Most of it is probably posix style stuff. </span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;"></span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">So two issues here:</span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">1 - we need a better error message when vAttachWait returns unsupported</span></span><br class=""></div><div class=""><span class="highlight" style="background-color: rgb(255, 255, 255);"><span class="size" style="font-size: 11px;">2 - fix lldb-server to support vAttachWait</span></span><br class=""></div><div class=""><br class=""></div><div class="">Greg<br class=""></div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class="">On May 31, 2018, at 11:04 AM, Ryan Lovelett <<a href="mailto:ryan@lovelett.me" class="">ryan@lovelett.me</a>> wrote:<br class=""></div><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class="">It might be a lldb-server issue?<br class=""></blockquote><div class=""><br class=""></div><div class="">How would one go about determining this?<br class=""></div><div class=""><br class=""></div><div class="">(lldb) log enable -f /tmp/packates.txt gdb-remote packets<br class=""></div><div class="">(lldb) process attach --name "<name>" --waitfor<br class=""></div><div class="">error: attach failed: lost connection<br class=""></div><div class=""><br class=""></div><div class="">Attached the log output. Maybe it'll make more sense to you than me.<br class=""></div><div class=""><br class=""></div><div class="">That escalated quickly. So I've read through that log. I found something that says $qVAttachOrWaitSupported#38 with the following response being $#00. Perhaps I'm reading too much but is it that it's reporting that it is not supported?<br class=""></div><div class=""><br class=""></div><div class="">Does lldb-server need to be compiled in a certain way to add support for attach wait?<br class=""></div><div class=""><br class=""></div><div class="">On Thu, May 31, 2018, at 1:49 PM, Greg Clayton wrote:<br class=""></div><blockquote type="cite" class=""><div class="">Try enabling logging with:<br class=""></div><div class=""><br class=""></div><div class="">(lldb) log enable -f /tmp/packets.txt gdb-remote packets<br class=""></div><div class=""><br class=""></div><div class="">And the try the attach. It might be a lldb-server issue?<br class=""></div><div class=""><br class=""></div><blockquote type="cite" class=""><div class="">On May 31, 2018, at 9:02 AM, Ryan Lovelett via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a>> wrote:<br class=""></div><div class=""><br class=""></div><div class="">I am attempting to use: process attach --name "<name>" --waitfor<br class=""></div><div class=""><br class=""></div><div class="">The problem is that it immediately returns error: attach failed: lost connection.<br class=""></div><div class=""><br class=""></div><div class="">Is this something I can troubleshoot further? Or is this not supported on Linux?<br class=""></div><div class=""><br class=""></div><div class="">--<span class=""> </span><br class=""></div><div class="">Ryan Lovelett<br class=""></div><div class="">_______________________________________________<br class=""></div><div class="">lldb-dev mailing list<br class=""></div><div class=""><a href="mailto:lldb-dev@lists.llvm.org" class="">lldb-dev@lists.llvm.org</a><br class=""></div><div class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class=""></div></blockquote></blockquote><div class=""><span class=""><packates.txt></span></div></div></div></blockquote></div></div></blockquote></div></blockquote></div></blockquote></div></blockquote></div><br class=""></div></body></html>