<div dir="ltr">You are absolutely right.<div><br></div><div><a href="https://reviews.llvm.org/D44728">https://reviews.llvm.org/D44728</a></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 21, 2018 at 10:01 AM, Pavel Labath <span dir="ltr"><<a href="mailto:labath@google.com" target="_blank">labath@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">Instead of trying to guess how the shell will interpret your command line, it would be better to just use a primitive which bypasses the shell altogether. For example you can use subprocess.call(), and just forward it the list of arguments verbatim.<div><br></div><div>You'd need to do some special processing on the args you got from cmake, as these are already a string, but this could be handled by forwarding them as a list (separated by semicolon) and then just breaking it up around semicolons. This will still not be perfect forwarding, but it will already be a big improvement over how it's handled right now.</div></div><div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 20 Mar 2018 at 19:20, Jonas Devlieghere via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jdevlieghere<br>
Date: Tue Mar 20 12:18:11 2018<br>
New Revision: 328020<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=328020&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=328020&view=rev</a><br>
Log:<br>
[lldb-dotest] Wrap arguments in single quotes<br>
<br>
If we don't wrap arguments to the wrapper in single quotes, combined<br>
arguments, for example for -E, don't reach dotest.py as a unit but as<br>
separate arguments, causing the latter to fail.<br>
<br>
Modified:<br>
    lldb/trunk/test/<a href="http://lldb-dotest.in" rel="noreferrer" target="_blank">lldb-dotest.in</a><br>
<br>
Modified: lldb/trunk/test/<a href="http://lldb-dotest.in" rel="noreferrer" target="_blank">lldb-dotest.in</a><br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldb-dotest.in?rev=328020&r1=328019&r2=328020&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/lldb/trunk/test/lldb-<wbr>dotest.in?rev=328020&r1=<wbr>328019&r2=328020&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- lldb/trunk/test/<a href="http://lldb-dotest.in" rel="noreferrer" target="_blank">lldb-dotest.in</a> (original)<br>
+++ lldb/trunk/test/<a href="http://lldb-dotest.in" rel="noreferrer" target="_blank">lldb-dotest.in</a> Tue Mar 20 12:18:11 2018<br>
@@ -6,9 +6,13 @@ dotest_path = '@LLDB_SOURCE_DIR@/test/do<br>
 dotest_args = '@LLDB_DOTEST_ARGS_STR@'<br>
<br>
 if __name__ == '__main__':<br>
+    # Wrap arguments in single quotes. This is necessary because we want to<br>
+    # forward the arguments and otherwise we might split up arguments that were<br>
+    # originally wrapped in single quotes.<br>
+    wrapper_args = list("'" + i + "'" for i in sys.argv[1:])<br>
     # FIXME: It would be nice if we can mimic the approach taken by llvm-lit<br>
     # and pass a python configuration straight to dotest, rather than going<br>
     # through the operating system.<br>
-    command = '{} -q {} {}'.format(dotest_path, dotest_args, ' '.join(<br>
-        sys.argv[1:]))<br>
+    command = '{} -q {} {}'.format(dotest_path, dotest_args,<br>
+                                   ' '.join(wrapper_args))<br>
     os.system(command)<br>
<br>
<br>
______________________________<wbr>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/lldb-commits</a><br>
</blockquote></div>
</div></div></blockquote></div><br></div>