From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22643 invoked by alias); 27 Aug 2008 13:56:36 -0000 Received: (qmail 22634 invoked by uid 22791); 27 Aug 2008 13:56:36 -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; Wed, 27 Aug 2008 13:55:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 85B3498215; Wed, 27 Aug 2008 13:55:54 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 70668981F0; Wed, 27 Aug 2008 13:55:54 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KYLV3-0005C9-68; Wed, 27 Aug 2008 09:55:53 -0400 Date: Wed, 27 Aug 2008 13:56:00 -0000 From: Daniel Jacobowitz To: Thiago Jung Bauermann Cc: "Dr. Rolf Jansen" , gdb-patches@sourceware.org Subject: Re: Two minor issues Message-ID: <20080827135553.GA19948@caradoc.them.org> Mail-Followup-To: Thiago Jung Bauermann , "Dr. Rolf Jansen" , gdb-patches@sourceware.org References: <16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com> <1219844750.6615.4.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1219844750.6615.4.camel@localhost.localdomain> 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: 2008-08/txt/msg00634.txt.bz2 On Wed, Aug 27, 2008 at 10:45:49AM -0300, Thiago Jung Bauermann wrote: > On Wed, 2008-08-27 at 08:55 -0300, Dr. Rolf Jansen wrote: > > Is there a global way to find out at compile-time at the build or host > > system the ptr-size and the long-size of the configured target > > machine, something like size_attarget_of()? > > It's not enough to do that at compile time, since some targets support > running both 32-bit and 64-bit programs (e.g., ppc64-linux). You can > check at runtime, if you have a struct gdbarch nearby: Not in arch-independent code: > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); since tdep is Target-DEPendent. But you can use the TYPE_LENGTH of builtin types; see e.g. gnu-v3-abi.c. -- Daniel Jacobowitz CodeSourcery