From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12650 invoked by alias); 18 Dec 2009 14:20:27 -0000 Received: (qmail 12638 invoked by uid 22791); 18 Dec 2009 14:20:26 -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) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Dec 2009 14:20:23 +0000 Received: (qmail 2667 invoked from network); 18 Dec 2009 14:20:21 -0000 Received: from unknown (HELO wind.localnet) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Dec 2009 14:20:21 -0000 From: Vladimir Prus To: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: RFA: unbreak typedefed bitfield Date: Fri, 18 Dec 2009 14:20:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-14-generic-pae; KDE/4.3.2; i686; ; ) References: <200912181541.30891.vladimir@codesourcery.com> <20091218130612.GD2788@adacore.com> <20091218141740.GA18065@caradoc.them.org> In-Reply-To: <20091218141740.GA18065@caradoc.them.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200912181720.19470.vladimir@codesourcery.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-12/txt/msg00254.txt.bz2 On Friday 18 December 2009 17:17:40 Daniel Jacobowitz wrote: > On Fri, Dec 18, 2009 at 05:06:12PM +0400, Joel Brobecker wrote: > > > --- a/gdb/value.c > > > +++ b/gdb/value.c > > > @@ -1873,6 +1873,7 @@ value_primitive_field (struct value *arg1, int offset, > > > > > > CHECK_TYPEDEF (arg_type); > > > type = TYPE_FIELD_TYPE (arg_type, fieldno); > > > + check_typedef (type); > > > > > > /* Handle packed fields */ > > > > Looks OK to me (you forgot the ChangeLog entry, btw). > > What does this do? CHECK_TYPEDEF side-effects its argument; > check_typedef will leave its argument as a TYPE_CODE_TYPEDEF. I think > it fills in some other fields in the typedef, is that what matters > here? Yes. It makes int container_bitsize = TYPE_LENGTH (type) * 8; below not to set 'container_bitsize' to 0. > It's unusual to see check_typedef without an assignment. I can surely use type = check_typedef (type); if that seems less confusing. - Volodya