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

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 12 02:23:49 PST 2019


labath added a comment.

In D56230#1355247 <https://reviews.llvm.org/D56230#1355247>, @labath wrote:

> For example, for a `Args` vector like `lldb-server`, `gdb-remote`, `--log-channels=foo\\\   \\\"""   '''`, `whatever`, `QuoteForCreateProcess` would return
>  `lldb-server gdb-remote "--log-channels=foo\\\   \\\\\\\"\"\"   '''" whatever` (there are other ways to quote this too). Passing this string to CreateProcess will result in the original vector being available to the `main` function of lldb-server, which is what this code (and all other code that works with the `Args` class) expects.


Btw, there is already code for doing this in llvm (`llvm::sys::flattenWindowsCommandLine`), so we can just steal the implementation from there.


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

https://reviews.llvm.org/D56230





More information about the llvm-commits mailing list