Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@is.elta.co.il>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Possible bug with i386 watchpoints on several targets.
Date: Mon, 03 Dec 2001 03:10:00 -0000	[thread overview]
Message-ID: <Pine.SUN.3.91.1011203130138.16737A-100000@is> (raw)
In-Reply-To: <4.2.0.58.20011203101333.00acd588@ics.u-strasbg.fr>


On Mon, 3 Dec 2001, Pierre Muller wrote:

>    Of course i386_stopped_data_address gets called, but if you 
> set a breakpoint on the end of this function and add the condition
> ' cond X ret != 0'
> Then you will clearly see that the behavior is wrong:
> only on the first run after setting a hardware watchpoint you will get
> a non zero return value for this watchpoint.

i386_stopped_data_address has no role when a write-data hardware 
watchpoint is hit, only when read or access watchpoints are hit.  At 
least that's my reading of the code and what I see tracing through 
execution.  See breakpoint.c:bpstat_stop_status, you will see there that 
hardware watchpoints and rwatch/awatch watchpoints are treated 
differently, and i386_stopped_data_address (called via the 
target_stopped_data_address macro) is only called for awatch/rwatch.

The important function for hardware watchpoints is watchpoint_check, not 
i386_stopped_data_address.

>    As the i386_cleanup_dregs is never called for linux target,
> the internal state of the dr_mirror and dr_ref_count
> is wrong on the second start.
> dr_mirror[0] still contains the hardware watchpoint address
> and dr_ref_count contains one.

Then please explain why does the DJGPP port exhibits the same behavior as 
the Linux port with the test program you posted.  go32-nat.c _does_ call 
i386_cleanup_dregs, but the watchpoint doesn't trigger on the second run.


  reply	other threads:[~2001-12-03 11:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4.2.0.58.20011121124943.00a4a288@ics.u-strasbg.fr>
     [not found] ` <1190-Wed21Nov2001202555+0200-eliz@is.elta.co.il>
2001-11-30  7:18   ` Bug with watchpoints on Linux Pierre Muller
2001-11-21 16:19     ` Pierre Muller
2001-11-21 16:50     ` Eli Zaretskii
2001-11-21 17:07       ` [RFC] Possible bug with i386 watchpoints on several targets Pierre Muller
2001-11-30  8:06         ` Pierre Muller
2001-11-30 11:48         ` Eli Zaretskii
2001-11-23  6:39           ` Eli Zaretskii
2001-12-03  1:33           ` Pierre Muller
2001-12-03  3:10             ` Eli Zaretskii [this message]
2001-12-04  4:09               ` Pierre Muller
2001-12-04 23:50           ` Eli Zaretskii
2001-12-05  1:31             ` Pierre Muller
2001-12-05  3:23               ` Eli Zaretskii
2001-12-05  3:55                 ` Pierre Muller
2001-11-30  7:45       ` Bug with watchpoints on Linux Eli Zaretskii

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=Pine.SUN.3.91.1011203130138.16737A-100000@is \
    --to=eliz@is.elta.co.il \
    --cc=gdb-patches@sources.redhat.com \
    --cc=muller@cerbere.u-strasbg.fr \
    /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