Skip to content

LLDB Windows: Hardware Watchpoints Not Triggering on Initial Stop #125054

Open
@omjavaid

Description

@omjavaid

Hardware breakpoints and watchpoints set at the initial stop (process launch -s) do not trigger, even though they are correctly written to the Windows context. They only work if set after the program reaches main. This issue affects both AArch64 and x86_64 hardware watchpoints.

This issue was discovered while implementing hardware breakpoint and watchpoint support for AArch64 Windows #108072 . Due to the impact, hardware breakpoints were dropped, but watchpoints were retained. The same applies to x86_64 Windows, which only implements hardware breakpoints

Reproduction Steps:

  1. Launch a process using process launch -s (stops at the first instruction).
  2. Set a hardware watchpoint.
  3. Resume execution (continue).
  4. The program runs to completion without the hardware watchpoint triggering.
  5. Repeat using process launch -m (stops at main).
  6. Set the same hardware watchpoint and resume.
  7. The watchpoint now triggers correctly.

Underlying Problem:

Windows loader operations between the first instruction and main may disables hardware breakpoints and watchpoints and only enables at the start of main function. LLDB requires a running process to set watchpoints, making this issue less frequent for watchpoints but critical for breakpoints. Does not affect LLDB tests, as hardware breakpoints are not supported on windows due to this problem, and watchpoints are always set after a software breakpoint on main.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions