[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / commands / process / attach / attach_denied / TestAttachDenied.py
blob22dca62045022e5a0147ecd99f6ee1b61b61cd9a
1 """
2 Test denied process attach.
3 """
6 import time
7 import lldb
8 from lldbsuite.test.decorators import *
9 from lldbsuite.test.lldbtest import *
10 from lldbsuite.test import lldbutil
12 exe_name = "AttachDenied" # Must match Makefile
15 class AttachDeniedTestCase(TestBase):
16 NO_DEBUG_INFO_TESTCASE = True
18 @skipIfWindows
19 @skipIfiOSSimulator
20 @skipIfDarwinEmbedded # ptrace(ATTACH_REQUEST...) won't work on ios/tvos/etc
21 def test_attach_to_process_by_id_denied(self):
22 """Test attach by process id denied"""
23 self.build()
24 exe = self.getBuildArtifact(exe_name)
26 # Use a file as a synchronization point between test and inferior.
27 pid_file_path = lldbutil.append_to_process_working_directory(
28 self, "pid_file_%d" % (int(time.time()))
30 self.addTearDownHook(
31 lambda: self.run_platform_command("rm %s" % (pid_file_path))
34 # Spawn a new process
35 popen = self.spawnSubprocess(exe, [pid_file_path])
37 pid = lldbutil.wait_for_file_on_target(self, pid_file_path)
39 self.expect(
40 "process attach -p " + pid, startstr="error: attach failed:", error=True