<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/125054>125054</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB Windows: Hardware Watchpoints Not Triggering on Initial Stop
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
omjavaid
</td>
</tr>
</table>
<pre>
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.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0VVFvozgQ_jXkZVQEhiTkgYfuVdWdVJ1O2z3t48mYIXhrbM4eSvPvT2OgzXZzUqQI2TPzfd98M5Yh6LNFrJP9l2T_sJMT9c7XbvghX6Vud41rL_Xv0rez9AiNR_kyOm0pgLQtzJJUv34HJJAE1CNoq0lLA4HcCImoRu8UhgBGTlb1cBcScYLWgXUE5PX5jD4RvwG-ogXq3XTuOc0FuKRy3qMic4HZayK-4WKR79q2bg6gnCV8oxS-cYizfNP5F9DdAqkj9DFg9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