1""" 2Fuzz tests an object after the default construction to make sure it does not crash lldb. 3""" 4 5import sys 6import lldb 7 8def fuzz_obj(obj): 9 obj.GetFileSpec() 10 obj.GetPlatformFileSpec() 11 obj.SetPlatformFileSpec(lldb.SBFileSpec()) 12 obj.GetUUIDString() 13 obj.ResolveFileAddress(sys.maxint) 14 obj.ResolveSymbolContextForAddress(lldb.SBAddress(), 0) 15 obj.GetDescription(lldb.SBStream()) 16 obj.GetNumSymbols() 17 obj.GetSymbolAtIndex(sys.maxint) 18 sc_list = obj.FindFunctions("my_func") 19 sc_list = obj.FindFunctions("my_func", lldb.eFunctionNameTypeAny) 20 obj.FindGlobalVariables(lldb.SBTarget(), "my_global_var", 1) 21 for section in obj.section_iter(): 22 print section 23 for symbol in obj.symbol_in_section_iter(lldb.SBSection()): 24 print symbol 25 for symbol in obj: 26 print symbol 27 obj.GetAddressByteSize() 28 obj.GetByteOrder() 29 obj.GetTriple() 30