[all-commits] [llvm/llvm-project] c191fd: [lldb][NFC] Refactor Watchpoint class

dlav-sc via All-commits all-commits at lists.llvm.org
Wed Oct 15 21:51:25 PDT 2025


  Branch: refs/heads/users/dlav-sc/lldb_refactor_watchpoint_class
  Home:   https://github.com/llvm/llvm-project
  Commit: c191fd18dee872b1c56dc5c75336fa6a9acfb691
      https://github.com/llvm/llvm-project/commit/c191fd18dee872b1c56dc5c75336fa6a9acfb691
  Author: Daniil Avdeev <daniil.avdeev at syntacore.com>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    M lldb/include/lldb/Breakpoint/Watchpoint.h
    M lldb/source/Breakpoint/Watchpoint.cpp

  Log Message:
  -----------
  [lldb][NFC] Refactor Watchpoint class

Refactor watchpoint logic 1/2

This patch refactors the Watchpoint class to prepare for future code
improvements. The core changes include:

* Adding check logic to the stoppoint side
This patch adds a ShouldReport method to the Watchpoint class. This
method implements the logic from PerformAction for determining whether
a watchpoint hit should be reported. While the original logic in
StopInfoWatchpoint remains unchanged for now, ShouldReport allows to
simplify PerformAction and reduce coupling between the classes in the
subsequent patch.

* Preparing to eliminate redundant calculations
Currently, WatchedValueReportable and CaptureWatchedValue contain
duplicated code for calculating the watched value. Since PerformAction
calls these methods sequentially, the value is computed twice.
Consolidation of logic in ShouldReport provides the ability to remove
the code duplication and redundant calculations in the next patch.

Note that this patch doesn't use new functions yet. This is just a
preparatory step that facilitates the subsequent refactoring of
PerformAction logic.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list