From 7a37df3fc3b39774004b9e8fcfdc86b579a40c1e Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 4 Apr 2016 22:46:38 +0000 Subject: Improve the way LLDB escapes arguments before passing them to the shell Teach LLDB that different shells have different characters they are sensitive to, and use that knowledge to do shell-aware escaping This helps solve a class of problems on OS X where LLDB would try to launch via sh, and run into problems if the command line being passed to the inferior contained such special markers (hint: the shell would error out and we'd fail to launch) This makes those launch scenarios work transparently via shell expansion Slightly improve the error message when this kind of failure occurs to at least suggest that the user try going through 'process launch' directly Fixes rdar://problem/22749408 llvm-svn: 265357 --- .../launch_with_shellexpand/TestLaunchWithShellExpand.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py index fa90d79b82d..28d8cccacfc 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py @@ -30,7 +30,7 @@ class LaunchWithShellExpandTestCase(TestBase): breakpoint = target.BreakpointCreateBySourceRegex ('break here', lldb.SBFileSpec ("main.cpp", False)) self.assertTrue(breakpoint, VALID_BREAKPOINT) - self.runCmd("process launch -X true -w %s -- fi*.tx?" % (os.getcwd())) + self.runCmd("process launch -X true -w %s -- fi*.tx? () > <" % (os.getcwd())) process = self.process() @@ -51,7 +51,11 @@ class LaunchWithShellExpandTestCase(TestBase): self.expect("frame variable argv[2]", substrs=['file2.txt']) self.expect("frame variable argv[3]", substrs=['file3.txt']) self.expect("frame variable argv[4]", substrs=['file4.txy']) + self.expect("frame variable argv[5]", substrs=['()']) + self.expect("frame variable argv[6]", substrs=['>']) + self.expect("frame variable argv[7]", substrs=['<']) self.expect("frame variable argv[5]", substrs=['file5.tyx'], matching=False) + self.expect("frame variable argv[8]", substrs=['file5.tyx'], matching=False) self.runCmd("process kill") -- cgit v1.2.3