aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2023-09-21 10:21:53 +0000
committerDavid Spickett <david.spickett@linaro.org>2023-09-21 10:35:15 +0000
commit75e862077834c06e574d34e8958dd2ee7cc1d334 (patch)
tree24b227451022b0ad2f0a22aecbdaf94aad9bf876 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent618e5d2c2d8e0c288c37b883ece553ca4f994c2e (diff)
downloadllvm-75e862077834c06e574d34e8958dd2ee7cc1d334.zip
llvm-75e862077834c06e574d34e8958dd2ee7cc1d334.tar.gz
llvm-75e862077834c06e574d34e8958dd2ee7cc1d334.tar.bz2
Reland "[lldb] Add 'modify' type watchpoints, make it default (#66308)"
This reverts commit a7b78cac9a77e3ef6bbbd8ab1a559891dc693401. With updates to the tests. TestWatchTaggedAddress.py: Updated the expected watchpoint types, though I'm not sure there should be a differnt default for the two ways of setting them, that needs to be confirmed. TestStepOverWatchpoint.py: Skipped this everywhere because I think what used to happen is you couldn't put 2 watchpoints on the same address (after alignment). I guess that this is now allowed because modify watchpoints aren't accounted for, but likely should be. Needs investigating.
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 4d489f1..56fc549 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -3109,14 +3109,16 @@ static GDBStoppointType GetGDBStoppointType(Watchpoint *wp) {
assert(wp);
bool watch_read = wp->WatchpointRead();
bool watch_write = wp->WatchpointWrite();
+ bool watch_modify = wp->WatchpointModify();
- // watch_read and watch_write cannot both be false.
- assert(watch_read || watch_write);
- if (watch_read && watch_write)
+ // watch_read, watch_write, watch_modify cannot all be false.
+ assert((watch_read || watch_write || watch_modify) &&
+ "watch_read, watch_write, watch_modify cannot all be false.");
+ if (watch_read && (watch_write || watch_modify))
return eWatchpointReadWrite;
else if (watch_read)
return eWatchpointRead;
- else // Must be watch_write, then.
+ else // Must be watch_write or watch_modify, then.
return eWatchpointWrite;
}