From 75e862077834c06e574d34e8958dd2ee7cc1d334 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Thu, 21 Sep 2023 10:21:53 +0000 Subject: 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. --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp') 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; } -- cgit v1.1