Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <kettenis@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/RFA] Fix varobj.c value comparison problems
Date: Fri, 18 Feb 2005 15:28:00 -0000	[thread overview]
Message-ID: <20050218024644.GA2134@nevyn.them.org> (raw)
In-Reply-To: <200502180231.j1I2VohT030718@copland.sibelius.xs4all.nl>

On Thu, Feb 17, 2005 at 09:31:50PM -0500, Mark Kettenis wrote:
> Here's a patch for the problems with uninitialized floating-point
> varobj stuff I reported a few days ago.  This patch introduces a new
> function value_contents_equal.  That part is pretty "obvious",
> although one might argue that it should be put in valarith.c.  I
> didn't put it there because this doesn't implement a C operator.
> 
> The patch then changes my_value_equal in varobj.c to use that new
> function.  I radically simplified the function.  I think these
> simplifications are justified.  The function is used to compare the
> old value of a variable with the new value of a variable.  Therefore
> the value of VAR1 should already be known.  I've put in a gdb_assert
> to make sure this is indeed the case.  So we only have to deal with
> unlazying VAR2.  Thus far, it seems that I'm right.  This patch fixes
> the problems I was seeing and doesn't introduce any new failures.
> 
> If nobody can shoot any holes in my reasoning, I'll check this in in a
> few days.

It sounds right to me.

> +  type1 = check_typedef (value_type (val1));
> +  type2 = check_typedef (value_type (val2));
> +  len = TYPE_LENGTH (type1);
> +  if (len != TYPE_LENGTH (type2))
> +    return 0;

Should we just require equal types?  I can't think of a real example,
but hypothetically, if we had a language with tagged unions:
  int kind;
  union { int a; float b; } u __attribute__((tagged(kind)))

and "kind" changed, thereby changing u from "0x80000000" to "whatever
that is as a single-precision float", the client would probably want to
update its display.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


  reply	other threads:[~2005-02-18  2:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18 15:28 Mark Kettenis
2005-02-18 15:28 ` Daniel Jacobowitz [this message]
2005-02-18 19:00 ` Andrew Cagney
2005-02-20 15:21   ` M.M. Kettenis
2005-02-20 20:37 Paul Schlie

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=20050218024644.GA2134@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@gnu.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