From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 697573857021; Thu, 13 Aug 2020 19:52:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 697573857021 From: "pedromfc at linux dot ibm.com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/26385] New: [ppc] Minor regression with old watchpoint interface for PowerPC on Linux Date: Thu, 13 Aug 2020 19:52:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pedromfc at linux dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 10.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcchost cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Aug 2020 19:52:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26385 Bug ID: 26385 Summary: [ppc] Minor regression with old watchpoint interface for PowerPC on Linux Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: pedromfc at linux dot ibm.com Target Milestone: 10.1 Host: powerpc on linux Target: powerpc on linux The following commit introduced a possible regression when using the old PTRACE_GET/SET_DEBUGREG interface on older kernels. 227c0bf4b3dd0cf65dceb58e729e9da81b38b5a7 [PowerPC] Fix debug register issue= s in ppc-linux-nat There were some older kernel versions for which overwriting a watchpoint wi= th PTRACE_SET_DEBUGREG would not re-activate the watchpoint if it was previouly disabled following a hit. This happened when the kernel was configured with CONFIG_HW_BREAKPOINT on and uses perf events to install watchpoints. Previously, the ppc linux native target would immediately remove or insert watchpoints following a request from the upper layers. This was changed in commit 227c0bf4b3dd0cf65dceb58e729e9da81b38b5a7 to fix other issues, which caused watchpoint requests to be applied to the inferior only in low_prepare_to_resume, right before the inferior is resumed. Usually, but maybe not always, after a hit, GDB will remove the watchpoint, resume the inferior for a single-step, possibly report the watchpoint hit to the user, and then re-insert the watchpoint before the inferior is next resumed. In this case there would be no problems, but since I can't guaran= tee that there aren't other paths in GDB that allow the user to set a new watchpoint after the first one hit, and after its deletion by GDB, but befo= re the inferior is resumed, there is a chance that PTRACE_SET_DEBUGREG could be called directly without the watchpoint first having been cleared, which cou= ld cause a false negative with the older kernel versions. I've submitted a fix: https://sourceware.org/pipermail/gdb-patches/2020-August/171277.html I have set this with a target milestone for 10.1, considering that this wil= l be the first release with the commit that introduced the regression, following= the discussion in this thread: https://sourceware.org/pipermail/gdb-patches/2020-August/171176.html --=20 You are receiving this mail because: You are on the CC list for the bug.=