Bug 27334 - Track bitfield size change
Summary: Track bitfield size change
Status: NEW
Alias: None
Product: libabigail
Classification: Unclassified
Component: default (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Dodji Seketeli
URL:
Keywords:
Depends on:
Blocks: 27019
  Show dependency treegraph
 
Reported: 2021-02-03 13:07 UTC by Dodji Seketeli
Modified: 2021-02-03 16:25 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dodji Seketeli 2021-02-03 13:07:45 UTC
In DWARF, the bitfield-ness is a property of the data member.

For instance consider this type:

struct S
{
  int m;
};

Here is what its Debug Information Entry, from DWARF would look like:

 [    2d]    structure_type       abbrev: 2
             name                 (string) "S"
             byte_size            (data1) 4
             decl_file            (data1) foo.c (1)
             decl_line            (data1) 1
             decl_column          (data1) 8
             sibling              (ref4) [    47]
 [    38]      member               abbrev: 3
               name                 (string) "m"
               decl_file            (data1) foo.c (1)
               decl_line            (data1) 3
               decl_column          (data1) 7
               type                 (ref4) [    47]
               byte_size            (data1) 4
               bit_size             (data1) 2
               bit_offset           (data1) 30
               data_member_location (data1) 0
 [    47]    base_type            abbrev: 4
             byte_size            (data1) 4
             encoding             (data1) signed (5)
             name                 (string) "int"

There, you can see that the data member "m" has a DW_AT_bit_size attribute which value is set to 2.  It also has a DW_AT_byte_size attribute set to 4.  It's type however, is an integer, of size 4, defined at offset 0x47.

The presence of the DW_AT_{bit,byte}_size attributes on the DIE of "m" is how we detect that "m" is a bitfield.

Today, libabigail doesn't record that information in its internal representation.

It ought to represent it and it ought to detect and report changes to that information.  It also need to save that information into the ABIXML textual representation and should be able to read it back from it.