Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFC] Fix verification of changed values for big values.
Date: Thu, 04 Jun 2009 17:54:00 -0000	[thread overview]
Message-ID: <m3k53ropex.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1243802866.26363.35.camel@hactar> (Thiago Jung Bauermann's message of "Sun\, 31 May 2009 17\:47\:46 -0300")

>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Thiago> Right now, GDB calls value_equal when comparing the old and new values
Thiago> of a watchpoint. IMO this is not correct, since that function will call
Thiago> coerce_array and effectively just compare the addresses of arrays being
Thiago> watched.

Thiago> This patch introduces a new value comparison function which works in the
Thiago> mentioned case, and a testcase which fails without the patch and passes
Thiago> with it. Ok to commit?

This makes sense to me.

Thiago> +  return TYPE_CODE (type1) == TYPE_CODE (type2)
Thiago> +    && TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
Thiago> +    && memcmp (value_contents (arg1), value_contents (arg2),
Thiago> +	       TYPE_LENGTH (type1)) == 0;

A style nit: multi-line expressions should be wrapped in parens, and
the continuation lines here should be indented more deeply.

Also, I think value_equal_watchpoint should be in one of the
value-related files.  My reasoning is that I've occasionally run
across code duplication because some function like this was defined in
an obscure place.

Tom


      reply	other threads:[~2009-06-04 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-31 20:48 Thiago Jung Bauermann
2009-06-04 17:54 ` Tom Tromey [this message]

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=m3k53ropex.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=bauerman@br.ibm.com \
    --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