Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: Doug Evans <dje@google.com>, gdb-patches@sourceware.org
Subject: Re: Per-type architecture (Re: [10/15] Basic value access routines)
Date: Tue, 23 Jun 2009 13:49:00 -0000	[thread overview]
Message-ID: <20090623134938.GA12312@caradoc.them.org> (raw)
In-Reply-To: <200906230041.n5N0fMYW019073@d12av02.megacenter.de.ibm.com>

On Tue, Jun 23, 2009 at 02:41:22AM +0200, Ulrich Weigand wrote:
> - for values of bitfield type, the bitfield byte order (as you mention)

We don't actually need the architecture for this, given the type.  But
that's only because the way we record this in types requires the
architecture when building the type; I've seriously considered
rearranging it so that the type was architecture neutral and the value
architecture dependent.  But it seems too fragile to touch without a
better reason...

> - for values of floating point type, the floating point format (which
>   today is sometimes, but not always, attached to the type)

Huh, when isn't it attached to the type?

> However, for the *first* set of properties it doesn't seem to make sense
> to require this information to be provided apart from the value object;
> there is just about nothing you can do with the value if you don't even
> understand how to interpret its contents.

This is the part I'm not sure about.  An int32_t from a BE application
and an int32_t from an LE application are clearly distinguished
values, but I think they're of the same type.  However, I don't feel
so strongly about this to object to your patch.

> For example, one class of such uses is to find some random type in order
> to construct an index value to pass to value_subscript (or value_ptradd)
> or the like.  We actually know the *offset* as numerical value, but finding
> the *type* to form a value object out of the offset is hard.  In this case,
> it seems to me the interface of our helper routines is simply ill-defined:
> value_subscript does not even *look* at the type of the index operand, the
> only thing it does to the value is calling value_as_long!  So simply changing
> the interface to take a LONGEST instead of value fixes this class of problems
> while making the callers simpler.

For my two cents, I would have preferred we had a uniform internal
value/type system where everything operated on struct value.  Then you
know exactly what any value_* routine expects: always value(s).
That's why I wanted frame unwinding to use values instead of buffers.

> This seems even uglier to me :-)  Maybe I'm just looking at this particular
> target-description case a bit differently, but for me tdesc_type is not
> "inventing a new ad-hoc representation of types", it is simply a 1:1 in-memory
> representation of the XML contents without any GDB-specific reinterpretation
> -- think something like "DOM tree" structures.  In fact, if it weren't that
> we want to avoid excessive dependencies on XML libraries, I'd argue we should
> just parse XML into a standard DOM tree representation as provided by those.

Good point.  Yes, I'd much preferred we had a DOM; I looked at several
minimalist C DOM implementations, but couldn't find one that I trusted
to work nearly as well as expat.  Since expat ended up external to the
GDB source tree anyway, maybe it would have been wiser to pick GNOME's
libxml2.

The duplication of type layouts bugs me, but let's go with it.
Afterwards, I'll do a second merge into our internal tree and see what
the extra type support looks like.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2009-06-23 13:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 15:20 [10/15] Basic value access routines Ulrich Weigand
2009-06-15 16:35 ` Doug Evans
2009-06-15 16:59   ` Ulrich Weigand
2009-06-22 20:32     ` Per-type architecture (Re: [10/15] Basic value access routines) Ulrich Weigand
2009-06-22 20:59       ` Daniel Jacobowitz
2009-06-23  0:41         ` Ulrich Weigand
2009-06-23 13:49           ` Daniel Jacobowitz [this message]
2009-06-23 14:02             ` Pedro Alves
2009-06-23 17:06             ` Ulrich Weigand
2009-06-23 17:30               ` Daniel Jacobowitz
2009-06-23 15:55           ` Doug Evans
2009-06-23 16:42             ` Mark Kettenis
2009-06-23 16:53               ` Daniel Jacobowitz
2009-06-23 16:57             ` Ulrich Weigand
2009-06-23 17:36               ` Doug Evans
2009-06-24 15:31     ` [10/15] Basic value access routines Tom Tromey
2009-06-24 15:46       ` Daniel Jacobowitz
2009-06-24 16:26         ` Doug Evans
2009-06-24 19:41           ` Tom Tromey

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=20090623134938.GA12312@caradoc.them.org \
    --to=drow@false.org \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.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