09a15b6 Support reading data member offset from DW_AT_bit_offset

Authored and Committed by Dodji Seketeli 8 years ago
    Support reading data member offset from DW_AT_bit_offset
    
    There are times where the DW_AT_data_member_location attribute is set
    to zero and where the actual offset of the data member is the value of
    the DW_AT_bit_offset.  This seems to be happening when a union type is
    involved.
    
    To get the offset of a data member, this patch makes us read the
    DW_AT_bit_offset when it's present.  Otherwise, it gets the offset
    from the DW_AT_data_member_location as we used to do.
    
    In the passing the patch fixes the offset of base classes; the
    nubmer of bytes value was what was being used, rather than the number
    bits value.
    
    	* src/abg-dwarf-reader.cc (die_member_offset): Better comments.
    	Support reading the bit offset also from the DW_AT_bit_offset
    	attribute when it's present.  Make sure this always returns a
    	value in bits.
    	(build_class_type_and_add_to_ir): No need to multiply (by 8) the
    	value returned by die_member_offset anymore because it's now in
    	bits directly.
    	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report0.txt: Adjust.
    	* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt: Adjust.
    	* tests/data/test-read-dwarf/test1.abi: Adjust.
    	* tests/data/test-read-dwarf/test11-pr18828.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test12-pr18844.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test13-pr18894.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test14-pr18893.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test16-pr18904.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test17-pr19027.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
    	Adjust.
    	* tests/data/test-read-dwarf/test21-pr19092.so.abi: Adjust.
    	* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
    	Adjust.
    
    Signed-off-by: Dodji Seketeli <dodji@redhat.com>
    
        
file modified
+38 -16