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