Bug 71669

Summary: DW_AT_data_bit_offset is not emitted for dwarf4 and above
Product: gcc Reporter: Andrew Pinski <pinskia>
Component: debugAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: jakub
Priority: P3    
Version: 6.1.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description Andrew Pinski 2016-06-26 20:36:02 UTC
http://www.dwarfstd.org/ShowIssue.php?issue=081130.1

Due to the no so nice parts of DW_AT_bit_offset for little-endian, the dwarf standard come up with DW_AT_data_bit_offset  to fix that.

DW_AT_bit_offset has been deprecated for dwarf4.
Comment 1 Andrew Pinski 2016-06-26 20:38:42 UTC
Note GDB does not support it yet:
https://sourceware.org/bugzilla/show_bug.cgi?id=12616
Comment 2 Jakub Jelinek 2017-01-17 17:42:38 UTC
Author: jakub
Date: Tue Jan 17 17:42:06 2017
New Revision: 244542

URL: https://gcc.gnu.org/viewcvs?rev=244542&root=gcc&view=rev
Log:
	PR debug/71669
	* dwarf2out.c (add_data_member_location_attribute): For constant
	offset bitfield emit for -gdwarf-5 DW_AT_data_bit_offset attribute
	instead of DW_AT_data_member_location, DW_AT_bit_offset and
	DW_AT_byte_size attributes.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
Comment 3 Jakub Jelinek 2017-01-17 17:46:55 UTC
Fixed on the trunk (if you use -gdwarf-5).