brintos

brintos / llvm-project-archived public Read only

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