llvm-project/lldb/unittests/Utility
Raphael Isemann c197cddb16 [lldb] Add support for escaping zsh arguments
LLDB supports having globbing regexes in the process launch arguments that will
be resolved using the user's shell. This requires that we pass the launch args
to the shell and then read back the expanded arguments using LLDB's argdumper
utility.

As the shell will not just expand the globbing regexes but all special
characters, we need to escape all non-globbing charcters such as $, &, <, >,
etc. as those otherwise are interpreted and removed in the step where we expand
the globbing characters. Also because the special characters are shell-specific,
LLDB needs to maintain a list of all the characters that need to be escaped for
each specific shell.

This patch adds the list of special characters that need to be escaped for
`zsh`. Without this patch on systems where `zsh` is the user's shell (like on
all macOS systems) having any of these special characters in your arguments or
path to the binary will cause the process launch to fail. E.g., `lldb -- ./calc
1<2` is failing without this patch. The same happens if the absolute path to
`calc` is in a directory that contains for example parentheses or other special
characters.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D104627
2021-06-21 19:46:55 +02:00
..
Inputs
AnsiTerminalTest.cpp
ArchSpecTest.cpp Correctly detect legacy iOS simulator Mach-O objectfiles 2020-08-06 12:40:45 -07:00
ArgsTest.cpp [lldb] Add support for escaping zsh arguments 2021-06-21 19:46:55 +02:00
BroadcasterTest.cpp
CMakeLists.txt [lldb] [server] Support for multiprocess extension 2021-03-30 15:09:27 +02:00
CompletionRequestTest.cpp [lldb] Cut off unused suffix in CompletionRequest::GetRawLine 2020-01-28 11:12:22 +01:00
ConstStringTest.cpp [lldb/Utility] Add YAML traits for ConstString and FileSpec. 2020-03-12 10:28:21 -07:00
DataExtractorTest.cpp [lldb] Fix unaligned load in DataExtractor 2020-07-07 10:13:41 -07:00
EnvironmentTest.cpp
EventTest.cpp [ADT] Make StringRef's std::string conversion operator explicit 2020-01-28 23:47:07 +01:00
FileSpecTest.cpp [lldb] Fix incorrect test data in FileSpecTest.IsRelative 2021-04-15 12:42:47 +02:00
FlagsTest.cpp
ListenerTest.cpp
LogTest.cpp
NameMatchesTest.cpp
OptionsWithRawTest.cpp
PredicateTest.cpp
ProcessInfoTest.cpp
ProcessInstanceInfoTest.cpp [lldb] Add YAML traits for ArchSpec and ProcessInstanceInfo 2020-03-12 14:38:37 -07:00
RangeMapTest.cpp [lldb/Utility] Fix a bug in RangeMap::CombineConsecutiveRanges 2020-07-27 10:06:56 +02:00
RangeTest.cpp
RegisterValueTest.cpp [lldb][NFC] Remove unused 'using ArrayRef' in RegisterValueTest 2021-06-03 11:17:36 +02:00
RegularExpressionTest.cpp
ReproducerInstrumentationTest.cpp [lldb] Fix compilation with gcc-6.5 2021-04-01 08:44:50 +02:00
ReproducerTest.cpp [lldb] Extract reproducer providers & co into their own header. 2020-08-22 10:04:27 -07:00
ScalarTest.cpp [lldb/Utility] Use APSInt in the Scalar class 2020-08-27 15:05:47 +02:00
SharedClusterTest.cpp [lldb] Delete the SharingPtr class 2020-02-11 13:23:18 +01:00
StateTest.cpp
StatusTest.cpp [LLDB] On Windows, fix tests 2020-10-08 11:46:59 -04:00
StreamTeeTest.cpp
StreamTest.cpp [lldb][NFC] Remove Stream::Indent(const char *) overload in favor of the StringRef version 2020-02-11 13:29:32 +01:00
StringExtractorGDBRemoteTest.cpp [lldb] [server] Support for multiprocess extension 2021-03-30 15:09:27 +02:00
StringExtractorTest.cpp
StringLexerTest.cpp
StringListTest.cpp
StructuredDataTest.cpp
SubsystemRAIITest.cpp
TildeExpressionResolverTest.cpp [lldb] Return the original path when tilde expansion fails. 2020-12-02 16:01:30 -08:00
TimeoutTest.cpp
TimerTest.cpp [lldb] Fix unit test parsing to handle CR+LF as well as LF 2020-08-12 13:56:16 -07:00
UUIDTest.cpp Support build-ids of other sizes than 16 in UUID::SetFromStringRef 2020-06-07 10:03:41 +00:00
UriParserTest.cpp [LLDB] Fix parsing of IPv6 host:port inside brackets 2020-03-26 11:35:54 +01:00
UserIDResolverTest.cpp
VASprintfTest.cpp
VMRangeTest.cpp
XcodeSDKTest.cpp Move GetXcode*Directory into HostInfo (NFC) 2020-06-05 11:59:22 -07:00