diff options
author | Johnny Chen <johnny.chen@apple.com> | 2011-12-23 00:53:45 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2011-12-23 00:53:45 +0000 |
commit | 3f0b90dcd0b4296d58eaaa2c94a00281ce2a0a70 (patch) | |
tree | c94c511215de4814798e63127ee12e02e588f736 /lldb/test/python_api/debugger/TestDebuggerAPI.py | |
parent | f74c2348b74a7d69d672d4559e5b17bfda56453c (diff) | |
download | bcm5719-llvm-3f0b90dcd0b4296d58eaaa2c94a00281ce2a0a70.tar.gz bcm5719-llvm-3f0b90dcd0b4296d58eaaa2c94a00281ce2a0a70.zip |
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
Diffstat (limited to 'lldb/test/python_api/debugger/TestDebuggerAPI.py')
-rw-r--r-- | lldb/test/python_api/debugger/TestDebuggerAPI.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lldb/test/python_api/debugger/TestDebuggerAPI.py b/lldb/test/python_api/debugger/TestDebuggerAPI.py index b9d169e244a..462933510a9 100644 --- a/lldb/test/python_api/debugger/TestDebuggerAPI.py +++ b/lldb/test/python_api/debugger/TestDebuggerAPI.py @@ -28,3 +28,11 @@ class DebuggerAPITestCase(TestBase): 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) + |