From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2E183858418; Sat, 9 Oct 2021 17:26:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2E183858418 From: "simark at simark dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/28412] syscall that writes memory does not trigger hardware watchpoint. Date: Sat, 09 Oct 2021 17:26:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 11.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simark at simark dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: 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: Sat, 09 Oct 2021 17:26:39 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28412 Simon Marchi changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |simark at simark dot ca --- Comment #1 from Simon Marchi --- (In reply to Yichao Yu from comment #0) > When a watchpoint is set on `c` with `watch -l c` or `watch c`, the value= is > changed by `read` without triggering the watch point. Turning off hardware > watchpoint fixes the issue. Seems that when hardware watch point is used, > checks needs to be added around syscalls to see if they modify memory? That sounds doable (although at a cost). GDB uses PTRACE_SYSCALL to cause = the program to stop on syscall entry only if the user has set up some syscall catchpoints. But it could also be enabled if the user has some hardware watchpoints set. When a thread exits, we would get an event, and we could check all watchpoints, see if the memory they watch has changed. --=20 You are receiving this mail because: You are on the CC list for the bug.=