def test_SBCompileUnit(self): obj = lldb.SBCompileUnit() if self.TraceOn(): print obj self.assertFalse(obj) # Do fuzz testing on the invalid obj, it should not crash lldb. import sb_compileunit sb_compileunit.fuzz_obj(obj)
def find_comp_unit(self, exe_module, name): num_comp_units = exe_module.GetNumCompileUnits() index = 0 result = lldb.SBCompileUnit() while index < num_comp_units: comp_unit = exe_module.GetCompileUnitAtIndex(index) if comp_unit.GetFileSpec().GetFilename() == name: result = comp_unit break index += 1 self.assertTrue(result.IsValid()) return result