summaryrefslogtreecommitdiffstats
path: root/lldb/source/API
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-06-15 21:24:24 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-06-15 21:24:24 +0000
commit3794ad95a7e8069caf8935b749dda7b2dd23243d (patch)
tree25be046c312800c22aaed299f88821e5db632bbc /lldb/source/API
parent556fad31d12dc495a4e06370715be2cf4f18960a (diff)
downloadbcm5719-llvm-3794ad95a7e8069caf8935b749dda7b2dd23243d.tar.gz
bcm5719-llvm-3794ad95a7e8069caf8935b749dda7b2dd23243d.zip
Add an API to SBDebugger class:
bool SBDebugger::DeleteTarget(lldb::SBTarget &target); which is used in the test tearDown() phase to cleanup the debugger's target list so that it won't grow larger and larger as test cases are executed. This is also a good opportunity to get rid of the arcane requirement that test cases exercising the Python API must assign the process object to self.process so that it gets shutdown gracefully. Instead, the shutdown of the process associated with each target is now being now automatically. Also get rid of an API from SBTarget class: SBTarget::DeleteTargetFromList(lldb_private::TargetList *list); llvm-svn: 133091
Diffstat (limited to 'lldb/source/API')
-rw-r--r--lldb/source/API/SBDebugger.cpp18
-rw-r--r--lldb/source/API/SBTarget.cpp10
2 files changed, 18 insertions, 10 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 33f9760e107..04d8f72ee83 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -508,6 +508,24 @@ SBDebugger::CreateTarget (const char *filename)
return target;
}
+bool
+SBDebugger::DeleteTarget (lldb::SBTarget &target)
+{
+ bool result = false;
+ if (m_opaque_sp)
+ {
+ // No need to lock, the target list is thread safe
+ result = m_opaque_sp->GetTargetList().DeleteTarget (target.m_opaque_sp);
+ }
+
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ {
+ log->Printf ("SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i", m_opaque_sp.get(), target.m_opaque_sp.get(), result);
+ }
+
+ return result;
+}
SBTarget
SBDebugger::GetTargetAtIndex (uint32_t idx)
{
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index ab70e6c0af2..629308f7cfb 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -397,16 +397,6 @@ SBTarget::GetExecutable ()
return exe_file_spec;
}
-
-bool
-SBTarget::DeleteTargetFromList (TargetList *list)
-{
- if (m_opaque_sp)
- return list->DeleteTarget (m_opaque_sp);
- else
- return false;
-}
-
bool
SBTarget::operator == (const SBTarget &rhs) const
{
OpenPOWER on IntegriCloud