[Lldb-commits] [PATCH] D123690: [lldb] Expand $ when using tcsh

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 13 10:42:19 PDT 2022

jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

tcsh is different from the other shells in that a non-existent variable is trapped by the shell, and an error produced BEFORE running the command, whereas in other shells it just gets passed raw.  So we should make sure that passing a non-existent shell variable produces a reasonable error.  At present it sort of does:

  (lldb) process launch --shell=tcsh -- $PWD $NO_SUCH_SHELL_VARIABLE
  NO_SUCH_SHELL_VARIABLE: Undefined variable.
  error: process exited with status 1
  'r' and 'run' are aliases that default to launching through a shell.
  Try launching without going through a shell by using 'process launch'.

The advisory part of that message is a little bogus, but that's a separate issue.  Erroring out seems reasonable since that's actually what tcsh would have done with these arguments, and we seem in a fine state to try again.

It might be nice to have a test where we pass a bad variable and make sure that the error stays reasonable?  But that's on the nice to have side...



More information about the lldb-commits mailing list