summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2012-03-26 22:00:10 +0000
committerJohnny Chen <johnny.chen@apple.com>2012-03-26 22:00:10 +0000
commit41b77265e31e3640749f1a1f75b0ae32ff97e992 (patch)
treec41f6fee6b6352c86b9d677b670d7ca8110fb94a
parent56079c1e72861cf03c7d85e50d14a8a2f1b6cdd4 (diff)
downloadbcm5719-llvm-41b77265e31e3640749f1a1f75b0ae32ff97e992.tar.gz
bcm5719-llvm-41b77265e31e3640749f1a1f75b0ae32ff97e992.zip
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
-rw-r--r--lldb/source/Target/Target.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 6f5b0072043..6648d4c86be 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -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;
OpenPOWER on IntegriCloud