[Lldb-commits] [PATCH] D56230: [gdb-remote] Use lldb's portable Host::GetEnvironment() instead of getenv

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 9 05:30:45 PST 2019


labath added a comment.

> It is not that applicable for the windows process launcher to determine which entry in the args needs to be quoted unless given very specific flag or option.

Why not? Given the argv parsing rules described here https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments?view=vs-2017, it sounds like it should be possible to create an algorithm doing the reverse mapping.
Something like this ought to do the trick:

  for(string: Args) {
    if (string.contains_either_of(" \t\"")  {
      double_the_amount_of_backslashes_in_front_of_every_quote_char(string);
      string = '"' + string '"';
    }
    cmdline += " " + string;
  }


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56230/new/

https://reviews.llvm.org/D56230





More information about the lldb-commits mailing list