<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 19, 2015, at 4:55 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=""><br class=""><br class=""><div class="gmail_quote">On Thu Feb 19 2015 at 4:42:54 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=""><blockquote type="cite" class=""><div class="">On Feb 19, 2015, at 4:33 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank" class="">zturner@google.com</a>> wrote:</div><br class=""><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 class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">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 class="">If you wanted to emulate that, you’d essentially be rewriting the bash command-line, nuances, corner cases, caveats and everything</div><div class="">There is a program already that does all that, it’s called a shell</div><div class=""><br class=""></div><div class="">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></div></div></blockquote><div class="">Are we actually planning to allow the use of environment variables in these glob expressions? </div></div></div></div></blockquote><div><br class=""></div><div>Unless there’s a compelling reason not to, yes.</div><div>The launch-via-shell currently allows that, and it’s a nice feature.</div><div><br class=""></div><div>With that said, this is exactly why this thing belongs in Platform. Different platforms have different features. If an OS existed without * expansions, or without environment variables, then these things would not be supported when launching on that platform.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""> Or is it just *. syntax?  Because if environment variables are allowed, then there's no way to even write a platform independent glob expression.</div></div></div></div></blockquote><div><br class=""></div><div>Which is fine, because you most likely know what remote system you’re talking to when debugging.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class="">  The reason I didn't bring this up earlier is because Windows actually can glob with *. so the examples i had seen so far would have worked.  If we want to say that you get arbitrary shell expansion, then that's going to make tests very hard to write portably, and I'm not crazy about the idea of seeing even more platform specific tests going in.</div><div class=""><br class=""></div><div class="">So instead, why not just agree on a very simple subset of what the shell does -- in particular allow the use of the character set [*.?] and just write the glob function ourselves?</div><div class=""> </div></div></div></div></blockquote><div><br class=""></div><div>I just don’t see the value of doing more work for less feature.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><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=""><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 class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">Why?</div></div></div></blockquote><div class="">Because I'm not convinced we actually need that level of flexibility.  </div><div class=""> </div><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=""><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 class=""><br class=""></div></div></div><div style="word-wrap:break-word" class=""><div class=""><div class="">PlatformWindows could very well decide that it does not support globbing if this is such a big deal.</div></div></div></blockquote><div class=""><span style="font-size:13.1999998092651px" class="">It does though, just with a different set of rules.  So now any test that goes in to test this has to have tests for each platform's shell syntax.  We should be trying to find abstractions to bring all the platforms together IMO, not increasing the separation.</span><br class=""></div></div></div>
</div></blockquote></div><div class=""><br class=""></div><div class="">That which will be part of testing the platform-specific bits of your platform</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>