From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25062 invoked by alias); 7 Jan 2009 22:13:46 -0000 Received: (qmail 25051 invoked by uid 22791); 7 Jan 2009 22:13:44 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Jan 2009 22:13:39 +0000 Received: (qmail 19334 invoked from network); 7 Jan 2009 22:13:37 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 7 Jan 2009 22:13:37 -0000 From: Pedro Alves To: gdb-patches@sourceware.org, Tom Tromey Subject: Re: RFA: fix PR 9164 Date: Wed, 07 Jan 2009 22:13:00 -0000 User-Agent: KMail/1.9.10 References: <200901051729.39325.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901072213.43988.pedro@codesourcery.com> 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-01/txt/msg00123.txt.bz2 On Monday 05 January 2009 18:29:41, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves writes: > > Pedro> I think that m32c will need a hook here. I think that in some > Pedro> modes, size_t will be 16-bit, but pointer width 24-bits. > > Pedro> I wonder if the above shouldn't be a gdbarch method, that defaults to > Pedro> what you wrote. > > Yeah, I do see some gcc ports where size_t depends on the flags. > Not m32c, actually, but: Ah, you're only looking for SIZE_TYPE: /* We can do QI, HI, and SI operations pretty much equally well, but GCC expects us to have a "native" format, so we pick the one that matches "int". Pointers are 16 bits for R8C/M16C (when TARGET_A16 is true) and 24 bits for M32CM/M32C (when TARGET_A24 is true), but 24-bit pointers are stored in 32-bit words. */ #define BITS_PER_UNIT 8 #define UNITS_PER_WORD 2 #define POINTER_SIZE (TARGET_A16 ? 16 : 32) #define POINTERS_EXTEND_UNSIGNED 1 ... #define INT_TYPE_SIZE 16 So, SIZE_TYPE defaults to unsigned int --- 16-bit, but the pointer size varies. This means that objects can only be 16-bit big, but they can exist in a larger than 16-bit address space. -- Pedro Alves