]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / expression_command / two-files / TestObjCTypeQueryFromOtherCompileUnit.py
1 """
2 Regression test for <rdar://problem/8981098>:
3
4 The expression parser's type search only looks in the current compilation unit for types.
5 """
6
7 from __future__ import print_function
8
9
10 import lldb
11 from lldbsuite.test.decorators import *
12 from lldbsuite.test.lldbtest import *
13 from lldbsuite.test import lldbutil
14
15
16 class ObjCTypeQueryTestCase(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 for main.m.
24         self.line = line_number(
25             'main.m', "// Set breakpoint here, then do 'expr (NSArray*)array_token'.")
26
27     @skipUnlessDarwin
28     def test(self):
29         """The expression parser's type search should be wider than the current compilation unit."""
30         self.build()
31         self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
32
33         lldbutil.run_break_set_by_file_and_line(
34             self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
35
36         self.runCmd("run", RUN_SUCCEEDED)
37
38         # Now do a NSArry type query from the 'main.m' compile uint.
39         self.expect("expression (NSArray*)array_token",
40                     substrs=['(NSArray *) $0 = 0x'])
41         # (NSArray *) $0 = 0x00007fff70118398