Re: Regression for watchpoint-fork.exp [Re: [PATCH v3 2/5] PR breakpoints/7143 - Watchpoint does not trigger when first set]

Pedro Alves
2014-06-19T16:56:52Z

On 06/19/2014 04:02 PM, Pedro Alves wrote:

>> Attaching gzipped gdb.threads/watchpoint-fork-parent-st
>> from gcc-4.9.0-9.fc21.x86_64.
>
> Thanks, I can reproduce it.

Hmm, I suspect this might be related to kernel-side validation
of DR_CONTROL vs DR0-3, like what we already handle in amd64_linux_prepare_to_resume.
And indeed this below makes the error go away. Not exactly sure why yet.

diff --git c/gdb/amd64-linux-nat.c w/gdb/amd64-linux-nat.c
index 06199af..5972415 100644
--- c/gdb/amd64-linux-nat.c
+++ w/gdb/amd64-linux-nat.c
@@ -415,6 +415,8 @@ amd64_linux_prepare_to_resume (struct lwp_info *lwp)

Ensure DR_CONTROL gets written as the very last register here. */

+ amd64_linux_dr_set (lwp->ptid, DR_CONTROL, 0);
+
for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++)
if (state->dr_ref_count[i] > 0)
{

--
Pedro Alves