<rdar://problem/10684141>

When the lldb_private::Debugger goes away, it should cleanup all
of its targets.

llvm-svn: 148189
This commit is contained in:
Greg Clayton 2012-01-14 17:04:19 +00:00
parent aefdb38352
commit ccbc08e6ae
1 changed files with 10 additions and 6 deletions

View File

@ -359,13 +359,16 @@ Debugger::Clear()
int num_targets = m_target_list.GetNumTargets();
for (int i = 0; i < num_targets; i++)
{
ProcessSP process_sp (m_target_list.GetTargetAtIndex (i)->GetProcessSP());
if (process_sp)
TargetSP target_sp (m_target_list.GetTargetAtIndex (i));
if (target_sp)
{
if (process_sp->GetShouldDetach())
process_sp->Detach();
else
process_sp->Destroy();
ProcessSP process_sp (target_sp->GetProcessSP());
if (process_sp)
{
if (process_sp->GetShouldDetach())
process_sp->Detach();
}
target_sp->Destroy();
}
}
DisconnectInput();
@ -776,6 +779,7 @@ TestPromptFormats (StackFrame *frame)
"{frame.reg.carp = '${frame.reg.carp}'\n}"
"{function.id = '${function.id}'\n}"
"{function.name = '${function.name}'\n}"
"{function.name-with-args = '${function.name-with-args}'\n}"
"{function.addr-offset = '${function.addr-offset}'\n}"
"{function.line-offset = '${function.line-offset}'\n}"
"{function.pc-offset = '${function.pc-offset}'\n}"