From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] default_type_align: Use type_length_units
Date: Thu, 14 Jun 2018 18:26:00 -0000 [thread overview]
Message-ID: <b45b360851abb796892dca0743a18872@polymtl.ca> (raw)
In-Reply-To: <877en1e23t.fsf@tromey.com>
On 2018-06-14 12:59, Tom Tromey wrote:
> This certainly is correct according to the comment in gdbtypes.h:
>
> /* * Return the alignment of the type in target addressable memory
> units.
>
> However, I was curious to know what DWARF specifies, to see whether
> dwarf2read was doing this as well. But DWARF seems pretty silent on
> this topic:
>
> A debugging information entry may have a DW_AT_alignment attribute
> whose value of class constant is a positive, non-zero, integer
> describing the alignment of the entity.
>
> So maybe this is depending on what your compiler does? I think I did
> not really consider this issue too deeply when writing the alignment
> support :(
From what I remember, nothing is well defined in DWARF regarding
non-8-bit-bytes. In the past, I have contributed fixes for such
architectures based on how things work with our (Ericsson) internal
compiler, and nobody complained so far. There is a BoF at Cauldron
though to talk about how to make the non-8-bit-bytes support more
"official" and testable [1], if you're interested!
Our compiler doesn't emit DW_AT_alignment AFAIK, so I don't know what it
would emit. But it would make sense if it was in addressable memory
units, just like type sizes.
> Another possible issue is that gdbtypes.c:type_align uses TYPE_LENGTH
> in
> one spot but I suppose it ought to use type_length_units if this patch
> goes in.
This use seems related to C++, and our compiler is C only, so I can't
test that. But it would make sense, I can include that change if you
prefer.
Simon
[1]
https://gcc.gnu.org/wiki/cauldron2018#Non-8-bit-byte_architecture_support_BoF
next prev parent reply other threads:[~2018-06-14 18:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 22:24 Simon Marchi
2018-06-14 16:59 ` Tom Tromey
2018-06-14 18:26 ` Simon Marchi [this message]
2018-06-14 19:50 ` Tom Tromey
2018-06-14 22:28 ` Simon Marchi
2018-06-15 16:43 ` 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=b45b360851abb796892dca0743a18872@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
--cc=tom@tromey.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