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

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 6 20:56:04 PDT 2020


dblaikie added a comment.

In D82881#2133548 <https://reviews.llvm.org/D82881#2133548>, @ABataev wrote:

> In D82881#2133511 <https://reviews.llvm.org/D82881#2133511>, @aprantl wrote:
>
> > And conversely, with this patch applied, do GDB and LLDB still produce the expected result?
>
>
> GDB works correctly. Did not check with lldb, but it also should work. The result is similar to the debug info, produced for the next code:
>
>   struct {
>   short : 3;
>   short : 6;
>   } a;
>


Similar, but seems different in a critical way - in that code, the type of the field is short, which has size 2. Which matches the size of the field.

I think it would be pretty surprising to handle DWARF where the size of a field is different from the size of the type of that field?

That said, I don't have great suggestions for how the DWARF should communicate this packed situation where a bitfield crosses a byte boundary either.

> But the code, produced by the compiler, is also the same. So, I think, the debug info also should be the same.
> 
>> Also, what happens to the next bit field or variable right after the bit-filed with the now larger container? Is that affected by the patch?
> 
> It does not affect the next fields. We point exactly to the bytes, allocated for this particular bitfield only.




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