1"""
2Fuzz tests an object after the default construction to make sure it does not crash lldb.
3"""
4
5import sys
6import lldb
7
8def fuzz_obj(obj):
9    obj.GetTarget()
10    obj.GetByteOrder()
11    obj.PutSTDIN("my data")
12    obj.GetSTDOUT(6)
13    obj.GetSTDERR(6)
14    event = lldb.SBEvent()
15    obj.ReportEventState(event, None)
16    obj.AppendEventStateReport(event, lldb.SBCommandReturnObject())
17    error = lldb.SBError()
18    obj.RemoteAttachToProcessWithID(123, error)
19    obj.RemoteLaunch(None, None, None, None, None, None, 0, False, error)
20    obj.GetNumThreads()
21    obj.GetThreadAtIndex(0)
22    obj.GetThreadByID(0)
23    obj.GetSelectedThread()
24    obj.SetSelectedThread(lldb.SBThread())
25    obj.SetSelectedThreadByID(0)
26    obj.GetState()
27    obj.GetExitStatus()
28    obj.GetExitDescription()
29    obj.GetProcessID()
30    obj.GetAddressByteSize()
31    obj.Destroy()
32    obj.Continue()
33    obj.Stop()
34    obj.Kill()
35    obj.Detach()
36    obj.Signal(7)
37    obj.ReadMemory(0x0000ffff, 10, error)
38    obj.WriteMemory(0x0000ffff, "hi data", error)
39    obj.ReadCStringFromMemory(0x0, 128, error)
40    obj.ReadUnsignedFromMemory(0xff, 4, error)
41    obj.ReadPointerFromMemory(0xff, error)
42    obj.GetBroadcaster()
43    obj.GetDescription(lldb.SBStream())
44    obj.LoadImage(lldb.SBFileSpec(), error)
45    obj.UnloadImage(0)
46    obj.Clear()
47    obj.GetNumSupportedHardwareWatchpoints(error)
48    for thread in obj:
49        print thread
50