]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
Vendor import of lldb release_39 branch r276489:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / functionalities / apropos_with_process / TestAproposWithProcess.py
1 """
2 Test that apropos env doesn't crash trying to touch the process plugin commmand
3 """
4
5 from __future__ import print_function
6
7
8
9 import os, time
10 import re
11 import lldb
12 from lldbsuite.test.lldbtest import *
13 import lldbsuite.test.lldbutil as lldbutil
14
15 class AproposWithProcessTestCase(TestBase):
16
17     mydir = TestBase.compute_mydir(__file__)
18
19     def setUp(self):
20         # Call super's setUp().
21         TestBase.setUp(self)
22         # Find the line number to break inside main().
23         self.line = line_number('main.cpp', '// break here')
24
25     def test_apropos_with_process(self):
26         """Test that apropos env doesn't crash trying to touch the process plugin commmand."""
27         self.build()
28         exe = os.path.join(os.getcwd(), "a.out")
29         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
30
31         # Break in main() aftre the variables are assigned values.
32         lldbutil.run_break_set_by_file_and_line (self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
33
34         self.runCmd("run", RUN_SUCCEEDED)
35
36         # The stop reason of the thread should be breakpoint.
37         self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
38             substrs = ['stopped', 'stop reason = breakpoint'])
39
40         # The breakpoint should have a hit count of 1.
41         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
42             substrs = [' resolved, hit count = 1'])
43
44         self.runCmd('apropos env')