]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py
Vendor import of lldb trunk r290819:
[FreeBSD/FreeBSD.git] / packages / Python / lldbsuite / test / python_api / default-constructor / sb_frame.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
9 def fuzz_obj(obj):
10     obj.GetFrameID()
11     obj.GetPC()
12     obj.SetPC(0xffffffff)
13     obj.GetSP()
14     obj.GetFP()
15     obj.GetPCAddress()
16     obj.GetSymbolContext(0)
17     obj.GetModule()
18     obj.GetCompileUnit()
19     obj.GetFunction()
20     obj.GetSymbol()
21     obj.GetBlock()
22     obj.GetFunctionName()
23     obj.IsInlined()
24     obj.EvaluateExpression("x + y")
25     obj.EvaluateExpression("x + y", lldb.eDynamicCanRunTarget)
26     obj.GetFrameBlock()
27     obj.GetLineEntry()
28     obj.GetThread()
29     obj.Disassemble()
30     obj.GetVariables(True, True, True, True)
31     obj.GetVariables(True, True, True, False, lldb.eDynamicCanRunTarget)
32     obj.GetRegisters()
33     obj.FindVariable("my_var")
34     obj.FindVariable("my_var", lldb.eDynamicCanRunTarget)
35     obj.FindValue("your_var", lldb.eValueTypeVariableGlobal)
36     obj.FindValue(
37         "your_var",
38         lldb.eValueTypeVariableStatic,
39         lldb.eDynamicCanRunTarget)
40     obj.GetDescription(lldb.SBStream())
41     obj.Clear()