summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py
blob: 3657dd744caf33fae02af06f483a5255ab67bdbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Test process attach/resume.
"""

from __future__ import print_function


import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil

class TestDeletedExecutable(TestBase):

    mydir = TestBase.compute_mydir(__file__)
    NO_DEBUG_INFO_TESTCASE = True

    @skipIfWindows # cannot delete a running executable
    @expectedFailureAll(oslist=["linux"]) # determining the architecture of the process fails
    @expectedFailureNetBSD
    def test(self):
        self.build()
        exe = self.getBuildArtifact("a.out")

        popen = self.spawnSubprocess(exe)
        self.addTearDownHook(self.cleanupSubprocesses)
        os.remove(exe)

        self.runCmd("process attach -p " + str(popen.pid))
        self.runCmd("kill")
OpenPOWER on IntegriCloud