From: Luis Machado <luisgpm@linux.vnet.ibm.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org, bauerman@br.ibm.com, tyrlik@us.ibm.com
Subject: Re: [PATCH 1/2] Support the new PPC476 processor -- Arch Independent
Date: Tue, 29 Dec 2009 18:59:00 -0000 [thread overview]
Message-ID: <1262113162.5852.27.camel@gargoyle> (raw)
In-Reply-To: <1262112901.5852.25.camel@gargoyle>
Hey,
On Tue, 2009-12-29 at 16:55 -0200, Luis Machado wrote:
> > > -/* Check watchpoint condition. */
> > > +/* Check watchpoint condition. We can't use value_equal because it coerces
> > > + an array to a pointer, thus comparing just the address of the array instead
> > > + of its contents. This is not what we want. */
> > > +
> > > +static int
> > > +value_equal_watchpoint (struct value *arg1, struct value *arg2)
> > > +{
> > > + struct type *type1, *type2;
> > > +
> > > + type1 = check_typedef (value_type (arg1));
> > > + type2 = check_typedef (value_type (arg2));
> > > +
> > > + return TYPE_CODE (type1) == TYPE_CODE (type2)
> > > + && TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
> > > + && memcmp (value_contents (arg1), value_contents (arg2),
> > > + TYPE_LENGTH (type1)) == 0;
> > > +}
> > >
> > > static int
> > > watchpoint_check (void *p)
> > > @@ -3246,7 +3388,7 @@ watchpoint_check (void *p)
> > >
> > > fetch_watchpoint_value (b->exp, &new_val, NULL, NULL);
> > > if ((b->val != NULL) != (new_val != NULL)
> > > - || (b->val != NULL && !value_equal (b->val, new_val)))
> > > + || (b->val != NULL && !value_equal_watchpoint (b->val, new_val)))
> >
> > Can you elaborate the need for this change? It seems to change the
> > semantics of watchpoint_check, so I wonder why it is done.
> >
>
> It's done so we can detect triggers due to a range watchpoint. Since we
> don't have the data address that caused the trigger, we need to go
> through the entire range of a range watchpoint in order to tell if
> something has changed. That's why we have a specific function to check
> that (value_equal_watchpoint (b->val, new_val)).
Just ignore this bit since Thiago already dealt with this one in his
recent patch.
Luis
next prev parent reply other threads:[~2009-12-29 18:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 20:49 Sérgio Durigan Júnior
2009-12-18 11:28 ` Eli Zaretskii
2009-12-29 18:55 ` Luis Machado
2009-12-29 18:59 ` Luis Machado [this message]
2009-12-30 2:00 ` Thiago Jung Bauermann
2009-12-30 5:02 ` Joel Brobecker
2009-12-30 5:11 ` Joel Brobecker
2009-12-30 17:41 ` Thiago Jung Bauermann
2009-12-30 20:44 ` 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=1262113162.5852.27.camel@gargoyle \
--to=luisgpm@linux.vnet.ibm.com \
--cc=bauerman@br.ibm.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=tyrlik@us.ibm.com \
/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