[PATCH] D82881: [DEBUGINFO]Fix debug info for packed bitfields.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 16:15:48 PDT 2020


ABataev added a comment.

In D82881#2126698 <https://reviews.llvm.org/D82881#2126698>, @aprantl wrote:

> > gcc acts the same way just like llvm does. But seems to me, it is incorrect.
>
> I would be very careful about producing different DWARF than GCC. Chances are that most debuggers will expect this format, too. It is of course possible that both clang and GCC exhibit the same bug, but it might be worth double-checking with the dwarf-discuss mailing list if there isn't a misunderstanding of the DWARF spec here.
>
> Could you perhaps quote the DWARF spec to show how the existing code is misinterpreting it? This might help figuring out whether Clang and GCC are behaving wrong here.


Here is a statement from the standard:
A base type entry has a DW_AT_byte_size attribute, whose value is a constant, describing the size in bytes of the storage unit used to represent an object of the given type.

Currently, for example, in the  provided test, the actual storage size is 2 bytes because of the packed struct, but debug info states that the storage size is 1 byte.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82881/new/

https://reviews.llvm.org/D82881





More information about the llvm-commits mailing list