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: Mon, 22 Jun 2009 20:59:00 -0000 [thread overview]
Message-ID: <20090622205935.GA5900@caradoc.them.org> (raw)
In-Reply-To: <200906222032.n5MKW3bR010266@d12av02.megacenter.de.ibm.com>
On Mon, Jun 22, 2009 at 10:32:03PM +0200, Ulrich Weigand wrote:
> As to the first point, upon further investigation, it does seem
> feasible to ensure every type is related to an architecture, and
> this does in fact significantly simplify the rest of the patches.
>
> Dan, one of the reasons you brought up to keep architecture-independent
> types -back when I first started attempting to eliminate then- was the
> target-descriptions infrastructure. This currently builds up GDB type
> structures while parsing the XML file, long before we know the actual
> target gdbarch to use.
>
> However, it seems to me it is relatively straightforward to delay
> creation of GDB types until we're in tdesc_register_type, where we
> know the target gdbarch. This simply requires that while parsing
> the XML file, we store the type details into temporary data structures
> just like we do with all the other information read from XML.
>
> The following patch does so, using a new "tdesc_type" structure to
> hold type information from XML files. Does this look reasonable?
I think you're simplifying the wrong thing - it probably simplifies
your patches to remove the global architecture a lot, but I think it
makes the rest of GDB more complicated in exchange. Why should types
have an associated architecture, in and of themselves?
The only reason I currently know of is the way GDB numbers bitfields.
So while I really do think this is an ugly change, I won't object; I'm
carrying a pretty hideous patch that builds types as big-endian during
parsing and then renumbers bitfield positions if we need a
little-endian copy of the type.
Maybe we can take a similar approach here. Instead of inventing a new
ad-hoc representation of types, use types, but make a copy with the
right architecture when they're accessed. WDYT?
If you like the idea, please let me know before trying it. I'm
merging HEAD into a tree which contains the necessary type walking
routines this afternoon, so I can show you what I mean and save us
both some work.
(You'll probably notice there's nothing about bitfields in that file
now; this is a local patch that we've been meaning to do one last
thing to before submitting it...)
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2009-06-22 20:59 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 [this message]
2009-06-23 0:41 ` Ulrich Weigand
2009-06-23 13:49 ` Daniel Jacobowitz
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=20090622205935.GA5900@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