[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / commands / process / launch-with-shellexpand / TestLaunchWithShellExpand.py
blobfcf61c9775c6354514ebcef8e9afe2d440f5cc9b
1 """
2 Test that argdumper is a viable launching strategy.
3 """
4 import os
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
13 class LaunchWithShellExpandTestCase(TestBase):
14 NO_DEBUG_INFO_TESTCASE = True
16 @expectedFailureAll(
17 oslist=["windows", "linux", "freebsd"],
18 bugnumber="llvm.org/pr24778 llvm.org/pr22627 llvm.org/pr48349",
20 @skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so arg expansion won't happen
21 @expectedFailureNetBSD
22 def test(self):
23 self.build()
24 target = self.createTestTarget()
26 # Create any breakpoints we need
27 breakpoint = target.BreakpointCreateBySourceRegex(
28 "break here", lldb.SBFileSpec("main.cpp", False)
30 self.assertTrue(breakpoint, VALID_BREAKPOINT)
32 # Ensure we do the expansion with /bin/sh on POSIX.
33 os.environ["SHELL"] = "/bin/sh"
35 self.runCmd(
36 "process launch -X true -w %s -- fi*.tx? () > <" % (self.getSourceDir())
39 process = self.process()
41 self.assertState(
42 process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT
45 thread = process.GetThreadAtIndex(0)
47 self.assertTrue(
48 thread.IsValid(), "Process stopped at 'main' should have a valid thread"
51 stop_reason = thread.GetStopReason()
53 self.assertEqual(
54 stop_reason,
55 lldb.eStopReasonBreakpoint,
56 "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint",
59 self.expect_var_path("argv[1]", summary='"file1.txt"')
60 self.expect_var_path("argv[2]", summary='"file2.txt"')
61 self.expect_var_path("argv[3]", summary='"file3.txt"')
62 self.expect_var_path("argv[4]", summary='"file4.txy"')
63 self.expect_var_path("argv[5]", summary='"()"')
64 self.expect_var_path("argv[6]", summary='">"')
65 self.expect_var_path("argv[7]", summary='"<"')
66 self.expect_var_path("argc", value="8")
68 self.runCmd("process kill")
70 self.runCmd('process launch -X true -w %s -- "foo bar"' % (self.getSourceDir()))
72 process = self.process()
74 self.assertState(
75 process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT
78 thread = process.GetThreadAtIndex(0)
80 self.assertTrue(
81 thread.IsValid(), "Process stopped at 'main' should have a valid thread"
84 stop_reason = thread.GetStopReason()
86 self.assertEqual(
87 stop_reason,
88 lldb.eStopReasonBreakpoint,
89 "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint",
92 self.expect("frame variable argv[1]", substrs=["foo bar"])
94 self.runCmd("process kill")
96 self.runCmd("process launch -X true -w %s -- foo\ bar" % (self.getBuildDir()))
98 process = self.process()
100 self.assertState(
101 process.GetState(), lldb.eStateStopped, STOPPED_DUE_TO_BREAKPOINT
104 thread = process.GetThreadAtIndex(0)
106 self.assertTrue(
107 thread.IsValid(), "Process stopped at 'main' should have a valid thread"
110 stop_reason = thread.GetStopReason()
112 self.assertEqual(
113 stop_reason,
114 lldb.eStopReasonBreakpoint,
115 "Thread in process stopped in 'main' should have a stop reason of eStopReasonBreakpoint",
118 self.expect("frame variable argv[1]", substrs=["foo bar"])