From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28177 invoked by alias); 12 Jun 2007 15:22:27 -0000 Received: (qmail 28167 invoked by uid 22791); 12 Jun 2007 15:22:26 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Jun 2007 15:22:23 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 16729982DE for ; Tue, 12 Jun 2007 15:22:21 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id CE66A982DC for ; Tue, 12 Jun 2007 15:22:20 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1Hy8CZ-0000uY-D6 for gdb-patches@sourceware.org; Tue, 12 Jun 2007 11:22:35 -0400 Date: Tue, 12 Jun 2007 15:22:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [5/10] Add "explicit size" types to builtin_type Message-ID: <20070612152235.GC16068@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <200706082316.l58NGCCu017575@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200706082316.l58NGCCu017575@d12av02.megacenter.de.ibm.com> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-06/txt/msg00179.txt.bz2 On Sat, Jun 09, 2007 at 01:16:12AM +0200, Ulrich Weigand wrote: > Hello, > > the builtin_type structure does not contain the builtin types that > are supposedly independent of the gdbarch. However, as already > noted in comments in gdbtypes.c, this isn't really true: those types > contain pointer_type and reference_type fields caching pointer and > reference types to those base types -- and those will always be > platform-dependent. Thus the base types must be treated as > platform-dependent as well. > > This patch adds all those missing types to the builtin_type structure. This one may be a problem. From tdesc_named_type: /* Next try some predefined types. Note that none of these types depend on the current architecture; some of the builtin_type_foo variables are swapped based on the architecture. */ if (strcmp (id, "int8") == 0) return builtin_type_int8; This function is returning types for register values, before we have constructed the corresponding gdbarch. We'll now grab them from some other random gdbarch (of course, we were sort of doing that before, but it worked - in practice these types are never used anywhere that their address can be taken). I wonder if we could fix this by moving the pointer and reference type caches out of the types themselves, and into per-architecture data? Or perhaps use tables based only on the pointer size and other attributes; they do not really need to be per-architecture, just cached. An i386 and i686 can use the same void *. -- Daniel Jacobowitz CodeSourcery