From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19332 invoked by alias); 11 Jul 2014 14:42:39 -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 19221 invoked by uid 89); 11 Jul 2014 14:42:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 11 Jul 2014 14:42:30 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 65E81116389; Fri, 11 Jul 2014 10:42:28 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yiNUp7UjL3Em; Fri, 11 Jul 2014 10:42:28 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1A989116387; Fri, 11 Jul 2014 10:42:28 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 8044040EBF; Fri, 11 Jul 2014 07:42:27 -0700 (PDT) Date: Fri, 11 Jul 2014 15:23:00 -0000 From: Joel Brobecker To: Mark Wielaard Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type. Message-ID: <20140711144227.GB4888@adacore.com> References: <1404944457-4500-1-git-send-email-mjw@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1404944457-4500-1-git-send-email-mjw@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-07/txt/msg00272.txt.bz2 Hi Mark, > gdb/ChangeLog > > * c-typeprint.c (cp_type_print_method_args): Handle TYPE_USER_ALIGN. > (c_type_print_varspec_prefix): Likewise. > (c_type_print_modifier): Likewise. > * dwarf2read.c (add_array_cv_aligned_type): New function. > (read_tag_aligned_type): Likewise. > (read_type_die_1): Handle DW_TAG_aligned_type. > * gdbtypes.c (make_qualified_type): Calls... > (make_qualified_aligned_type): New function that handles user > alignment. > (make_aligned_type): New function. > (check_typedef): Handle TYPE_USER_ALIGN. > (check_types_equal): Likewise. > (recursive_dump_type): Likewise. > (copy_type_recursive): Likewise. > (copy_type): Likewise. > * gdbtypes.h (struct type): Add user_align. > (TYPE_USER_ALIGN): New define. > (make_aligned_type): Define. Thanks for the patch! My only question is regarding the checks for alignments to be stricter than the alignment of their base types. Why are they needed? I am asking because, in Ada, it is allowed to be specifying an alignment which is less strict than the standard alignment. We can ask for byte-aligned integers, for instance. If I understand your patch correctly, the base type will have no alignment attribute, and therefore the 1-byte alignment attribute will be accepted. So my guess is that those checks are implementing requirements of the proposed DWARF extension. This leads me to ask why that's necessary? Shouldn't the compiler be able to provide the actual alignement allowing consumers to just follow it blindly? Thanks! -- Joel