From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17094 invoked by alias); 21 Jun 2011 12:54:21 -0000 Received: (qmail 17086 invoked by uid 22791); 21 Jun 2011 12:54:20 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD 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; Tue, 21 Jun 2011 12:54:01 +0000 Received: (qmail 22165 invoked from network); 21 Jun 2011 12:54:00 -0000 Received: from unknown (HELO ?192.168.0.101?) (yao@127.0.0.2) by mail.codesourcery.com with ESMTPA; 21 Jun 2011 12:54:00 -0000 Message-ID: <4E009466.8080103@codesourcery.com> Date: Tue, 21 Jun 2011 12:54:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [PATCH] append_composite_type_field_aligned References: <4DF0E83C.8010600@broadcom.com> <4E0068A2.8060505@broadcom.com> In-Reply-To: <4E0068A2.8060505@broadcom.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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: 2011-06/txt/msg00283.txt.bz2 On 06/21/2011 05:47 PM, Andrew Burgess wrote: > ping. > > If there's anything else I should do to help progress this then please > let me know. > I can't see there is anything else you should do. Just wait for maintainers to review this patch. >> gdb/ChangeLog >> >> 2011-06-09 Andrew Burgess >> >> * gdbtypes.c (append_composite_type_field_aligned): Fix >> calculation of bit position based on alignment. >> >> diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c >> index 2bdb4eb..ba957f9 100644 >> --- a/gdb/gdbtypes.c >> +++ b/gdb/gdbtypes.c >> @@ -3654,12 +3654,14 @@ append_composite_type_field_aligned (struct >> type *t, char *name, >> >> if (alignment) >> { >> - int left = FIELD_BITPOS (f[0]) % (alignment * >> TARGET_CHAR_BIT); >> + int left; >> + alignment *= TARGET_CHAR_BIT; >> + left = FIELD_BITPOS (f[0]) % alignment; >> >> if (left) >> { >> - FIELD_BITPOS (f[0]) += left; >> - TYPE_LENGTH (t) += left / TARGET_CHAR_BIT; >> + FIELD_BITPOS (f[0]) += (alignment - left); >> + TYPE_LENGTH (t) += (alignment - left) / TARGET_CHAR_BIT; >> } >> } >> } I am not the people to approve this. I read your patch, and it looks correct. -- Yao (齐尧)