From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19246 invoked by alias); 15 May 2006 17:16:11 -0000 Received: (qmail 19233 invoked by uid 22791); 15 May 2006 17:16:11 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Mon, 15 May 2006 17:16:07 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Ffgfr-0000Kf-RZ; Mon, 15 May 2006 13:16:03 -0400 Date: Mon, 15 May 2006 19:06:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] Cleaner handling of character entities ? Message-ID: <20060515171603.GE385@nevyn.them.org> Mail-Followup-To: Jim Blandy , Joel Brobecker , gdb-patches@sources.redhat.com References: <20060505182351.GK1109@adacore.com> <20060505182852.GL31029@nevyn.them.org> <20060505190625.GA1042@adacore.com> <20060505194846.GO31029@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00341.txt.bz2 On Fri, May 05, 2006 at 02:47:00PM -0700, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > On Fri, May 05, 2006 at 12:40:02PM -0700, Jim Blandy wrote: > >> > >> Joel Brobecker writes: > >> > We would be left with: > >> > > >> > * dwarf2read.c (read_base_type): Set code to TYPE_CODE_CHAR > >> > for char and unsigned char types of Ada compilation units. > >> > * ada-lang.c (ada_is_character_type): Always return true if > >> > the type code is TYPE_CODE_CHAR. > >> > > >> > Would that be OK? > >> > >> Yeah, I think that sounds like the right thing. > > > > Alternatively, do we think we ought to be using TYPE_CODE_CHAR, and if > > so, should we try it? > > If we do that, we're effectively signing up to go through GDB and make > CHAR cases behave more like the INT cases. Which makes that code less > likely to work properly in languages that really do distinguish the > two. Or more likely to work properly. Because C does not treat them the same, the TYPE_CODE_CHAR case is fairly likely to be bitrotten anyway. > I think we should reserve the TYPE_CODE_INT / TYPE_CODE_CHAR > distinction for use in source languages that really make the > distinction, and let languages where characters are just another kind > of integer use TYPE_CODE_INT for everything. Anyway, this is fine by me. However, in tdep files, we don't want to make language distinctions. So, Joel, I think that a patch along the lines of that changelog entry above is probably the way to go, but then you may want to audit uses of TYPE_CODE_INT and TYPE_CODE_CHAR in backends or else calling Ada procedures which take chars may not work well. [Sounds like a new testcase, doesn't it?] -- Daniel Jacobowitz CodeSourcery