llvm-project/lldb/source/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
..
ARM64_DWARF_Registers.h [LLDB] Update AArch64 Dwarf and EH frame register numbers 2020-07-10 11:45:39 +05:00
ARM64_ehframe_Registers.h [LLDB] Update AArch64 Dwarf and EH frame register numbers 2020-07-10 11:45:39 +05:00
ARM_DWARF_Registers.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
ARM_ehframe_Registers.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
ArchSpec.cpp NFC put the armv6m entry with the other Cortex-M entries 2021-04-15 02:02:26 -07:00
Args.cpp [lldb] Add support for escaping zsh arguments 2021-06-21 19:46:55 +02:00
Baton.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Broadcaster.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
CMakeLists.txt [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
CompletionRequest.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Connection.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
ConstString.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
DataBufferHeap.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
DataBufferLLVM.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
DataEncoder.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
DataExtractor.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
Environment.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Event.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
FileSpec.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
GDBRemote.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
IOObject.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
LLDBAssert.cpp [lldb] Include llvm-config.h instead of config.h 2021-03-29 08:58:51 -07:00
Listener.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Log.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Logging.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
NameMatches.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
PPC64LE_DWARF_Registers.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
PPC64_DWARF_Registers.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00
ProcessInfo.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
RegisterValue.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
RegularExpression.cpp [lldb] Improve error message when --func-regex parameter for the breakpoint command is invalid 2020-04-27 09:55:06 +02:00
Reproducer.cpp [lldb] Remove LLDB_CAPTURE_REPRODUCER override 2021-03-31 21:10:56 -07:00
ReproducerInstrumentation.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
ReproducerProvider.cpp [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
Scalar.cpp [lldb] Fix compilation after removal of APInt::toString 2021-06-11 16:20:57 +02:00
SelectHelper.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
State.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Status.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
Stream.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
StreamCallback.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StreamString.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
StringExtractor.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
StringExtractorGDBRemote.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
StringLexer.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
StringList.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
StructuredData.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
TildeExpressionResolver.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Timer.cpp Allow signposts to take advantage of deferred string substitution 2021-06-14 16:53:41 -07:00
TraceGDBRemotePackets.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
TraceIntelPTGDBRemotePackets.cpp [trace][intel-pt] Implement trace start and trace stop 2021-03-30 17:31:37 -07:00
UUID.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UnimplementedError.cpp [lldb/Utility] Introduce UnimplementedError 2020-10-12 13:46:17 +02:00
UriParser.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UserID.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
UserIDResolver.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
UuidCompatibility.h
VASprintf.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
VMRange.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
XcodeSDK.cpp [lldb] Eliminate unneeded value parameters in Utility (NFC) 2020-07-22 13:56:23 -07:00