Files
clang-p2996/lldb/test/python_api/debugger/TestDebuggerAPI.py
Johnny Chen 3f0b90dcd0 rdar://problem/10216227
LLDB (python bindings) Crashing in lldb::SBDebugger::DeleteTarget(lldb::SBTarget&)

Need to check the validity of (SBTarget&)target passed to SBDebugger::DeleteTarget()
before calling target->Destroy().

llvm-svn: 147213
2011-12-23 00:53:45 +00:00

39 lines
1.2 KiB
Python

"""
Test Debugger APIs.
"""
import os, time
import re
import unittest2
import lldb, lldbutil
from lldbtest import *
class DebuggerAPITestCase(TestBase):
mydir = os.path.join("python_api", "debugger")
@python_api_test
def test_debugger_api_boundary_condition(self):
"""Exercise SBDebugger APIs with boundary conditions."""
self.dbg.HandleCommand(None)
self.dbg.SetDefaultArchitecture(None)
self.dbg.GetScriptingLanguage(None)
self.dbg.CreateTarget(None)
self.dbg.CreateTarget(None, None, None, True, lldb.SBError())
self.dbg.CreateTargetWithFileAndTargetTriple(None, None)
self.dbg.CreateTargetWithFileAndArch(None, None)
self.dbg.FindTargetWithFileAndArch(None, None)
self.dbg.SetInternalVariable(None, None, None)
self.dbg.GetInternalVariableValue(None, None)
self.dbg.SetPrompt(None)
self.dbg.SetCurrentPlatform(None)
self.dbg.SetCurrentPlatformSDKRoot(None)
@python_api_test
def test_debugger_delete_invalid_target(self):
"""SBDebugger.DeleteTarget() should not crash LLDB given and invalid target."""
target = lldb.SBTarget()
self.assertFalse(target.IsValid())
self.dbg.DeleteTarget(target)