From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10980 invoked by alias); 5 Jan 2009 09:23:39 -0000 Received: (qmail 10971 invoked by uid 22791); 5 Jan 2009 09:23:39 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Jan 2009 09:23:34 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id n059MkJ4017179; Mon, 5 Jan 2009 10:22:46 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id n059MjIo015901; Mon, 5 Jan 2009 10:22:45 +0100 (CET) Date: Mon, 05 Jan 2009 09:23:00 -0000 Message-Id: <200901050922.n059MjIo015901@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: brobecker@adacore.com CC: tromey@redhat.com, gdb-patches@sourceware.org In-reply-to: <20090105042336.GE31595@adacore.com> (message from Joel Brobecker on Mon, 5 Jan 2009 08:23:36 +0400) Subject: Re: RFA: fix PR 9164 References: <20090104032948.GA3339@caradoc.them.org> <20090105042336.GE31595@adacore.com> 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/msg00023.txt.bz2 > Date: Mon, 5 Jan 2009 08:23:36 +0400 > From: Joel Brobecker > > > Tom> This fix defers the choice of type to the language, using the existing > > Tom> language-arch machinery. I fixed the C language family, including > > Tom> ObjC, but I left the other languages unchanged. I think the language > > Tom> maintainers will have to make a change here, if one is needed or > > Tom> desired. (FWIW I don't think Java needs a change, since I don't think > > Tom> it is possible to invoke sizeof when Java is the selected language.) > > > > Daniel> Before adding all this, do you know of any language where the signed > > Daniel> behavior is correct? > > > > Nope. I don't know that a signed type is incorrect, either. I really > > know nothing about the other languages here, so I chose to preserve > > the current behavior. > > In Ada, the equivalent of the sizeof operator is the 'Size attribute. > This attribute is a function that returns the size in bits and its > type is a ``universal_integer''. universal_integer is not a type > you can use in declarations, but it allows any integer values, so > I think that it would be reasonable to make the 'size attribute > return a value of Integer type (thus signed). I checked the code, > and we actually use builtin_type_int32 (we used to use builtin_type_int > but this type is hard to get to, now, as you need access to the gdbarch). Well, using built_type_int32 defenitely feels wrong for a type representing sizes on a 64-bit system.