brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 2d108df Raw
46 lines · python
1"""2Test that target var can resolve complex DWARF expressions.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test import lldbutil9 10 11class targetCommandTestCase(TestBase):12    @skipIfDarwinEmbedded  # needs x86_6413    @skipIf(debug_info="gmodules")  # not relevant14    @skipIf(compiler="clang", compiler_version=["<", "7.0"])15    def testTargetVarExpr(self):16        self.build()17        lldbutil.run_to_name_breakpoint(self, "main")18        self.expect(19            "help target variable",20            substrs=[21                "--no-args",22                "--no-recognized-args",23                "--no-locals",24                "--show-globals",25            ],26            matching=False,27        )28        self.expect("target variable i", substrs=["i", "42"])29        self.expect(30            "target variable var", patterns=[r"\(incomplete \*\) var = 0[xX](0)*dead"]31        )32        self.expect(33            "target variable var[0]",34            error=True,35            substrs=["can't find global variable 'var[0]'"],36        )37 38        command_result = lldb.SBCommandReturnObject()39        result = self.ci.HandleCommand("target var", command_result)40        value_list = command_result.GetValues(lldb.eNoDynamicValues)41        self.assertGreaterEqual(value_list.GetSize(), 2)42        value_names = []43        for value in value_list:44            value_names.append(value.GetName())45        self.assertIn("i", value_names)46