public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: [PATCH] DWARFv5 DW_TAG_aligned_type.
Date: Thu, 17 Jul 2014 22:25:00 -0000	[thread overview]
Message-ID: <1405635556.17759.205.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: <20140711144227.GB4888@adacore.com>

On Fri, 2014-07-11 at 07:42 -0700, Joel Brobecker wrote:
> 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?

They do that because it assumes the proposed DWARF extension requires
interpreting "layered" user alignments as if they follow C semantics.
But you are right that should not be necessary. I just hadn't considered
anything else than the C semantics when writing the code. Sorry.

We do need to specify what it means when you have a type that is wrapped
in multiple (different) user alignment tags. We could either say that
has to be resolved by the consumer based on the semantics dictated by
the DW_AT_language of the compile unit. Or we could say that a producer
is responsible for interpreting the language semantics by making sure
that the "outer" user alignment overrides any other user alignment tags
(so in the C case, the producer would NOT add an extra user alignment
tag, unless it was stricter than any existing ones for the underlying
type). I think my preference is to do the second, make the producer
responsible. What do you think?

Thanks,

Mark

  reply	other threads:[~2014-07-17 22:19 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 [this message]
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=1405635556.17759.205.camel@bordewijk.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --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).