<div dir="ltr">On Linux the platform is used to launch a process only when LLGS_LOCAL mode is on - otherwise, process plugin is used.<div><br></div><div>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"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 3:12 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">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><br>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><br></div><div>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="HOEnZb"><div class="h5"><br><div class="gmail_quote">On Thu Feb 19 2015 at 3:03:16 PM Greg Clayton <<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 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>
<br>
So if you wanted this to be supported, you will need to teach your windows platform to support the PlatformWindows::<u></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>
<br>
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>
<br>
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>
<br>
So the changes would be:<br>
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>
Error ProcessLaunchInfo::<u></u>GlobArguments(Target &target, ProcessLaunchInfo &new_launch_info);<br>
2 - if eLaunchFlagGlobArguments is set, then call the new ProcessLaunchInfo::<u></u>GlobArguments() function before doing any launches<br>
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>
<br>
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>
<br>
Greg<br>
<br>
> On Feb 19, 2015, at 2:29 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
><br>
> Enrico, will your planned changes address the original issue? Namely, that<br>
> if a process is launched through the process plugin with the<br>
> eLaunchFlagGlobArguments flag set, after your changes will the arguments<br>
> correctly go through the globber first?<br>
><br>
><br>
> <a href="http://reviews.llvm.org/D7743" target="_blank">http://reviews.llvm.org/D7743</a><br>
><br>
> EMAIL PREFERENCES<br>
> <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/<u></u>settings/panel/<u></u>emailpreferences/</a><br>
><br>
><br>
><br>
> ______________________________<u></u>_________________<br>
> lldb-commits mailing list<br>
> <a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
<br>
</blockquote></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><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">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"> 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"> <a href="mailto:ovyalov@google.com" target="_blank">ovyalov<font color="#1155cc">@google.com</font></a></span></div></div>
</div>