From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32484 invoked by alias); 22 Jun 2009 20:59:53 -0000 Received: (qmail 32471 invoked by uid 22791); 22 Jun 2009 20:59:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Jun 2009 20:59:39 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 616C910F4A; Mon, 22 Jun 2009 20:59:36 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 4022B10EF6; Mon, 22 Jun 2009 20:59:36 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MIqc3-0001kH-8x; Mon, 22 Jun 2009 16:59:35 -0400 Date: Mon, 22 Jun 2009 20:59:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: Doug Evans , gdb-patches@sourceware.org Subject: Re: Per-type architecture (Re: [10/15] Basic value access routines) Message-ID: <20090622205935.GA5900@caradoc.them.org> Mail-Followup-To: Ulrich Weigand , Doug Evans , gdb-patches@sourceware.org References: <200906151658.n5FGwrN6026829@d12av02.megacenter.de.ibm.com> <200906222032.n5MKW3bR010266@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200906222032.n5MKW3bR010266@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00591.txt.bz2 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