diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-01-06 20:12:03 +0000 |
commit | 9e6d35490a6542f9c97607f93c2ef8ca8e03cbcc (patch) | |
tree | dd2a1ddf0476664c2b823409c36cbccd52662ca7 /packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py | |
parent | 3bd2e91faeb9eeec1aae82c64a3253afff551cfd (diff) | |
download | src-503acc3a0a1fd9a610f1a126b8608cb84b185170.tar.gz src-503acc3a0a1fd9a610f1a126b8608cb84b185170.zip |
Vendor import of lldb trunk r256945:vendor/lldb/lldb-trunk-r256945
Diffstat (limited to 'packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py')
-rw-r--r-- | packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py new file mode 100644 index 000000000000..e7c188f09bad --- /dev/null +++ b/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py @@ -0,0 +1,56 @@ +""" +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.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() + obj.HandleProcessEvent(lldb.SBProcess(), lldb.SBEvent(), None, None) + 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.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) |