public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/27188] New: FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at next
@ 2021-01-15 13:23 vries at gcc dot gnu.org
  2021-01-20 16:30 ` [Bug breakpoints/27188] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2021-01-15 13:23 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27188
           Summary: FAIL: gdb.base/gdb11531.exp: watchpoint variable
                    triggers at next
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: breakpoints
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

On openSUSE Factory, there's a cluster of failing test-case related to
watchpoints.  The first one of those is:
...
FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at next
...

Can be reproduced on the command line, as follows.

First we show that the watchpoint works when using continue:
...
$ gdb -batch outputs/gdb.base/gdb11531/gdb11531 \
  -ex start \
  -ex "watch myrec.x" \
  -ex continue
Temporary breakpoint 1 at 0x4010fa: file gdb11531.c, line 34.

Temporary breakpoint 1, main () at gdb11531.c:34
34        myrec.x = 5;
Hardware watchpoint 2: myrec.x

Hardware watchpoint 2: myrec.x

Old value = 0
New value = 5
main () at gdb11531.c:35
35        myrec.y = 3.4;
...

And now with step instead of continue, the watchpoint no longer triggers:
...
$ gdb -batch outputs/gdb.base/gdb11531/gdb11531 \
  -ex start \
  -ex "watch myrec.x" \
  -ex step
Temporary breakpoint 1 at 0x4010fa: file gdb11531.c, line 34.

Temporary breakpoint 1, main () at gdb11531.c:34
34        myrec.x = 5;
Hardware watchpoint 2: myrec.x
35        myrec.y = 3.4;
...

Workaround: disable hardware watchpoints:
...
$ gdb -batch outputs/gdb.base/gdb11531/gdb11531 \
  -ex start \
  -ex "set can-use-hw-watchpoints 0" \
  -ex "watch myrec.x" \
  -ex step
Temporary breakpoint 1 at 0x4010fa: file gdb11531.c, line 34.

Temporary breakpoint 1, main () at gdb11531.c:34
34        myrec.x = 5;
Watchpoint 2: myrec.x

Watchpoint 2: myrec.x

Old value = 0
New value = 5
main () at gdb11531.c:35
35        myrec.y = 3.4;
...

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-07  7:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 13:23 [Bug breakpoints/27188] New: FAIL: gdb.base/gdb11531.exp: watchpoint variable triggers at next vries at gcc dot gnu.org
2021-01-20 16:30 ` [Bug breakpoints/27188] " vries at gcc dot gnu.org
2021-01-29  9:55 ` vries at gcc dot gnu.org
2021-02-13 11:32 ` vries at gcc dot gnu.org
2021-03-07  7:22 ` vries at gcc dot gnu.org

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).