[Lldb-commits] [lldb] [lldb] Add 'modify' type watchpoints, make it default (PR #66308)

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 21 16:32:23 PDT 2023


jasonmolenda wrote:

re. TestStepOverWatchpoint.py this test case annoys me greatly.  It wants to test that we get a watchpoint trap when stepping over a function that accesses the memory, and that we can stop on the watchpoint access when instruction stepping.  It wants to test this for read and write watchpoints.

It's operating on 1-byte globals, which are likely in the same dword as mentioned above.  MIPS and s390x both skip it expressedly because we're trying to watch the same word/dword of memory with both read & write access -- which isn't what the test is meant to be testing.

It starts by putting a read watchpoint on the read variable, and then for the case where it's doing write watchpoint testing, it adds a second watchpoint on the watch variable.  The read watchpoint is completely irrelevant in the watch-testing case.  None of this "read and write watch the same word of memory" is necessary!  The variables can be larger so they don't share memory granule, and we don't need to set a read watchpoint in the "test write-watchpoints" test method at all.

The test won't work on Darwin systems because hardware watchpoints/breakpoints are currently disabled while instruction stepping by the kernel.  So the bit of the test that instruction steps until a watchpoint is accessed will not succeed.

I'm going to leave this as expected fail for everyone for a tiny bit longer until I can test a bit of a rewrite.

https://github.com/llvm/llvm-project/pull/66308


More information about the lldb-commits mailing list