aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/commands/target/anon-struct/TestTargetVarAnonStruct.py
blob: 869081dc6e5e4ca1d7e7e173e05ad4047e5a5116 (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
"""
Test handling of Anonymous Structs, especially that they don't crash lldb.
"""


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


class TestFrameVarAnonStruct(TestBase):
    # If your test case doesn't stress debug info, then
    # set this to true.  That way it won't be run once for
    # each debug info format.
    NO_DEBUG_INFO_TESTCASE = True

    def test_frame_var(self):
        self.build()
        self.do_test()

    def do_test(self):
        target = self.createTestTarget()

        # Verify that we don't crash in this case.
        self.expect(
            "target variable 'b.x'",
            error=True,
            substrs=["can't find global variable 'b.x'"],
        )