aboutsummaryrefslogtreecommitdiff
path: root/lldb/scripts/Python
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-10-03 18:29:01 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-10-03 18:29:01 +0000
commitf149ea8bb5ddd488bc20f8e0de3dbfb7c4d4bf12 (patch)
tree172118a47313e0d7b99e32ee7ecbd6a3703767ea /lldb/scripts/Python
parent8d2eaf9239fb29a06bf9b12658b0a4192062fabe (diff)
downloadllvm-f149ea8bb5ddd488bc20f8e0de3dbfb7c4d4bf12.zip
llvm-f149ea8bb5ddd488bc20f8e0de3dbfb7c4d4bf12.tar.gz
llvm-f149ea8bb5ddd488bc20f8e0de3dbfb7c4d4bf12.tar.bz2
[Host] Return the user's shell from GetDefaultShell
LLDB handles shell expansion by running lldb-argdumper under a shell. Currently, this is always /bin/sh on POSIX. This potentially leads to different behavior between lldb and the user's current shell. Here's an example of different expansions between shells: $ /bin/bash -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}' -config={Options:[key:foo_key]} -config={Options:[value:foo_value]} $ /bin/zsh -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}' zsh:1: no matches found: -config={Options:[key:foo_key]} $ /bin/sh -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}' -config={Options:[key:foo_key]} -config={Options:[value:foo_value]} $ /bin/fish -c 'echo -config={Options:[{key:foo_key,value:foo_value}]}' -config=Options:[key:foo_key] -config=Options:[value:foo_value] To reduce surprises, this patch returns the user's current shell. It first looks at the SHELL environment variable. If that isn't set, it'll ask for the user's default shell. Only if that fails, we'll fallback to /bin/sh, which should always be available. Differential revision: https://reviews.llvm.org/D68316 llvm-svn: 373644
Diffstat (limited to 'lldb/scripts/Python')
0 files changed, 0 insertions, 0 deletions