199451b44SJordan Rupprechtimport lldb 299451b44SJordan Rupprechtfrom lldbsuite.test.decorators import * 399451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import * 499451b44SJordan Rupprechtfrom lldbsuite.test import lldbutil 599451b44SJordan Rupprecht 699451b44SJordan Rupprecht 799451b44SJordan Rupprechtclass CPPAcceleratorTableTestCase(TestBase): 899451b44SJordan Rupprecht @skipUnlessDarwin 999451b44SJordan Rupprecht @skipIf(debug_info=no_match(["dwarf"])) 10*379b59d1SFelipe de Azevedo Piovezan @skipIf(dwarf_version=[">=", "5"]) 1199451b44SJordan Rupprecht def test(self): 1299451b44SJordan Rupprecht """Test that type lookups fail early (performance)""" 1399451b44SJordan Rupprecht self.build() 1464c87a94SJonas Devlieghere 152238dcc3SJonas Devlieghere logfile = self.getBuildArtifact("dwarf.log") 1664c87a94SJonas Devlieghere 172238dcc3SJonas Devlieghere self.expect("log enable dwarf lookups -f" + logfile) 1899451b44SJordan Rupprecht target, process, thread, bkpt = lldbutil.run_to_source_breakpoint( 192238dcc3SJonas Devlieghere self, "break here", lldb.SBFileSpec("main.cpp") 202238dcc3SJonas Devlieghere ) 2199451b44SJordan Rupprecht # Pick one from the middle of the list to have a high chance 2299451b44SJordan Rupprecht # of it not being in the first file looked at. 232238dcc3SJonas Devlieghere self.expect("frame variable inner_d") 2499451b44SJordan Rupprecht 25956df6faSRaphael Isemann with open(logfile) as f: 26956df6faSRaphael Isemann log = f.readlines() 2799451b44SJordan Rupprecht n = 0 2899451b44SJordan Rupprecht for line in log: 292238dcc3SJonas Devlieghere if re.findall(r"[abcdefg]\.o: FindByNameAndTag\(\)", line): 303cc37622SDave Lee self.assertIn("d.o", line) 3199451b44SJordan Rupprecht n += 1 3299451b44SJordan Rupprecht 33956df6faSRaphael Isemann self.assertEqual(n, 1, "".join(log)) 34