summaryrefslogtreecommitdiffstats
path: root/lldb/source/API/SBTarget.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-06-18 21:52:48 +0000
committerJim Ingham <jingham@apple.com>2013-06-18 21:52:48 +0000
commitc64623179b7911e3ce932d91b6a89508a1379b75 (patch)
tree9720bd8a9cf70685eb8cacb95d94f147a5bedfb6 /lldb/source/API/SBTarget.cpp
parenta6ed57d8dd8dbcfc2720e25771366c640fc0d1bf (diff)
downloadbcm5719-llvm-c64623179b7911e3ce932d91b6a89508a1379b75.tar.gz
bcm5719-llvm-c64623179b7911e3ce932d91b6a89508a1379b75.zip
We were getting an assert because somebody was making a watchpoint that was
neither read nor write. Tighten up the checking so this isn't possible. <rdar://problem/14111167> llvm-svn: 184245
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r--lldb/source/API/SBTarget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 8687cad69bf..42f4ca1c313 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -1807,6 +1807,12 @@ SBTarget::WatchAddress (lldb::addr_t addr, size_t size, bool read, bool write, S
watch_type |= LLDB_WATCH_TYPE_READ;
if (write)
watch_type |= LLDB_WATCH_TYPE_WRITE;
+ if (watch_type == 0)
+ {
+ error.SetErrorString("Can't create a watchpoint that is neither read nor write.");
+ return sb_watchpoint;
+ }
+
// Target::CreateWatchpoint() is thread safe.
Error cw_error;
// This API doesn't take in a type, so we can't figure out what it is.
OpenPOWER on IntegriCloud