<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Feb 19, 2015, at 4:33 PM, Zachary Turner <<a href="mailto:zturner@google.com" class="">zturner@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Is this not something we could solve by writing a function in Host that behaves the way we'd like it to behave on all platforms?</div></div></blockquote><div><br class=""></div><div>I don’t think LLDB should be in the business of trying to pretend to be a shell. The magic of argdumper is that it gets launched via a shell, so the shell does all the magic expansion for us, and we just dump our list of arguments</div><div>If you wanted to emulate that, you’d essentially be rewriting the bash command-line, nuances, corner cases, caveats and everything</div><div>There is a program already that does all that, it’s called a shell</div><div><br class=""></div><div>Also, I am not sure there is a universal all-platforms notion of globbing. IIRC, on Windows, environment is referenced as %ENVVAR%, not $ENVVAR. You’d want to preserve those platform-specific conventions.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">  I mean it might be an ugly function, but the idea of passing stuff to an external program is kinda meh.</div></div></blockquote><div><br class=""></div><div>Why?</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class="">  FWIW launching a process is not a lightweight operation on windows like it is on other platforms, and there's actually noticeable overhead.  So it would be great if we could remove dependencies on external programs.<br class=""></div></div></blockquote><div><br class=""></div><div>PlatformWindows could very well decide that it does not support globbing if this is such a big deal.</div><br class=""><blockquote type="cite" class=""><div class=""><br class=""><div class="gmail_quote">On Thu Feb 19 2015 at 4:30:24 PM Enrico Granata <<a href="mailto:egranata@apple.com" class="">egranata@apple.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">IIUC, glob() does not perform environment variables expansion - and even support for ~ expansion is an extension that is not generally POSIX compliant</div><div class="">These are things we’d like to preserve (definitely we would like to have these abilities on OS X)</div></div><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 19, 2015, at 4:23 PM, Oleksiy Vyalov <<a href="mailto:ovyalov@google.com" target="_blank" class="">ovyalov@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">On Linux the platform is used to launch a process only when LLGS_LOCAL mode is on - otherwise, process plugin is used.<div class=""><br class=""></div><div class="">I'm wondering whether we need the standalone binary argdumper for globbing - potentially, we may just use glob function on Linux and OSX. For remote execution there might be a new protocol extension command (e.g., qGlobArgs) which either calls glob or runs argdumper. </div></div><div class="gmail_extra" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class=""><div class="gmail_quote">On Thu, Feb 19, 2015 at 3:12 PM, Zachary Turner<span class=""> </span><span dir="ltr" class=""><<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>></span><span class=""> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr" class="">There's currently a lot of ways to launch processes, and the interactions that lead to specific methods being chosen can be a bit confusing sometimes.<br class=""><br class="">Out of curiosity, if a plugin supports launching under a debugger directly, why is the separate start stopped / attach / resume algorithm used?  It seems more straightforward.<div class=""><br class=""></div><div class="">If someone gets themselves through that codepath, argdumper won't be used.  Which is confusing if you're outside looking in at the API.  From the outside you just see the process gets launched using a supported mechanism for launching processes, and it ignores the flag.</div></div><div class=""><div class=""><br class=""><div class="gmail_quote">On Thu Feb 19 2015 at 3:03:16 PM Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank" class="">gclayton@apple.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">They will only if you teach your platform to launch your processes. I believe the Windows platform is the only platform that doesn't do process launching via the platform. Am I wrong? If your platform supports it, it should launch your process in a stopped state and then your Process plug-in is simply asked to attach to that process.<br class=""><br class="">So if you wanted this to be supported, you will need to teach your windows platform to support the PlatformWindows::<u class=""></u>GlobArguments() which means you will launch the arg_dumper though cmd.exe and let the cmd.exe do any glowing and any expansion that it wants to, and parse the output.<br class=""><br class="">Enrico will check in a method for PlatformPOSIX::GlobArguments() which launches through a shell. I can't remember where we can get the default shell, but I seem to remember that we have the default shell that we can get from the host, so we could add this implementation in "Platform::GlobArguments()" and if "IsHost()" returns true, get the default shell from the host and launch the arg_dumper and then parse the output.<br class=""><br class="">This probably should be a method on ProcessLaunchInfo so that it fixes up its arguments and uses the target's platform to do the glob expansion.<br class=""><br class="">So the changes would be:<br class="">1 - add a method to ProcessLaunchInfo that gets passed a target and allows it to fixup arguments and environment variables in a new ProcessLaunchInfo:<br class="">   <span class=""> </span>Error ProcessLaunchInfo::<u class=""></u>GlobArguments(Target &target, ProcessLaunchInfo &new_launch_info);<br class="">2 - if eLaunchFlagGlobArguments is set, then call the new ProcessLaunchInfo::<u class=""></u>GlobArguments() function before doing any launches<br class="">3 - Add a Platform::GlobArguments() function that, for the current host, knows how to run the arg_dumper on the current host using the Host::GetDefaultShell().<br class=""><br class="">Then we need to figure out what to do for remote platforms. I am not sure we can guarantee there is an arg_dumper on the other side. For the lldb-platform, we could ensure that it has access to arg_dumper and can run it as a remote packet and return the results.<br class=""><br class="">Greg<br class=""><br class="">> On Feb 19, 2015, at 2:29 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>> wrote:<br class="">><br class="">> Enrico, will your planned changes address the original issue?  Namely, that<br class="">> if a process is launched through the process plugin with the<br class="">> eLaunchFlagGlobArguments flag set, after your changes will the arguments<br class="">> correctly go through the globber first?<br class="">><br class="">><br class="">><span class=""> </span><a href="http://reviews.llvm.org/D7743" target="_blank" class="">http://reviews.llvm.org/D7743</a><br class="">><br class="">> EMAIL PREFERENCES<br class="">> <span class=""> </span><a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank" class="">http://reviews.llvm.org/<u class=""></u>settings/panel/<u class=""></u>emailpreferences/</a><br class="">><br class="">><br class="">><br class="">> ______________________________<u class=""></u>_________________<br class="">> lldb-commits mailing list<br class="">><span class=""> </span><a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank" class="">lldb-commits@cs.uiuc.edu</a><br class="">><span class=""> </span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank" class="">http://lists.cs.uiuc.edu/<u class=""></u>mailman/listinfo/lldb-commits</a><br class=""><br class=""></blockquote></div></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class=""><div dir="ltr" class=""><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(213,15,37);padding-top:2px;margin-top:2px" class="">Oleksiy Vyalov |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(51,105,232);padding-top:2px;margin-top:2px" class=""> Software Engineer |</span><span style="color:rgb(85,85,85);font-family:sans-serif;line-height:20px;background-color:rgb(255,255,255);border-width:2px 0px 0px;border-style:solid;border-color:rgb(0,153,57);padding-top:2px;margin-top:2px" class=""> <a href="mailto:ovyalov@google.com" target="_blank" class="">ovyalov<font color="#1155cc" class="">@google.com</font></a></span></div></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">lldb-commits mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="mailto:lldb-commits@cs.uiuc.edu" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">lldb-commits@cs.uiuc.edu</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits</a></div></blockquote></div><br class=""></div><div style="word-wrap:break-word" class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div class="">Thanks,</div><div class=""><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div><div class=""><br class=""></div></div></div></div></div></div><br class=""><br class="">
</div>
<br class=""></div></blockquote></div>
</div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Thanks,</div><div class=""><i class="">- Enrico</i><br class="">📩 egranata@<font color="#ff2600" class=""></font>.com ☎️ 27683</div><div class=""><br class=""></div></div></div></div></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>