[Lldb-commits] [PATCH] D123690: [lldb] Expand $ when using tcsh
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 13 13:01:20 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGacc56e55feee: [lldb] Expand $ when using tcsh (authored by JDevlieghere).
Herald added a project: LLDB.
Changed prior to commit:
https://reviews.llvm.org/D123690?vs=422551&id=422622#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123690/new/
https://reviews.llvm.org/D123690
Files:
lldb/source/Utility/Args.cpp
lldb/test/Shell/Process/Inputs/echo.c
lldb/test/Shell/Process/TestShell.test
lldb/unittests/Utility/ArgsTest.cpp
Index: lldb/unittests/Utility/ArgsTest.cpp
===================================================================
--- lldb/unittests/Utility/ArgsTest.cpp
+++ lldb/unittests/Utility/ArgsTest.cpp
@@ -336,8 +336,8 @@
// Test escaping tcsh special characters.
FileSpec tcsh("/bin/tcsh", FileSpec::Style::posix);
- EXPECT_EQ(Args::GetShellSafeArgument(tcsh, R"( '"<>()&$;)"),
- R"(\ \'\"\<\>\(\)\&\$\;)");
+ EXPECT_EQ(Args::GetShellSafeArgument(tcsh, R"( '"<>()&;)"),
+ R"(\ \'\"\<\>\(\)\&\;)");
// Normal characters and globbing expressions that shouldn't be escaped.
EXPECT_EQ(Args::GetShellSafeArgument(tcsh, "aA1*"), "aA1*");
Index: lldb/test/Shell/Process/TestShell.test
===================================================================
--- /dev/null
+++ lldb/test/Shell/Process/TestShell.test
@@ -0,0 +1,8 @@
+REQUIRES: shell, system-darwin
+RUN: %clang_host %p/Inputs/echo.c -o %t.out
+
+RUN: not %lldb %t.out -b -o 'process launch --shell=tcsh -- $NO_SUCH_SHELL_VARIABLE' 2>&1 | FileCheck --check-prefix=FAILURE %s
+RUN: %lldb %t.out -b -o 'process launch --shell=tcsh -- $HOME' 2>&1 | FileCheck --check-prefix=SUCCESS %s
+
+FAILURE: exited with status 1
+SUCCESS: exited with status = 0
Index: lldb/test/Shell/Process/Inputs/echo.c
===================================================================
--- /dev/null
+++ lldb/test/Shell/Process/Inputs/echo.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+ for (int i = 0; i < argc; ++i)
+ printf("%s\n", argv[i]);
+}
Index: lldb/source/Utility/Args.cpp
===================================================================
--- lldb/source/Utility/Args.cpp
+++ lldb/source/Utility/Args.cpp
@@ -385,7 +385,7 @@
};
static ShellDescriptor g_Shells[] = {{ConstString("bash"), " '\"<>()&;"},
- {ConstString("tcsh"), " '\"<>()&$;"},
+ {ConstString("tcsh"), " '\"<>()&;"},
{ConstString("zsh"), " '\"<>()&;\\|"},
{ConstString("sh"), " '\"<>()&;"}};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123690.422622.patch
Type: text/x-patch
Size: 2126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220413/b118d602/attachment.bin>
More information about the lldb-commits
mailing list