If creation of watchpoint failed on the device, make sure the list maintained by the target reflects that by cleaning it up.

llvm-svn: 153477
This commit is contained in:
Johnny Chen 2012-03-26 22:00:10 +00:00
parent 56079c1e72
commit 41b77265e3
1 changed files with 5 additions and 1 deletions

View File

@ -508,8 +508,12 @@ Target::CreateWatchpoint(lldb::addr_t addr, size_t size, uint32_t type)
rc.Success() ? "succeeded" : "failed",
wp_sp->GetID());
if (rc.Fail())
if (rc.Fail()) {
// Enabling the watchpoint on the device side failed.
// Remove the said watchpoint from the list maintained by the target instance.
m_watchpoint_list.Remove(wp_sp->GetID());
wp_sp.reset();
}
else
m_last_created_watchpoint = wp_sp;
return wp_sp;