]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py
Vendor import of lldb trunk r256945:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / default-constructor / sb_module.py
1 """
2 Fuzz tests an object after the default construction to make sure it does not crash lldb.
3 """
4
5 import sys
6 import lldb
7
8 def fuzz_obj(obj):
9     obj.GetFileSpec()
10     obj.GetPlatformFileSpec()
11     obj.SetPlatformFileSpec(lldb.SBFileSpec())
12     obj.GetUUIDString()
13     obj.ResolveFileAddress(sys.maxsize)
14     obj.ResolveSymbolContextForAddress(lldb.SBAddress(), 0)
15     obj.GetDescription(lldb.SBStream())
16     obj.GetNumSymbols()
17     obj.GetSymbolAtIndex(sys.maxsize)
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         s = str(section)
23     for symbol in obj.symbol_in_section_iter(lldb.SBSection()):
24         s = str(symbol)
25     for symbol in obj:
26         s = str(symbol)
27     obj.GetAddressByteSize()
28     obj.GetByteOrder()
29     obj.GetTriple()