[lldb][test] Remove symlink for API tests.
Summary: Moves lldbsuite tests to lldb/test/API.
This is a largely mechanical change, moved with the following steps:
```
rm lldb/test/API/testcases
mkdir -p lldb/test/API/{test_runner/test,tools/lldb-{server,vscode}}
mv lldb/packages/Python/lldbsuite/test/test_runner/test lldb/test/API/test_runner
for d in $(find lldb/packages/Python/lldbsuite/test/* -maxdepth 0 -type d | egrep -v "make|plugins|test_runner|tools"); do mv $d lldb/test/API; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-vscode -maxdepth 1 -mindepth 1 | grep -v ".py"); do mv $d lldb/test/API/tools/lldb-vscode; done
for d in $(find lldb/packages/Python/lldbsuite/test/tools/lldb-server -maxdepth 1 -mindepth 1 | egrep -v "gdbremote_testcase.py|lldbgdbserverutils.py|socket_packet_pump.py"); do mv $d lldb/test/API/tools/lldb-server; done
```
lldb/packages/Python/lldbsuite/__init__.py and lldb/test/API/lit.cfg.py were also updated with the new directory structure.
Reviewers: labath, JDevlieghere
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71151
This commit is contained in:
@@ -0,0 +1,398 @@
|
||||
"""
|
||||
Test lldb Python API object's default constructor and make sure it is invalid
|
||||
after initial construction.
|
||||
|
||||
There are also some cases of boundary condition testings sprinkled throughout
|
||||
the tests where None is passed to SB API which expects (const char *) in the
|
||||
C++ API counterpart. Passing None should not crash lldb!
|
||||
|
||||
There are three exceptions to the above general rules, though; API objects
|
||||
SBCommadnReturnObject, SBStream, and SBSymbolContextList, are all valid objects
|
||||
after default construction.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
import lldb
|
||||
from lldbsuite.test.decorators import *
|
||||
from lldbsuite.test.lldbtest import *
|
||||
from lldbsuite.test import lldbutil
|
||||
|
||||
|
||||
class APIDefaultConstructorTestCase(TestBase):
|
||||
|
||||
mydir = TestBase.compute_mydir(__file__)
|
||||
NO_DEBUG_INFO_TESTCASE = True
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBAddress(self):
|
||||
obj = lldb.SBAddress()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_address
|
||||
sb_address.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBBlock(self):
|
||||
obj = lldb.SBBlock()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_block
|
||||
sb_block.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBBreakpoint(self):
|
||||
obj = lldb.SBBreakpoint()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_breakpoint
|
||||
sb_breakpoint.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBBreakpointLocation(self):
|
||||
obj = lldb.SBBreakpointLocation()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_breakpointlocation
|
||||
sb_breakpointlocation.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBBreakpointName(self):
|
||||
obj = lldb.SBBreakpointName()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_breakpointname
|
||||
sb_breakpointname.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBBroadcaster(self):
|
||||
obj = lldb.SBBroadcaster()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_broadcaster
|
||||
sb_broadcaster.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBCommandReturnObject(self):
|
||||
"""SBCommandReturnObject object is valid after default construction."""
|
||||
obj = lldb.SBCommandReturnObject()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertTrue(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBCommunication(self):
|
||||
obj = lldb.SBCommunication()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_communication
|
||||
sb_communication.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBCompileUnit(self):
|
||||
obj = lldb.SBCompileUnit()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_compileunit
|
||||
sb_compileunit.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBDebugger(self):
|
||||
obj = lldb.SBDebugger()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_debugger
|
||||
sb_debugger.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
# darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail
|
||||
# with 2.0.12 http://llvm.org/pr23488
|
||||
def test_SBError(self):
|
||||
obj = lldb.SBError()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_error
|
||||
sb_error.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBEvent(self):
|
||||
obj = lldb.SBEvent()
|
||||
# This is just to test that typemap, as defined in lldb.swig, works.
|
||||
obj2 = lldb.SBEvent(0, "abc")
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_event
|
||||
sb_event.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBFileSpec(self):
|
||||
obj = lldb.SBFileSpec()
|
||||
# This is just to test that FileSpec(None) does not crash.
|
||||
obj2 = lldb.SBFileSpec(None, True)
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_filespec
|
||||
sb_filespec.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBFrame(self):
|
||||
obj = lldb.SBFrame()
|
||||
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)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBFunction(self):
|
||||
obj = lldb.SBFunction()
|
||||
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)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBFile(self):
|
||||
sbf = lldb.SBFile()
|
||||
self.assertFalse(sbf.IsValid())
|
||||
self.assertFalse(bool(sbf))
|
||||
e, n = sbf.Write(b'foo')
|
||||
self.assertTrue(e.Fail())
|
||||
self.assertEqual(n, 0)
|
||||
buffer = bytearray(100)
|
||||
e, n = sbf.Read(buffer)
|
||||
self.assertEqual(n, 0)
|
||||
self.assertTrue(e.Fail())
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBInstruction(self):
|
||||
obj = lldb.SBInstruction()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_instruction
|
||||
sb_instruction.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBInstructionList(self):
|
||||
obj = lldb.SBInstructionList()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_instructionlist
|
||||
sb_instructionlist.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBLineEntry(self):
|
||||
obj = lldb.SBLineEntry()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_lineentry
|
||||
sb_lineentry.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBListener(self):
|
||||
obj = lldb.SBListener()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_listener
|
||||
sb_listener.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
# Py3 asserts due to a bug in SWIG. Trying to upstream a patch to fix
|
||||
# this in 3.0.8
|
||||
@skipIf(py_version=['>=', (3, 0)], swig_version=['<', (3, 0, 8)])
|
||||
def test_SBModule(self):
|
||||
obj = lldb.SBModule()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_module
|
||||
sb_module.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBProcess(self):
|
||||
obj = lldb.SBProcess()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_process
|
||||
sb_process.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBProcessInfo(self):
|
||||
obj = lldb.SBProcessInfo()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_process_info
|
||||
sb_process_info.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBSection(self):
|
||||
obj = lldb.SBSection()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_section
|
||||
sb_section.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBStream(self):
|
||||
"""SBStream object is valid after default construction."""
|
||||
obj = lldb.SBStream()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertTrue(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBStringList(self):
|
||||
obj = lldb.SBStringList()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_stringlist
|
||||
sb_stringlist.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBSymbol(self):
|
||||
obj = lldb.SBSymbol()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_symbol
|
||||
sb_symbol.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBSymbolContext(self):
|
||||
obj = lldb.SBSymbolContext()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_symbolcontext
|
||||
sb_symbolcontext.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBSymbolContextList(self):
|
||||
"""SBSymbolContextList object is valid after default construction."""
|
||||
obj = lldb.SBSymbolContextList()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertTrue(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBTarget(self):
|
||||
obj = lldb.SBTarget()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_target
|
||||
sb_target.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBThread(self):
|
||||
obj = lldb.SBThread()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_thread
|
||||
sb_thread.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBType(self):
|
||||
try:
|
||||
obj = lldb.SBType()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# If we reach here, the test fails.
|
||||
self.fail("lldb.SBType() should fail, not succeed!")
|
||||
except:
|
||||
# Exception is expected.
|
||||
return
|
||||
|
||||
# Unreachable code because lldb.SBType() should fail.
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_type
|
||||
sb_type.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBTypeList(self):
|
||||
"""SBTypeList object is valid after default construction."""
|
||||
obj = lldb.SBTypeList()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertTrue(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBValue(self):
|
||||
obj = lldb.SBValue()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_value
|
||||
sb_value.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBValueList(self):
|
||||
obj = lldb.SBValueList()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_valuelist
|
||||
sb_valuelist.fuzz_obj(obj)
|
||||
|
||||
@add_test_categories(['pyapi'])
|
||||
def test_SBWatchpoint(self):
|
||||
obj = lldb.SBWatchpoint()
|
||||
if self.TraceOn():
|
||||
print(obj)
|
||||
self.assertFalse(obj)
|
||||
# Do fuzz testing on the invalid obj, it should not crash lldb.
|
||||
import sb_watchpoint
|
||||
sb_watchpoint.fuzz_obj(obj)
|
||||
23
lldb/test/API/python_api/default-constructor/sb_address.py
Normal file
23
lldb/test/API/python_api/default-constructor/sb_address.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
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.GetFileAddress()
|
||||
obj.GetLoadAddress(lldb.SBTarget())
|
||||
obj.SetLoadAddress(0xffff, lldb.SBTarget())
|
||||
obj.OffsetAddress(sys.maxsize)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.GetSection()
|
||||
obj.GetSymbolContext(lldb.eSymbolContextEverything)
|
||||
obj.GetModule()
|
||||
obj.GetCompileUnit()
|
||||
obj.GetFunction()
|
||||
obj.GetBlock()
|
||||
obj.GetSymbol()
|
||||
obj.GetLineEntry()
|
||||
obj.Clear()
|
||||
17
lldb/test/API/python_api/default-constructor/sb_block.py
Normal file
17
lldb/test/API/python_api/default-constructor/sb_block.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.IsInlined()
|
||||
obj.GetInlinedName()
|
||||
obj.GetInlinedCallSiteFile()
|
||||
obj.GetInlinedCallSiteLine()
|
||||
obj.GetInlinedCallSiteColumn()
|
||||
obj.GetParent()
|
||||
obj.GetSibling()
|
||||
obj.GetFirstChild()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
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.GetID()
|
||||
obj.ClearAllBreakpointSites()
|
||||
obj.FindLocationByAddress(sys.maxsize)
|
||||
obj.FindLocationIDByAddress(sys.maxsize)
|
||||
obj.FindLocationByID(0)
|
||||
obj.GetLocationAtIndex(0)
|
||||
obj.SetEnabled(True)
|
||||
obj.IsEnabled()
|
||||
obj.GetHitCount()
|
||||
obj.SetIgnoreCount(1)
|
||||
obj.GetIgnoreCount()
|
||||
obj.SetCondition("i >= 10")
|
||||
obj.GetCondition()
|
||||
obj.SetThreadID(0)
|
||||
obj.GetThreadID()
|
||||
obj.SetThreadIndex(0)
|
||||
obj.GetThreadIndex()
|
||||
obj.SetThreadName("worker thread")
|
||||
obj.GetThreadName()
|
||||
obj.SetQueueName("my queue")
|
||||
obj.GetQueueName()
|
||||
obj.SetScriptCallbackFunction(None)
|
||||
obj.SetScriptCallbackBody(None)
|
||||
obj.GetNumResolvedLocations()
|
||||
obj.GetNumLocations()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
for bp_loc in obj:
|
||||
s = str(bp_loc)
|
||||
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetAddress()
|
||||
obj.GetLoadAddress()
|
||||
obj.SetEnabled(True)
|
||||
obj.IsEnabled()
|
||||
obj.SetCondition("i >= 10")
|
||||
obj.GetCondition()
|
||||
obj.SetThreadID(0)
|
||||
obj.GetThreadID()
|
||||
obj.SetThreadIndex(0)
|
||||
obj.GetThreadIndex()
|
||||
obj.SetThreadName("worker thread")
|
||||
obj.GetThreadName()
|
||||
obj.SetQueueName("my queue")
|
||||
obj.GetQueueName()
|
||||
obj.IsResolved()
|
||||
obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelVerbose)
|
||||
breakpoint = obj.GetBreakpoint()
|
||||
# Do fuzz testing on the breakpoint obj, it should not crash lldb.
|
||||
import sb_breakpoint
|
||||
sb_breakpoint.fuzz_obj(breakpoint)
|
||||
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.IsValid()
|
||||
obj.GetName()
|
||||
obj.SetEnabled(True)
|
||||
obj.IsEnabled()
|
||||
obj.SetOneShot(True)
|
||||
obj.IsOneShot()
|
||||
obj.SetIgnoreCount(1)
|
||||
obj.GetIgnoreCount()
|
||||
obj.SetCondition("1 == 2")
|
||||
obj.GetCondition()
|
||||
obj.SetAutoContinue(False)
|
||||
obj.GetAutoContinue()
|
||||
obj.SetThreadID(0x1234)
|
||||
obj.GetThreadID()
|
||||
obj.SetThreadIndex(10)
|
||||
obj.GetThreadIndex()
|
||||
obj.SetThreadName("AThread")
|
||||
obj.GetThreadName()
|
||||
obj.SetQueueName("AQueue")
|
||||
obj.GetQueueName()
|
||||
obj.SetScriptCallbackFunction("AFunction")
|
||||
commands = lldb.SBStringList()
|
||||
obj.SetCommandLineCommands(commands)
|
||||
obj.GetCommandLineCommands(commands)
|
||||
obj.SetScriptCallbackBody("Insert Python Code here")
|
||||
obj.GetAllowList()
|
||||
obj.SetAllowList(False)
|
||||
obj.GetAllowDelete()
|
||||
obj.SetAllowDelete(False)
|
||||
obj.GetAllowDisable()
|
||||
obj.SetAllowDisable(False)
|
||||
stream = lldb.SBStream()
|
||||
obj.GetDescription(stream)
|
||||
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.BroadcastEventByType(lldb.eBreakpointEventTypeInvalidType, True)
|
||||
obj.BroadcastEvent(lldb.SBEvent(), False)
|
||||
listener = lldb.SBListener("fuzz_testing")
|
||||
obj.AddInitialEventsToListener(listener, 0xffffffff)
|
||||
obj.AddInitialEventsToListener(listener, 0)
|
||||
obj.AddListener(listener, 0xffffffff)
|
||||
obj.AddListener(listener, 0)
|
||||
obj.GetName()
|
||||
obj.EventTypeHasListeners(0)
|
||||
obj.RemoveListener(listener, 0xffffffff)
|
||||
obj.RemoveListener(listener, 0)
|
||||
obj.Clear()
|
||||
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
broadcaster = obj.GetBroadcaster()
|
||||
# Do fuzz testing on the broadcaster obj, it should not crash lldb.
|
||||
import sb_broadcaster
|
||||
sb_broadcaster.fuzz_obj(broadcaster)
|
||||
obj.AdoptFileDesriptor(0, False)
|
||||
obj.AdoptFileDesriptor(1, False)
|
||||
obj.AdoptFileDesriptor(2, False)
|
||||
obj.Connect("file:/tmp/myfile")
|
||||
obj.Connect(None)
|
||||
obj.Disconnect()
|
||||
obj.IsConnected()
|
||||
obj.GetCloseOnEOF()
|
||||
obj.SetCloseOnEOF(True)
|
||||
obj.SetCloseOnEOF(False)
|
||||
#obj.Write(None, sys.maxint, None)
|
||||
#obj.Read(None, sys.maxint, 0xffffffff, None)
|
||||
obj.ReadThreadStart()
|
||||
obj.ReadThreadStop()
|
||||
obj.ReadThreadIsRunning()
|
||||
obj.SetReadThreadBytesReceivedCallback(None, None)
|
||||
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetFileSpec()
|
||||
obj.GetNumLineEntries()
|
||||
obj.GetLineEntryAtIndex(0xffffffff)
|
||||
obj.FindLineEntryIndex(0, 0xffffffff, None)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
len(obj)
|
||||
for line_entry in obj:
|
||||
s = str(line_entry)
|
||||
63
lldb/test/API/python_api/default-constructor/sb_debugger.py
Normal file
63
lldb/test/API/python_api/default-constructor/sb_debugger.py
Normal file
@@ -0,0 +1,63 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.SetAsync(True)
|
||||
obj.SetAsync(False)
|
||||
obj.GetAsync()
|
||||
obj.SkipLLDBInitFiles(True)
|
||||
obj.SetInputFileHandle(None, True)
|
||||
obj.SetOutputFileHandle(None, True)
|
||||
obj.SetErrorFileHandle(None, True)
|
||||
obj.GetInputFileHandle()
|
||||
obj.GetOutputFileHandle()
|
||||
obj.GetErrorFileHandle()
|
||||
obj.GetCommandInterpreter()
|
||||
obj.HandleCommand("nothing here")
|
||||
listener = obj.GetListener()
|
||||
try:
|
||||
obj.HandleProcessEvent(lldb.SBProcess(), lldb.SBEvent(), None, None)
|
||||
except Exception:
|
||||
pass
|
||||
obj.CreateTargetWithFileAndTargetTriple("a.out", "A-B-C")
|
||||
obj.CreateTargetWithFileAndArch("b.out", "arm")
|
||||
obj.CreateTarget("c.out")
|
||||
obj.DeleteTarget(lldb.SBTarget())
|
||||
obj.GetTargetAtIndex(0xffffffff)
|
||||
obj.FindTargetWithProcessID(0)
|
||||
obj.FindTargetWithFileAndArch("a.out", "arm")
|
||||
obj.GetNumTargets()
|
||||
obj.GetSelectedTarget()
|
||||
obj.GetNumPlatforms()
|
||||
obj.GetPlatformAtIndex(0xffffffff)
|
||||
obj.GetNumAvailablePlatforms()
|
||||
obj.GetAvailablePlatformInfoAtIndex(0xffffffff)
|
||||
obj.GetSourceManager()
|
||||
obj.SetSelectedTarget(lldb.SBTarget())
|
||||
obj.SetCurrentPlatformSDKRoot("tmp/sdk-root")
|
||||
try:
|
||||
obj.DispatchInput(None)
|
||||
except Exception:
|
||||
pass
|
||||
obj.DispatchInputInterrupt()
|
||||
obj.DispatchInputEndOfFile()
|
||||
obj.GetInstanceName()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.GetTerminalWidth()
|
||||
obj.SetTerminalWidth(0xffffffff)
|
||||
obj.GetID()
|
||||
obj.GetPrompt()
|
||||
obj.SetPrompt("Hi, Mom!")
|
||||
obj.GetScriptLanguage()
|
||||
obj.SetScriptLanguage(lldb.eScriptLanguageNone)
|
||||
obj.SetScriptLanguage(lldb.eScriptLanguagePython)
|
||||
obj.GetCloseInputOnEOF()
|
||||
obj.SetCloseInputOnEOF(True)
|
||||
obj.SetCloseInputOnEOF(False)
|
||||
obj.Clear()
|
||||
for target in obj:
|
||||
s = str(target)
|
||||
25
lldb/test/API/python_api/default-constructor/sb_error.py
Normal file
25
lldb/test/API/python_api/default-constructor/sb_error.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetCString()
|
||||
obj.Fail()
|
||||
obj.Success()
|
||||
obj.GetError()
|
||||
obj.GetType()
|
||||
obj.SetError(5, lldb.eErrorTypeGeneric)
|
||||
obj.SetErrorToErrno()
|
||||
obj.SetErrorToGenericError()
|
||||
obj.SetErrorString("xyz")
|
||||
obj.SetErrorString(None)
|
||||
obj.SetErrorStringWithFormat("%s!", "error")
|
||||
obj.SetErrorStringWithFormat(None)
|
||||
obj.SetErrorStringWithFormat("error")
|
||||
obj.SetErrorStringWithFormat("%s %s", "warning", "danger")
|
||||
obj.SetErrorStringWithFormat("%s %s %s", "danger", "will", "robinson")
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
17
lldb/test/API/python_api/default-constructor/sb_event.py
Normal file
17
lldb/test/API/python_api/default-constructor/sb_event.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetDataFlavor()
|
||||
obj.GetType()
|
||||
broadcaster = obj.GetBroadcaster()
|
||||
# Do fuzz testing on the broadcaster obj, it should not crash lldb.
|
||||
import sb_broadcaster
|
||||
sb_broadcaster.fuzz_obj(broadcaster)
|
||||
obj.BroadcasterMatchesRef(broadcaster)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
14
lldb/test/API/python_api/default-constructor/sb_filespec.py
Normal file
14
lldb/test/API/python_api/default-constructor/sb_filespec.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.Exists()
|
||||
obj.ResolveExecutableLocation()
|
||||
obj.GetFilename()
|
||||
obj.GetDirectory()
|
||||
obj.GetPath(None, 0)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
40
lldb/test/API/python_api/default-constructor/sb_frame.py
Normal file
40
lldb/test/API/python_api/default-constructor/sb_frame.py
Normal file
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
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.FindValue("your_var", lldb.eValueTypeVariableGlobal)
|
||||
obj.FindValue(
|
||||
"your_var",
|
||||
lldb.eValueTypeVariableStatic,
|
||||
lldb.eDynamicCanRunTarget)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
19
lldb/test/API/python_api/default-constructor/sb_function.py
Normal file
19
lldb/test/API/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 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())
|
||||
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetAddress()
|
||||
obj.GetByteSize()
|
||||
obj.DoesBranch()
|
||||
try:
|
||||
obj.Print(None)
|
||||
except Exception:
|
||||
pass
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.EmulateWithFrame(lldb.SBFrame(), 0)
|
||||
obj.DumpEmulation("armv7")
|
||||
obj.TestEmulation(lldb.SBStream(), "my-file")
|
||||
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetSize()
|
||||
obj.GetInstructionAtIndex(0xffffffff)
|
||||
obj.AppendInstruction(lldb.SBInstruction())
|
||||
try:
|
||||
obj.Print(None)
|
||||
except Exception:
|
||||
pass
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.DumpEmulationForAllInstructions("armv7")
|
||||
obj.Clear()
|
||||
for inst in obj:
|
||||
s = str(inst)
|
||||
14
lldb/test/API/python_api/default-constructor/sb_lineentry.py
Normal file
14
lldb/test/API/python_api/default-constructor/sb_lineentry.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetStartAddress()
|
||||
obj.GetEndAddress()
|
||||
obj.GetFileSpec()
|
||||
obj.GetLine()
|
||||
obj.GetColumn()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
23
lldb/test/API/python_api/default-constructor/sb_listener.py
Normal file
23
lldb/test/API/python_api/default-constructor/sb_listener.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.AddEvent(lldb.SBEvent())
|
||||
obj.StartListeningForEvents(lldb.SBBroadcaster(), 0xffffffff)
|
||||
obj.StopListeningForEvents(lldb.SBBroadcaster(), 0xffffffff)
|
||||
event = lldb.SBEvent()
|
||||
broadcaster = lldb.SBBroadcaster()
|
||||
obj.WaitForEvent(5, event)
|
||||
obj.WaitForEventForBroadcaster(5, broadcaster, event)
|
||||
obj.WaitForEventForBroadcasterWithType(5, broadcaster, 0xffffffff, event)
|
||||
obj.PeekAtNextEvent(event)
|
||||
obj.PeekAtNextEventForBroadcaster(broadcaster, event)
|
||||
obj.PeekAtNextEventForBroadcasterWithType(broadcaster, 0xffffffff, event)
|
||||
obj.GetNextEvent(event)
|
||||
obj.GetNextEventForBroadcaster(broadcaster, event)
|
||||
obj.GetNextEventForBroadcasterWithType(broadcaster, 0xffffffff, event)
|
||||
obj.HandleBroadcastEvent(event)
|
||||
30
lldb/test/API/python_api/default-constructor/sb_module.py
Normal file
30
lldb/test/API/python_api/default-constructor/sb_module.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""
|
||||
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.GetFileSpec()
|
||||
obj.GetPlatformFileSpec()
|
||||
obj.SetPlatformFileSpec(lldb.SBFileSpec())
|
||||
obj.GetUUIDString()
|
||||
obj.ResolveFileAddress(sys.maxsize)
|
||||
obj.ResolveSymbolContextForAddress(lldb.SBAddress(), 0)
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.GetNumSymbols()
|
||||
obj.GetSymbolAtIndex(sys.maxsize)
|
||||
sc_list = obj.FindFunctions("my_func")
|
||||
sc_list = obj.FindFunctions("my_func", lldb.eFunctionNameTypeAny)
|
||||
obj.FindGlobalVariables(lldb.SBTarget(), "my_global_var", 1)
|
||||
for section in obj.section_iter():
|
||||
s = str(section)
|
||||
for symbol in obj.symbol_in_section_iter(lldb.SBSection()):
|
||||
s = str(symbol)
|
||||
for symbol in obj:
|
||||
s = str(symbol)
|
||||
obj.GetAddressByteSize()
|
||||
obj.GetByteOrder()
|
||||
obj.GetTriple()
|
||||
53
lldb/test/API/python_api/default-constructor/sb_process.py
Normal file
53
lldb/test/API/python_api/default-constructor/sb_process.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetTarget()
|
||||
obj.GetByteOrder()
|
||||
obj.PutSTDIN("my data")
|
||||
obj.GetSTDOUT(6)
|
||||
obj.GetSTDERR(6)
|
||||
event = lldb.SBEvent()
|
||||
try:
|
||||
obj.ReportEventState(event, None)
|
||||
except Exception:
|
||||
pass
|
||||
obj.AppendEventStateReport(event, lldb.SBCommandReturnObject())
|
||||
error = lldb.SBError()
|
||||
obj.RemoteAttachToProcessWithID(123, error)
|
||||
obj.RemoteLaunch(None, None, None, None, None, None, 0, False, error)
|
||||
obj.GetNumThreads()
|
||||
obj.GetThreadAtIndex(0)
|
||||
obj.GetThreadByID(0)
|
||||
obj.GetSelectedThread()
|
||||
obj.SetSelectedThread(lldb.SBThread())
|
||||
obj.SetSelectedThreadByID(0)
|
||||
obj.GetState()
|
||||
obj.GetExitStatus()
|
||||
obj.GetExitDescription()
|
||||
obj.GetProcessID()
|
||||
obj.GetAddressByteSize()
|
||||
obj.Destroy()
|
||||
obj.Continue()
|
||||
obj.Stop()
|
||||
obj.Kill()
|
||||
obj.Detach()
|
||||
obj.Signal(7)
|
||||
obj.ReadMemory(0x0000ffff, 10, error)
|
||||
obj.WriteMemory(0x0000ffff, "hi data", error)
|
||||
obj.ReadCStringFromMemory(0x0, 128, error)
|
||||
obj.ReadUnsignedFromMemory(0xff, 4, error)
|
||||
obj.ReadPointerFromMemory(0xff, error)
|
||||
obj.GetBroadcaster()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.LoadImage(lldb.SBFileSpec(), error)
|
||||
obj.UnloadImage(0)
|
||||
obj.Clear()
|
||||
obj.GetNumSupportedHardwareWatchpoints(error)
|
||||
for thread in obj:
|
||||
s = str(thread)
|
||||
len(obj)
|
||||
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.IsValid()
|
||||
obj.GetName()
|
||||
obj.GetExecutableFile()
|
||||
obj.GetProcessID()
|
||||
obj.GetUserID()
|
||||
obj.GetGroupID()
|
||||
obj.UserIDIsValid()
|
||||
obj.GroupIDIsValid()
|
||||
obj.GetEffectiveUserID()
|
||||
obj.GetEffectiveGroupID()
|
||||
obj.EffectiveUserIDIsValid()
|
||||
obj.EffectiveGroupIDIsValid()
|
||||
obj.GetParentProcessID()
|
||||
23
lldb/test/API/python_api/default-constructor/sb_section.py
Normal file
23
lldb/test/API/python_api/default-constructor/sb_section.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.IsValid()
|
||||
obj.GetName()
|
||||
obj.FindSubSection("hello_section_name")
|
||||
obj.GetNumSubSections()
|
||||
obj.GetSubSectionAtIndex(600)
|
||||
obj.GetFileAddress()
|
||||
obj.GetByteSize()
|
||||
obj.GetFileOffset()
|
||||
obj.GetFileByteSize()
|
||||
obj.GetSectionData(1000, 100)
|
||||
obj.GetSectionType()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
for subsec in obj:
|
||||
s = str(subsec)
|
||||
len(obj)
|
||||
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.AppendString("another string")
|
||||
obj.AppendString(None)
|
||||
obj.AppendList(None, 0)
|
||||
obj.AppendList(lldb.SBStringList())
|
||||
obj.GetSize()
|
||||
obj.GetStringAtIndex(0xffffffff)
|
||||
obj.Clear()
|
||||
for n in obj:
|
||||
s = str(n)
|
||||
16
lldb/test/API/python_api/default-constructor/sb_symbol.py
Normal file
16
lldb/test/API/python_api/default-constructor/sb_symbol.py
Normal file
@@ -0,0 +1,16 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetName()
|
||||
obj.GetMangledName()
|
||||
obj.GetInstructions(lldb.SBTarget())
|
||||
obj.GetStartAddress()
|
||||
obj.GetEndAddress()
|
||||
obj.GetPrologueByteSize()
|
||||
obj.GetType()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
@@ -0,0 +1,15 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetModule()
|
||||
obj.GetCompileUnit()
|
||||
obj.GetFunction()
|
||||
obj.GetBlock()
|
||||
obj.GetLineEntry()
|
||||
obj.GetSymbol()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
65
lldb/test/API/python_api/default-constructor/sb_target.py
Normal file
65
lldb/test/API/python_api/default-constructor/sb_target.py
Normal file
@@ -0,0 +1,65 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetProcess()
|
||||
listener = lldb.SBListener()
|
||||
error = lldb.SBError()
|
||||
obj.Launch(listener, None, None, None, None, None, None, 0, True, error)
|
||||
obj.LaunchSimple(None, None, None)
|
||||
obj.AttachToProcessWithID(listener, 123, error)
|
||||
obj.AttachToProcessWithName(listener, 'lldb', False, error)
|
||||
obj.ConnectRemote(listener, "connect://to/here", None, error)
|
||||
obj.GetExecutable()
|
||||
obj.GetNumModules()
|
||||
obj.GetModuleAtIndex(0xffffffff)
|
||||
obj.GetDebugger()
|
||||
filespec = lldb.SBFileSpec()
|
||||
obj.FindModule(filespec)
|
||||
sc_list = obj.FindFunctions("the_func")
|
||||
sc_list = obj.FindFunctions("the_func", lldb.eFunctionNameTypeAny)
|
||||
obj.FindFirstType("dont_care")
|
||||
obj.FindTypes("dont_care")
|
||||
obj.FindFirstType(None)
|
||||
obj.GetInstructions(lldb.SBAddress(), bytearray())
|
||||
obj.GetSourceManager()
|
||||
obj.FindGlobalVariables("my_global_var", 1)
|
||||
address = obj.ResolveLoadAddress(0xffff)
|
||||
obj.ResolveSymbolContextForAddress(address, 0)
|
||||
obj.BreakpointCreateByLocation("filename", 20)
|
||||
obj.BreakpointCreateByLocation(filespec, 20)
|
||||
obj.BreakpointCreateByName("func", None)
|
||||
obj.BreakpointCreateByRegex("func.", None)
|
||||
obj.BreakpointCreateByAddress(0xf0f0)
|
||||
obj.GetNumBreakpoints()
|
||||
obj.GetBreakpointAtIndex(0)
|
||||
obj.BreakpointDelete(0)
|
||||
obj.FindBreakpointByID(0)
|
||||
obj.EnableAllBreakpoints()
|
||||
obj.DisableAllBreakpoints()
|
||||
obj.DeleteAllBreakpoints()
|
||||
obj.GetNumWatchpoints()
|
||||
obj.GetWatchpointAtIndex(0)
|
||||
obj.DeleteWatchpoint(0)
|
||||
obj.FindWatchpointByID(0)
|
||||
obj.EnableAllWatchpoints()
|
||||
obj.DisableAllWatchpoints()
|
||||
obj.DeleteAllWatchpoints()
|
||||
obj.GetAddressByteSize()
|
||||
obj.GetByteOrder()
|
||||
obj.GetTriple()
|
||||
error = lldb.SBError()
|
||||
obj.WatchAddress(123, 8, True, True, error)
|
||||
obj.GetBroadcaster()
|
||||
obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelBrief)
|
||||
obj.Clear()
|
||||
for module in obj.module_iter():
|
||||
s = str(module)
|
||||
for bp in obj.breakpoint_iter():
|
||||
s = str(bp)
|
||||
for wp in obj.watchpoint_iter():
|
||||
s = str(wp)
|
||||
38
lldb/test/API/python_api/default-constructor/sb_thread.py
Normal file
38
lldb/test/API/python_api/default-constructor/sb_thread.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetStopReason()
|
||||
obj.GetStopReasonDataCount()
|
||||
obj.GetStopReasonDataAtIndex(100)
|
||||
obj.GetStopDescription(256)
|
||||
obj.GetThreadID()
|
||||
obj.GetIndexID()
|
||||
obj.GetName()
|
||||
obj.GetQueueName()
|
||||
obj.StepOver(lldb.eOnlyDuringStepping)
|
||||
obj.StepInto(lldb.eOnlyDuringStepping)
|
||||
obj.StepOut()
|
||||
frame = lldb.SBFrame()
|
||||
obj.StepOutOfFrame(frame)
|
||||
obj.StepInstruction(True)
|
||||
filespec = lldb.SBFileSpec()
|
||||
obj.StepOverUntil(frame, filespec, 1234)
|
||||
obj.RunToAddress(0xabcd)
|
||||
obj.Suspend()
|
||||
obj.Resume()
|
||||
obj.IsSuspended()
|
||||
obj.GetNumFrames()
|
||||
obj.GetFrameAtIndex(200)
|
||||
obj.GetSelectedFrame()
|
||||
obj.SetSelectedFrame(999)
|
||||
obj.GetProcess()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.Clear()
|
||||
for frame in obj:
|
||||
s = str(frame)
|
||||
len(obj)
|
||||
22
lldb/test/API/python_api/default-constructor/sb_type.py
Normal file
22
lldb/test/API/python_api/default-constructor/sb_type.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetName()
|
||||
obj.GetByteSize()
|
||||
# obj.GetEncoding(5)
|
||||
obj.GetNumberChildren(True)
|
||||
member = lldb.SBTypeMember()
|
||||
obj.GetChildAtIndex(True, 0, member)
|
||||
obj.GetChildIndexForName(True, "_member_field")
|
||||
obj.IsAPointerType()
|
||||
obj.GetPointeeType()
|
||||
obj.GetDescription(lldb.SBStream())
|
||||
obj.IsPointerType(None)
|
||||
lldb.SBType.IsPointerType(None)
|
||||
for child_type in obj:
|
||||
s = str(child_type)
|
||||
67
lldb/test/API/python_api/default-constructor/sb_value.py
Normal file
67
lldb/test/API/python_api/default-constructor/sb_value.py
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetError()
|
||||
obj.GetID()
|
||||
obj.GetName()
|
||||
obj.GetTypeName()
|
||||
obj.GetByteSize()
|
||||
obj.IsInScope()
|
||||
obj.GetFormat()
|
||||
obj.SetFormat(lldb.eFormatBoolean)
|
||||
obj.GetValue()
|
||||
obj.GetValueType()
|
||||
obj.GetValueDidChange()
|
||||
obj.GetSummary()
|
||||
obj.GetObjectDescription()
|
||||
obj.GetLocation()
|
||||
obj.SetValueFromCString("my_new_value")
|
||||
obj.GetChildAtIndex(1)
|
||||
obj.GetChildAtIndex(2, lldb.eNoDynamicValues, False)
|
||||
obj.GetIndexOfChildWithName("my_first_child")
|
||||
obj.GetChildMemberWithName("my_first_child")
|
||||
obj.GetChildMemberWithName("my_first_child", lldb.eNoDynamicValues)
|
||||
obj.GetNumChildren()
|
||||
obj.GetOpaqueType()
|
||||
obj.Dereference()
|
||||
obj.TypeIsPointerType()
|
||||
stream = lldb.SBStream()
|
||||
obj.GetDescription(stream)
|
||||
obj.GetExpressionPath(stream)
|
||||
obj.GetExpressionPath(stream, True)
|
||||
error = lldb.SBError()
|
||||
obj.Watch(True, True, False, error)
|
||||
obj.WatchPointee(True, False, True, error)
|
||||
for child_val in obj:
|
||||
s = str(child_val)
|
||||
error = lldb.SBError()
|
||||
obj.GetValueAsSigned(error, 0)
|
||||
obj.GetValueAsUnsigned(error, 0)
|
||||
obj.GetValueAsSigned(0)
|
||||
obj.GetValueAsUnsigned(0)
|
||||
obj.GetDynamicValue(lldb.eNoDynamicValues)
|
||||
obj.GetStaticValue()
|
||||
obj.IsDynamic()
|
||||
invalid_type = lldb.SBType()
|
||||
obj.CreateChildAtOffset("a", 12, invalid_type)
|
||||
obj.Cast(invalid_type)
|
||||
obj.CreateValueFromExpression("pt->x", "pt->x")
|
||||
obj.CreateValueFromAddress("x", 0x123, invalid_type)
|
||||
invalid_data = lldb.SBData()
|
||||
obj.CreateValueFromData("x", invalid_data, invalid_type)
|
||||
obj.GetValueForExpressionPath("[0]")
|
||||
obj.AddressOf()
|
||||
obj.GetLoadAddress()
|
||||
obj.GetAddress()
|
||||
obj.GetPointeeData(0, 1)
|
||||
obj.GetData()
|
||||
obj.GetTarget()
|
||||
obj.GetProcess()
|
||||
obj.GetThread()
|
||||
obj.GetFrame()
|
||||
obj.GetType()
|
||||
14
lldb/test/API/python_api/default-constructor/sb_valuelist.py
Normal file
14
lldb/test/API/python_api/default-constructor/sb_valuelist.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.Append(lldb.SBValue())
|
||||
obj.GetSize()
|
||||
obj.GetValueAtIndex(100)
|
||||
obj.FindValueObjectByUID(200)
|
||||
for val in obj:
|
||||
s = str(val)
|
||||
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
Fuzz tests an object after the default construction to make sure it does not crash lldb.
|
||||
"""
|
||||
|
||||
import lldb
|
||||
|
||||
|
||||
def fuzz_obj(obj):
|
||||
obj.GetID()
|
||||
obj.IsValid()
|
||||
obj.GetHardwareIndex()
|
||||
obj.GetWatchAddress()
|
||||
obj.GetWatchSize()
|
||||
obj.SetEnabled(True)
|
||||
obj.IsEnabled()
|
||||
obj.GetHitCount()
|
||||
obj.GetIgnoreCount()
|
||||
obj.SetIgnoreCount(5)
|
||||
obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelVerbose)
|
||||
obj.SetCondition("shouldWeStop()")
|
||||
obj.GetCondition()
|
||||
Reference in New Issue
Block a user