public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Mark Wielaard <mjw@redhat.com>
Cc: gdb-patches@sourceware.org, Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type.
Date: Fri, 11 Jul 2014 15:26:00 -0000	[thread overview]
Message-ID: <87sim77wce.fsf@fleche.redhat.com> (raw)
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")

>>>>> "Mark" == Mark Wielaard <mjw@redhat.com> 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  <mjw@redhat.com>
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

  parent reply	other threads:[~2014-07-11 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 22:21 Mark Wielaard
2014-07-11 15:23 ` Joel Brobecker
2014-07-17 22:25   ` Mark Wielaard
2014-07-17 22:36     ` Mark Wielaard
2014-07-30 18:26       ` Joel Brobecker
2014-09-29 15:17         ` Mark Wielaard
2014-10-02 17:08           ` Joel Brobecker
2014-07-18 15:39     ` Tom Tromey
2014-07-11 15:26 ` Tom Tromey [this message]
2014-07-17 23:11   ` Mark Wielaard
2014-07-18 15:41     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sim77wce.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mjw@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).