public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-28412-4717-rHLNS9XBqQ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28412-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28412

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
(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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2021-10-09 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 19:16 [Bug gdb/28412] New: " yyc1992 at gmail dot com
2021-10-09 11:25 ` [Bug gdb/28412] " ssbssa at sourceware dot org
2021-10-09 17:26 ` simark at simark dot ca [this message]
2022-03-06 17:15 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-28412-4717-rHLNS9XBqQ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).