<div dir="ltr">Plus, this gives us the flexibility to use this globbing function on things that don't map to a list of files on disk.  For example, now you can glob a list of file names in memory or something.  Say for example you want to use this globber to look for a list of all modules loaded by a running target.  <br></div><br><div class="gmail_quote">On Thu Feb 19 2015 at 4:55:05 PM Zachary Turner <<a href="mailto:zturner@google.com">zturner@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote">On Thu Feb 19 2015 at 4:42:54 PM Enrico Granata <<a href="mailto:egranata@apple.com" target="_blank">egranata@apple.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div>On Feb 19, 2015, at 4:33 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:</div><br><div><div dir="ltr">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></div></div></div><div style="word-wrap:break-word"><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></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></div></div></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div>Are we actually planning to allow the use of environment variables in these glob expressions?  Or is it just *. syntax?  Because if environment variables are allowed, then there's no way to even write a platform independent glob expression.  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><br></div><div>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></div><div dir="ltr"><div class="gmail_quote"><div> </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"><div><br><blockquote type="cite"><div><div dir="ltr">  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></div></div></div><div style="word-wrap:break-word"><div><div>Why?</div></div></div></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div>Because I'm not convinced we actually need that level of flexibility.  </div></div></div><div dir="ltr"><div class="gmail_quote"><div> </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"><div><br><blockquote type="cite"><div><div dir="ltr">  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></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>PlatformWindows could very well decide that it does not support globbing if this is such a big deal.</div></div></div></blockquote></div></div><div dir="ltr"><div class="gmail_quote"><div><span style="font-size:13.1999998092651px">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></div></div></div></blockquote></div>