summaryrefslogtreecommitdiffstats
path: root/lldb/test/python_api/default-constructor/sb_target.py
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-29 00:05:40 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-29 00:05:40 +0000
commit8ebed74e6e7aba431b07aa1f082f41948d9eafd7 (patch)
treed57e359d574c7ea379de35c2bd5b036807e964b1 /lldb/test/python_api/default-constructor/sb_target.py
parentfc510bdd94fcb6ca885de80870c97bed3207b52a (diff)
downloadbcm5719-llvm-8ebed74e6e7aba431b07aa1f082f41948d9eafd7.tar.gz
bcm5719-llvm-8ebed74e6e7aba431b07aa1f082f41948d9eafd7.zip
Add fuzz calls for SBTarget and SBThread.
llvm-svn: 134046
Diffstat (limited to 'lldb/test/python_api/default-constructor/sb_target.py')
-rw-r--r--lldb/test/python_api/default-constructor/sb_target.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/lldb/test/python_api/default-constructor/sb_target.py b/lldb/test/python_api/default-constructor/sb_target.py
new file mode 100644
index 00000000000..0f94d2fc998
--- /dev/null
+++ b/lldb/test/python_api/default-constructor/sb_target.py
@@ -0,0 +1,42 @@
+"""
+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.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)
+ contextlist = lldb.SBSymbolContextList()
+ obj.FindFunctions("the_func", 0xff, True, contextlist)
+ address = lldb.SBAddress()
+ obj.ResolveLoadAddress(0xffff, address)
+ 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.GetBroadcaster()
+ obj.GetDescription(lldb.SBStream(), lldb.eDescriptionLevelBrief)
+ obj.Clear()
OpenPOWER on IntegriCloud