From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105589 invoked by alias); 14 Jun 2018 18:26:04 -0000 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 Received: (qmail 105575 invoked by uid 89); 14 Jun 2018 18:26:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=talk, our X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Jun 2018 18:26:02 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w5EIPtai018163 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Jun 2018 14:26:00 -0400 Received: by simark.ca (Postfix, from userid 112) id D09241EF2A; Thu, 14 Jun 2018 14:25:55 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id B544A1E529; Thu, 14 Jun 2018 14:25:49 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 14 Jun 2018 18:26:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] default_type_align: Use type_length_units In-Reply-To: <877en1e23t.fsf@tromey.com> References: <1528928623-27479-1-git-send-email-simon.marchi@ericsson.com> <877en1e23t.fsf@tromey.com> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 14 Jun 2018 18:25:55 +0000 X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00369.txt.bz2 On 2018-06-14 12:59, Tom Tromey wrote: > This certainly is correct according to the comment in gdbtypes.h: > > /* * Return the alignment of the type in target addressable memory > units. > > However, I was curious to know what DWARF specifies, to see whether > dwarf2read was doing this as well. But DWARF seems pretty silent on > this topic: > > A debugging information entry may have a DW_AT_alignment attribute > whose value of class constant is a positive, non-zero, integer > describing the alignment of the entity. > > So maybe this is depending on what your compiler does? I think I did > not really consider this issue too deeply when writing the alignment > support :( From what I remember, nothing is well defined in DWARF regarding non-8-bit-bytes. In the past, I have contributed fixes for such architectures based on how things work with our (Ericsson) internal compiler, and nobody complained so far. There is a BoF at Cauldron though to talk about how to make the non-8-bit-bytes support more "official" and testable [1], if you're interested! Our compiler doesn't emit DW_AT_alignment AFAIK, so I don't know what it would emit. But it would make sense if it was in addressable memory units, just like type sizes. > Another possible issue is that gdbtypes.c:type_align uses TYPE_LENGTH > in > one spot but I suppose it ought to use type_length_units if this patch > goes in. This use seems related to C++, and our compiler is C only, so I can't test that. But it would make sense, I can include that change if you prefer. Simon [1] https://gcc.gnu.org/wiki/cauldron2018#Non-8-bit-byte_architecture_support_BoF