From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7993 invoked by alias); 18 Dec 2009 19:55:17 -0000 Received: (qmail 7985 invoked by uid 22791); 18 Dec 2009 19:55:16 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Dec 2009 19:55:11 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBIJsLAg011858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Dec 2009 14:54:21 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBIJsKtk026220; Fri, 18 Dec 2009 14:54:20 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id nBIJsJmn023770; Fri, 18 Dec 2009 14:54:19 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id A6FF1378286; Fri, 18 Dec 2009 12:54:18 -0700 (MST) From: Tom Tromey To: Joel Brobecker Cc: Vladimir Prus , gdb-patches@sourceware.org Subject: Re: RFA: unbreak typedefed bitfield References: <200912181541.30891.vladimir@codesourcery.com> <20091218130612.GD2788@adacore.com> Reply-To: tromey@redhat.com Date: Fri, 18 Dec 2009 19:55:00 -0000 In-Reply-To: <20091218130612.GD2788@adacore.com> (Joel Brobecker's message of "Fri, 18 Dec 2009 17:06:12 +0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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-12/txt/msg00266.txt.bz2 >>>>> "Joel" == Joel Brobecker writes: Joel> I have a general feeling that most of the time, the typedef should Joel> have never been passed down. But I haven't spent the time and Joel> effort to try to think globally. There are definitely cases where we want to preserve the type that the user wrote. In C, this matters for printing various character types. E.g., both wchar_t and char32_t may be typedefs of int, but we want to print them differently if they use different encodings. This preservation has to be pervasive, because of things like: print (wchar_t) 32 This example doesn't work today, but probably should. I agree that check_typedef is a problem. Perhaps we could approach the check_typedef problem using a semantic analyzer to ensure correct use. There are other idioms in gdb that also require careful attention that would benefit from this; cleanups and proper use of TRY_CATCH come to mind, but there are probably others. Another approach would be to change TYPE_LENGTH to first call check_typedef. Tom