gdb/38: Watchpoint does not trigger when first set

chastain@redhat.com chastain@redhat.com
Sun Mar 11 21:58:00 GMT 2001


>Number:         38
>Category:       gdb
>Synopsis:       Watchpoint does not trigger when first set
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 11 21:58:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     chastain@redhat.com
>Release:        cvs 2001-03-09
>Organization:
>Environment:
Red Hat Linux 7 native
gcc 2.95.2
gdb cvs 2001-03-09
>Description:
I set a breakpoint, take it, and set a watchpoint.
When I "next" off the breakpoint, the first instruction off
  the breakpoint does not trigger the watchpoint.

testsuite/gdb.c++/annota2.exp expects this to work.

doc/gdb.texinfo has some illuminating language:

  @value {GDBN} normally ignores breakpoints when it
  resumes execution, until at least one instruction has
  been executed.  If it it did not do this, you would be
  unable to proceed past a breakpoint without first
  disabling the breakpoint.  This rule applies whether or
  not the breakpoint already existed when your program
  stopped.

That's fine for breakpoints, but it looks like gdb uses
the same logic for watchpoints, which are different.
Hardware watchpoints fire after the instruction is executed,
so the "unable to proceed" issue does not apply.
>How-To-Repeat:
Repeat the steps shown in the typescript.
The version of gcc is not critical.
The version of gdb is not critical.
The critical part is that the configuration has both
  hardware watchpoints and a single-instruction
  "store immediate" instruction.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="typescript"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="typescript"

U2NyaXB0IHN0YXJ0ZWQgb24gTW9uIE1hciAxMiAwMDozNToxNyAyMDAxCmJhc2gtMi4wNCQgY2F0
IHgyLmMKaW50IGkgPSAwOwoKaW50IG1haW4gKCkKewogIGkgPSAxOwogIGkgPSAyOwogIGkgPSAz
OwogIHJldHVybiAwOwp9CmJhc2gtMi4wNCQgZ2NjIC12IC1vIHgyIC1nIHgyLmMKUmVhZGluZyBz
cGVjcyBm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