public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Wielaard <mjw@redhat.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type.
Date: Fri, 11 Jul 2014 15:23:00 -0000	[thread overview]
Message-ID: <20140711144227.GB4888@adacore.com> (raw)
In-Reply-To: <1404944457-4500-1-git-send-email-mjw@redhat.com>

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

  reply	other threads:[~2014-07-11 14:42 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 [this message]
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
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=20140711144227.GB4888@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mjw@redhat.com \
    --cc=tromey@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).