From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3251 invoked by alias); 21 Dec 2009 17:08:49 -0000 Received: (qmail 3238 invoked by uid 22791); 21 Dec 2009 17:08:48 -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; Mon, 21 Dec 2009 17:08:41 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBLH8enE011272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Dec 2009 12:08:40 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nBLH8dcJ028806; Mon, 21 Dec 2009 12:08:40 -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 nBLH8cTP005638; Mon, 21 Dec 2009 12:08:39 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id A590E3781B0; Mon, 21 Dec 2009 10:08:38 -0700 (MST) From: Tom Tromey To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: unbreak typedefed bitfield References: <200912181541.30891.vladimir@codesourcery.com> <20091218130612.GD2788@adacore.com> Reply-To: tromey@redhat.com Date: Mon, 21 Dec 2009 17:08:00 -0000 In-Reply-To: (Vladimir Prus's message of "Mon, 21 Dec 2009 12:56:55 +0300") 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/msg00308.txt.bz2 >>>>> "Volodya" == Vladimir Prus writes: Volodya> It seems to me that TYPE_LENGTH may return different values before and Volodya> after check_typedef is called. Is the 'before' value ever or any use? I don't think so. My understanding is that before check_typedef is called, TYPE_LENGTH is not guaranteed to be valid. Volodya> If no, and as you say above in some cases we need to preserve Volodya> some properties of the typedef, why TYPE_LENGTH could not check Volodya> if the type is typedef, and if so, return length of the true Volodya> type? check_typedef is misnamed and is also used to resolve opaque types. Other than that, I don't know of a reason. You could try: #define TYPE_LENGTH(thistype) check_typedef (thistype)->length While this is probably insufficient to fix the check_typedef problem in general, it may help with the most common source of problems. Tom