From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8309 invoked by alias); 11 Jul 2014 15:23:56 -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 8134 invoked by uid 89); 11 Jul 2014 15:23:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 11 Jul 2014 15:23:49 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6BFNluv026483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jul 2014 11:23:47 -0400 Received: from barimba (ovpn-113-95.phx2.redhat.com [10.3.113.95]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6BFNjXn009403 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 11 Jul 2014 11:23:46 -0400 From: Tom Tromey To: Mark Wielaard Cc: gdb-patches@sourceware.org, Joel Brobecker Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type. References: <1404944457-4500-1-git-send-email-mjw@redhat.com> Date: Fri, 11 Jul 2014 15:26:00 -0000 In-Reply-To: <1404944457-4500-1-git-send-email-mjw@redhat.com> (Mark Wielaard's message of "Thu, 10 Jul 2014 00:20:57 +0200") Message-ID: <87sim77wce.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-07/txt/msg00273.txt.bz2 >>>>> "Mark" == Mark Wielaard writes: Mark> This patch is to deal with the corresponding patch to gcc: Mark> https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00667.html Thanks Mark. Mark> Like the DW_TAG_atomic_type patch (sorry, I haven't dealt yet with all Mark> the comments), this isn't meant to be applied as is (it is currently only Mark> a proposal for DWARFv5). Understood. Mark> + if (TYPE_USER_ALIGN (domain) != 0) Mark> + fprintf_filtered (stream, " _Alignas (%u)", TYPE_USER_ALIGN (domain)); I think the preferred spelling in C++ is "alignas", not "_Alignas". It would be a bit prettier if this were language-dependent. What do you think? It affects a few spots. Mark> +/* Add the given user alignment to the element type of the array. GCC Mark> + outputs DWARF type qualifiers that apply to an array, not the Mark> + element type. But GDB relies on the array element type to carry Mark> + the cv-qualifiers. This is mimics section 6.7.3, point 9 of the Mark> + C11 specification (n1570). */ Mark> +static struct type * Mark> +add_array_cv_aligned_type (struct die_info *die, struct dwarf2_cu *cu, Mark> + struct type *base_type, unsigned int user_align) Mark> +{ gdb rules put a blank line between the comment and the start of the function. Mark> + TYPE_TARGET_TYPE (inner_array) = Mark> + copy_type (TYPE_TARGET_TYPE (inner_array)); The "=" goes on the start of the next line. Mark> +static struct type * Mark> +read_tag_aligned_type (struct die_info *die, struct dwarf2_cu *cu) Mark> +{ Needs some kind of intro comment. Mark> +/* Make a '_Alignas'-qualified version of TYPE (if user_align is Mark> + stricter than the user alignment of TYPE). */ Mark> + Mark> +struct type * Mark> +make_aligned_type (struct type *type, unsigned int user_align) Mark> +{ Mark> + if (user_align > TYPE_USER_ALIGN (type)) Mark> + return make_qualified_aligned_type (type, TYPE_INSTANCE_FLAGS (type), Mark> + user_align, NULL); Like Joel I am curious about the need for this. I thought maybe it was just following the (C & C++) language standard. But would DWARF like this really be emitted by the compiler? It wasn't clear to me. Mark> + int new_user_align = TYPE_USER_ALIGN (type); Most spots are using unsigned for this. Occasionally I'm tempted to adopt the C++ style of ubiquitous typedefs to avoid this kind of mismatch. But I've never really brought that up, so I suggest just changing this instance. Mark> +2014-07-09 Mark Wielaard Mark> + Mark> + * dwarf2.def: Add DW_TAG_aligned_type and DW_AT_alignment. Not important now, but when it's time to put the patch in, this change will have to go to gcc-patches for approval & checkin; then pulled over to the binutils-gdb tree. It won't require any additional approval on this side at least. Tom