[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / commands / process / attach / attach_denied / TestAttachDenied.py
blobdcd73da42e9e8e12482d15010f3592d617ccc89c
1 """
2 Test denied process attach.
3 """
7 import time
8 import lldb
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
13 exe_name = 'AttachDenied' # Must match Makefile
16 class AttachDeniedTestCase(TestBase):
18 mydir = TestBase.compute_mydir(__file__)
19 NO_DEBUG_INFO_TESTCASE = True
21 @skipIfWindows
22 @skipIfiOSSimulator
23 @skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc
24 def test_attach_to_process_by_id_denied(self):
25 """Test attach by process id denied"""
26 self.build()
27 exe = self.getBuildArtifact(exe_name)
29 # Use a file as a synchronization point between test and inferior.
30 pid_file_path = lldbutil.append_to_process_working_directory(self,
31 "pid_file_%d" % (int(time.time())))
32 self.addTearDownHook(
33 lambda: self.run_platform_command(
34 "rm %s" %
35 (pid_file_path)))
37 # Spawn a new process
38 popen = self.spawnSubprocess(exe, [pid_file_path])
39 self.addTearDownHook(self.cleanupSubprocesses)
41 pid = lldbutil.wait_for_file_on_target(self, pid_file_path)
43 self.expect('process attach -p ' + pid,
44 startstr='error: attach failed:',
45 error=True)