aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/objc/struct-description/TestObjCStructDescription.py
blob: b6dc7637b45eb081d3573a4c4ba401e875f1dbce (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
33
34
35
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil


class TestCase(TestBase):
    def test(self):
        self.build()
        lldbutil.run_to_source_breakpoint(self, "break here", lldb.SBFileSpec("main.m"))

        log = self.getBuildArtifact("expr.log")
        self.runCmd(f"log enable lldb expr -f {log}")

        self.expect(
            "vo pair",
            substrs=[
                "warning: `po` was unsuccessful, running `p` instead\n",
                "(Pair) pair = (f = 2, e = 3)",
            ],
        )
        self.filecheck(f"platform shell cat {log}", __file__, f"-check-prefix=CHECK-VO")
        # CHECK-VO: Object description fallback due to error: not a pointer type

        self.expect(
            "expr -O -- pair",
            substrs=[
                "warning: `po` was unsuccessful, running `p` instead\n",
                "(Pair)  (f = 2, e = 3)",
            ],
        )
        self.filecheck(
            f"platform shell cat {log}", __file__, f"-check-prefix=CHECK-EXPR"
        )
        # CHECK-EXPR: Object description fallback due to error: not a pointer type