public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug breakpoints/31485] New: [gdb/breakpoints] watchpoint not triggered during inferior call
@ 2024-03-14 11:56 vries at gcc dot gnu.org
  2024-03-21  8:47 ` [Bug breakpoints/31485] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2024-03-14 11:56 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 31485
           Summary: [gdb/breakpoints] watchpoint not triggered during
                    inferior call
           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 aarch64-linux, I did the following:
...
$ gdb -q -batch \
    -iex "set trace-commands on" \
    outputs/gdb.base/watchpoint-unaligned/watchpoint-unaligned \
    -ex "watch data.u.size8twice[0]" \
    -ex start \
    -ex "set unwind-on-terminating-exception off" \
    -ex "set unwindonsignal off" \
    -ex "print data".u.size8twice \
    -ex "call write_size8twice()" \
    -ex "print data".u.size8twice
+watch data.u.size8twice[0]
Hardware watchpoint 1: data.u.size8twice[0]
+start
Temporary breakpoint 2 at 0x410208: file
/home/vries/gdb/src/gdb/testsuite/gdb.base/watchpoint-unaligned.c, line 65.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 2, main () at
/home/vries/gdb/src/gdb/testsuite/gdb.base/watchpoint-unaligned.c:65
65        write_size8twice ();
+set unwind-on-terminating-exception off
+set unwindonsignal off
+print data.u.size8twice
$1 = {0, 0, 0}
+call write_size8twice()
+print data.u.size8twice
$2 = {1, 2, 0}
...

My understanding from the doc (
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Calling.html#stack-unwind-settings
):
...
If a called function is interrupted for any reason, including hitting a
breakpoint, or triggering a watchpoint, and the stack is not unwound due to set
unwind-on-terminating-exception on or set unwindonsignal on (see stack unwind
settings), then the dummy-frame, created by GDB to facilitate the call to the
program function, will be visible in the backtrace
...
is that the watchpoint should trigger.

-- 
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:[~2024-03-21  9:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 11:56 [Bug breakpoints/31485] New: [gdb/breakpoints] watchpoint not triggered during inferior call vries at gcc dot gnu.org
2024-03-21  8:47 ` [Bug breakpoints/31485] " vries at gcc dot gnu.org
2024-03-21  9:04 ` vries at gcc dot gnu.org
2024-03-21  9:05 ` vries at gcc dot gnu.org
2024-03-21  9:49 ` 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).