From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15609 invoked by alias); 27 Aug 2008 13:48:16 -0000 Received: (qmail 15597 invoked by uid 22791); 27 Aug 2008 13:48:16 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Aug 2008 13:47:30 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw1.br.ibm.com (Postfix) with ESMTP id 9CAEC32C171 for ; Wed, 27 Aug 2008 10:17:40 -0300 (BRT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m7RDkJLu909606 for ; Wed, 27 Aug 2008 10:46:32 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7RDkBjK016352 for ; Wed, 27 Aug 2008 10:46:12 -0300 Received: from [9.8.15.41] ([9.8.15.41]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m7RDkBBw015633; Wed, 27 Aug 2008 10:46:11 -0300 Subject: Re: Two minor issues From: Thiago Jung Bauermann To: "Dr. Rolf Jansen" Cc: gdb-patches@sourceware.org In-Reply-To: <16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com> References: <16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com> Content-Type: text/plain Date: Wed, 27 Aug 2008 13:48:00 -0000 Message-Id: <1219844750.6615.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit 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/msg00633.txt.bz2 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: struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (tdep->wordsize == 4) { ... } if (tdep->wordsize == 8) { ... } -- []'s Thiago Jung Bauermann IBM Linux Technology Center