mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 17:01:00 +08:00
Add fuzz calls for SBFrame and SBFunction.
llvm-svn: 133965
This commit is contained in:
@@ -141,6 +141,9 @@ class APIDefaultConstructorTestCase(TestBase):
|
||||
if self.TraceOn():
|
||||
print obj
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_frame
|
||||
sb_frame.fuzz_obj(obj)
|
||||
|
||||
@python_api_test
|
||||
def test_SBFunction(self):
|
||||
@@ -148,6 +151,9 @@ class APIDefaultConstructorTestCase(TestBase):
|
||||
if self.TraceOn():
|
||||
print obj
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_function
|
||||
sb_function.fuzz_obj(obj)
|
||||
|
||||
@python_api_test
|
||||
def test_SBInputReader(self):
|
||||
|
||||
34
lldb/test/python_api/default-constructor/sb_frame.py
Normal file
34
lldb/test/python_api/default-constructor/sb_frame.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import lldb
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetFrameID()
|
||||
obj.GetPC()
|
||||
obj.SetPC(0xffffffff)
|
||||
obj.GetSP()
|
||||
obj.GetFP()
|
||||
obj.GetPCAddress()
|
||||
obj.GetSymbolContext(0)
|
||||
obj.GetModule()
|
||||
obj.GetCompileUnit()
|
||||
obj.GetFunction()
|
||||
obj.GetSymbol()
|
||||
obj.GetBlock()
|
||||
obj.GetFunctionName()
|
||||
obj.IsInlined()
|
||||
obj.EvaluateExpression("x + y")
|
||||
obj.EvaluateExpression("x + y", lldb.eDynamicCanRunTarget)
|
||||
obj.GetFrameBlock()
|
||||
obj.GetLineEntry()
|
||||
obj.GetThread()
|
||||
obj.Disassemble()
|
||||
obj.GetVariables(True, True, True, True)
|
||||
obj.GetVariables(True, True, True, False, lldb.eDynamicCanRunTarget)
|
||||
obj.GetRegisters()
|
||||
obj.FindVariable("my_var")
|
||||
obj.FindVariable("my_var", lldb.eDynamicCanRunTarget)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
19
lldb/test/python_api/default-constructor/sb_function.py
Normal file
19
lldb/test/python_api/default-constructor/sb_function.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import lldb
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetName()
|
||||
obj.GetMangledName()
|
||||
obj.GetInstructions(lldb.SBTarget())
|
||||
sa = obj.GetStartAddress()
|
||||
ea = obj.GetEndAddress()
|
||||
# Do fuzz testing on the address obj, it should not crash lldb.
|
||||
import sb_address
|
||||
sb_address.fuzz_obj(sa)
|
||||
sb_address.fuzz_obj(ea)
|
||||
obj.GetPrologueByteSize
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
Reference in New Issue
Block a user