[Lldb-commits] [PATCH] D68316: [Host] Return the user's shell from GetDefaultShell

Frederic Riss via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 1 20:16:27 PDT 2019


friss added inline comments.


================
Comment at: lldb/lit/Host/TestCustomShell.test:5
+# RUN: SHELL=bogus %lldb %t.out -b -o 'run' 2>&1 | FileCheck %s
+# CHECK: error: shell expansion failed
----------------
Is there a reliable way to check that the expansion we get in lldb matches the one in the shell? For example, could we have the program dump its arguments once without lldb and match them against the lldb output?

I guess the zsh example that errors out in your description makes this hard?  


================
Comment at: lldb/source/Host/posix/HostInfoPosix.cpp:119
+    return FileSpec(v);
+  if (const char *v = ::getpwuid(::geteuid())->pw_shell)
+    return FileSpec(v);
----------------
the dereference seems a little careless. getpwuid can fail and return NULL.


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

https://reviews.llvm.org/D68316





More information about the lldb-commits mailing list