[Lldb-commits] [PATCH] D24610: LLDB Arm Watchpoints: Use single hardware watchpoint slot to watch multiple bytes where possible

Muhammad Omair Javaid via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 26 17:39:53 PDT 2016


omjavaid updated this revision to Diff 72589.
omjavaid added a comment.

This is a new version of what seems to me fully implementing functionality we intend to have here.

On a second thought nuking ClearHardwareWatchpoint function seems to be the wrong approach here. I spent some time taking different approaches and it turns out that if we do not ClearHardwareWatchpoint when back-end asks us to remove it then we wont be able to step over watchpoints. On ARM targets we have to first clear and then reinstall watchpoints to step over the watchpoint instruction.

On the other hand if we call NativeRegisterContextLinux_arm::ClearHardwareWatchpoint then that watchpoint stands removed if call is just to delete watch on one of the bytes. And if we follow up with creating a new watchpoint on a different word the slot being used may appear vaccant which is actually inconsistent behavior.

So I have a new approach that does clear watchpoint registers if NativeRegisterContextLinux_arm::ClearHardwareWatchpoint is called but we still track reference counts by re-introducing refcount that I removed in my last patch. This will mean that a follow up create may fail just because there are still references to disabled watchpoint and watchpoint slots are still not vaccant. I have made changes to the test to reflect this behaviour.

Please comment if you have any reservation about this approach.


https://reviews.llvm.org/D24610

Files:
  packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/Makefile
  packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
  packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/main.c
  source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
  source/Plugins/Process/Linux/NativeThreadLinux.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24610.72589.patch
Type: text/x-patch
Size: 16290 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160927/45dbc73e/attachment.bin>


More information about the lldb-commits mailing list