[Bug breakpoints/34280] New: [gdb/breakpoints] FAIL: gdb.threads/sw-watchpoint-step-over-bp-with-threads.exp: target-non-stop=auto: displaced-s\ tepping=auto: gdb_breakpoint: set breakpoint at 64

"vries at gcc dot gnu.org via Gdb-prs" <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34280

            Bug ID: 34280
           Summary: [gdb/breakpoints] FAIL:
                    gdb.threads/sw-watchpoint-step-over-bp-with-threads.ex
                    p: target-non-stop=auto: displaced-s\ tepping=auto:
                    gdb_breakpoint: set breakpoint at 64
           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: ---

Created attachment 16783
  --> https://sourceware.org/bugzilla/attachment.cgi?id=16783&action=edit
gdb.log

On x86_64-linux, I ran into:
...
(gdb) cont^M
Continuing.^M
[Switching to Thread 0x7ffff7cbe6c0 (LWP 3534988)]^M
^M
Thread 2 "sw-watchpoint-s" hit Watchpoint 3: watched_global^M
^M
Old value = 0^M
New value = 1^M
0x00007ffff7d514bf in futex_wait (private=0, expected=0, futex_word=0x404084
<threads_started_barrier+4>) at ../sysdeps/nptl/futex-internal.h:146^M
146       int err = lll_futex_timed_wait (futex_word, expected, NULL,
private);^M
(gdb) PASS: gdb.threads/sw-watchpoint-step-over-bp-with-threads.exp:
target-non-stop=auto: displaced-stepping=auto: continue to watchpoint
break 64^M
No compiled code for line 64 in the current file.^M
Make breakpoint pending on future shared library load? (y or [n]) n^M
(gdb) FAIL: gdb.threads/sw-watchpoint-step-over-bp-with-threads.exp:
target-non-stop=auto: displaced-stepping=auto: gdb_breakpoint: set breakpoint
at 64
...

AFAIU, the watchpoint hit is reported in the wrong thread.

There's some text in the docs about software watchpoints and multithreaded
programs (
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Set-Watchpoints.html ):
...
Warning: In multi-threaded programs, software watchpoints have only limited
usefulness. If GDB creates a software watchpoint, it can only watch the value
of an expression in a single thread. If you are confident that the expression
can only change due to the current thread’s activity (and if you are also
confident that no other thread can become current), then you can use software
watchpoints as usual. However, GDB may not notice when a non-current thread’s
activity changes the expression. (Hardware watchpoints, in contrast, watch an
expression in all threads.) 
...

AFAIU, this doesn't apply, making this a gdb rather than testsuite bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.