public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/30562] New: [gdb] FAIL: gdb.threads/watchthreads2.exp: watch x
Date: Sun, 18 Jun 2023 09:38:51 +0000	[thread overview]
Message-ID: <bug-30562-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 30562
           Summary: [gdb] FAIL: gdb.threads/watchthreads2.exp: watch x
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On a pinebook (debian 9, arm 64-bit kernel, arm 32-bit userland), I ran into:
...
FAIL: gdb.threads/watchthreads2.exp: watch x
FAIL: gdb.threads/watchthreads2.exp: x watch loop
...

First in more detail:
...
(gdb) watch x^M
Watchpoint 3: x^M
(gdb) FAIL: gdb.threads/watchthreads2.exp: watch x
...

Basically, the problem is that we get a software rather than hardware
watchpoint.

We can "fix" this by setting the watchpoint earlier, at the main breakpoint.

Alternatively, we can "fix" this in the test-case by allowing the watchpoint to
be a software watchpoint.  This makes the test-case rather slow (30 sec), but
OTOH after commenting out the printf it speeds up significantly (5 sec).

I looked into what the different is between setting the watchpoint earlier and
later, and the difference is in arm_linux_get_hwbp_cap, where we do:
...
      if (ptrace (PTRACE_GETHBPREGS, tid, 0, &val) < 0)
        available = 0;
...
and this call returns something < 0 in the case where we set a hw breakpoint.

I'd like to investigate this further using ptrace, but I'm not able to install
packages.  My plan is to install a new OS on the laptop, so I also may lose the
ability to reproduce this.

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

             reply	other threads:[~2023-06-18  9:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-18  9:38 vries at gcc dot gnu.org [this message]
2023-06-21  7:00 ` [Bug gdb/30562] " vries at gcc dot gnu.org
2023-06-21  7:00 ` [Bug tdep/30562] " vries at gcc dot gnu.org
2023-06-23  9:46 ` luis.machado at arm dot com
2023-06-23  9:47 ` luis.machado at arm dot com
2023-06-23  9:48 ` vries at gcc dot gnu.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-30562-4717@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).