Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Eli Zaretskii'" <eliz@gnu.org>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [RFA] Fix a windows bug if two watchpoints are used
Date: Wed, 03 Jun 2009 23:33:00 -0000	[thread overview]
Message-ID: <000601c9e4a3$b2f2f980$18d8ec80$@u-strasbg.fr> (raw)
In-Reply-To: <E1MBzlp-0003sy-TM@fencepost.gnu.org>



> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Eli Zaretskii
> Envoyé : Thursday, June 04, 2009 1:21 AM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] Fix a windows bug if two watchpoints are used
> 
> > From: "Pierre Muller" <muller@ics.u-strasbg.fr>
> > Date: Thu, 4 Jun 2009 00:58:09 +0200
> >
> >   Now comes the tricky part, why does that generate a
> > SIGTRAP?
> >   In i386_stopped_data_address,
> > the bits of dr_status_mirror (copied from current value of dr[6])
> > are checked from 0 to 3, but if hit is found for I,
> > the address value is taken from dr_mirror array.
> >
> >   Thus, according to dr[6], both debug registers 0 and 1
> > have been hit.
> >   at i=0, the correct address of ival3 is found in dr_mirror[0],
> > but after for i=1, the value of dr_mirror[1] is used, but this
> > value is 0, as only one watch is active.
> 
> Shouldn't we instead fix the logic of i386_stopped_data_address, to
> get out of the loop on the first watchpoint that is found to be hit?
> The function does not support more than one watchpoint anyway, so why
> continue checking the bits in dr[6] after we've found one set already?
> 
> Would such a change fix your problem without the other complications?

  It would hide the problem.
But what happens if you have different watchpoints
on the same address (say one 'watch' and one 'awatch')?
Are you sure your suggestion would not affect
such cases?

> Btw, I don't understand this part of i386_stopped_data_address:
> 
>   if (maint_show_dr && addr == 0)
>     i386_show_dr ("stopped_data_addr", 0, 0, hw_write);
> 
> Isn't that backwards? why display the address if it is zero?
  I think this is because if addr is non-zero, you already
have a call to i386_show_dr before with "watchpoint hit".
  This call is simply to state that stopped_data_address
was called but didn't find a hit.
  But the correct condition should be (rc == 0) instead
of (addr == 0) as setting a watchpoint at (CORE_ADDR) 0
should also work on target where this address is not protected.


Pierre


  reply	other threads:[~2009-06-03 23:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 22:58 Pierre Muller
2009-06-03 23:21 ` Eli Zaretskii
2009-06-03 23:33   ` Pierre Muller [this message]
2009-06-04  3:16     ` Eli Zaretskii
2009-06-04  3:29       ` Christopher Faylor
2009-06-04  6:34       ` [RFA-v2] " Pierre Muller
2009-06-04  7:12         ` Eli Zaretskii
2009-06-04  7:33           ` Pierre Muller
2009-06-04 10:31             ` Eli Zaretskii
2009-06-04 14:52               ` Pierre Muller
2009-06-04 15:22                 ` Eli Zaretskii
2009-06-16 22:43                   ` [PING][RFA-v2] " Pierre Muller
2009-06-22 20:56                     ` Joel Brobecker
2009-06-23  1:04                       ` Eli Zaretskii
2009-09-22 12:55                         ` [RFA-v3] " Pierre Muller
2009-09-24  3:04                           ` Eli Zaretskii
2009-09-24 17:54                           ` Joel Brobecker
2009-09-24 22:08                             ` Pierre Muller
2009-09-25  1:53                               ` Joel Brobecker
2009-09-25 15:32                                 ` Pierre Muller
2009-09-25 16:07                                   ` Joel Brobecker

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='000601c9e4a3$b2f2f980$18d8ec80$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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