readelf: print split CUs when given --debug-dump=info+
authorMark Wielaard <mark@klomp.org>
Fri, 19 Jan 2018 14:45:16 +0000 (15:45 +0100)
committerMark Wielaard <mark@klomp.org>
Thu, 24 May 2018 15:37:00 +0000 (17:37 +0200)
commit184fd30d1a453dc165ffc187b22dec6d196522ad
tree6d884017cbc7719a75ca61130b595860cbd84814
parentac6960d6b8602df97b5964f66ffc7cd91fd16e5b
readelf: print split CUs when given --debug-dump=info+

To show the difference between "regular" CUs and split CUs print
offsets and references between { and } instead of [ and ].

When --debug-dump=info+ is given (implied by -w) instead of
--debug-dump=info any skeleton unit will be immediately followed
by the corresponding split compile unit (from the .dwo file).

DWARF section [27] '.debug_info' at offset 0x1075:
 [Offset]
 Compilation unit at offset 0:
 Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
 Unit type: skeleton (4), Unit id: 0xc152129eb4b99599
 [     b]  compile_unit         abbrev: 1
           ranges               (sec_offset) range list [     0]
           low_pc               (addr) +000000000000000000
           stmt_list            (sec_offset) 0
           GNU_dwo_name         (strp) "foo.dwo"
           comp_dir             (strp) "/tmp"
           GNU_pubnames         (flag_present) yes
           GNU_addr_base        (sec_offset) 0
           GNU_dwo_id           (data8) 0xc152129eb4b99599
           GNU_ranges_base      (sec_offset) 0
 Split compilation unit at offset 0:
 Version: 4, Abbreviation section offset: 0, Address size: 8, Offset size: 4
 Unit type: skeleton (4), Unit id: 0xc152129eb4b99599
 {     b}  compile_unit         abbrev: 1
           producer             (GNU_str_index) "GNU C11 7.3.0 -gsplit-dwarf -g"
           language             (data1) C99 (12)
           name                 (GNU_str_index) "foo.c"
           comp_dir             (GNU_str_index) "/tmp"
           GNU_dwo_id           (data8) 0xc152129eb4b99599
 {    18}    subprogram           abbrev: 2
             external             (flag_present) yes
             name                 (GNU_str_index) "main"
             decl_file            (data1) foo.c (1)
             decl_line            (data1) 1
             type                 (ref4) {    2b}
             high_pc              (data8) 3
             frame_base           (exprloc)
              [ 0] call_frame_cfa
             GNU_all_call_sites   (flag_present) yes
 {    2b}    base_type            abbrev: 3
             byte_size            (data1) 4
             encoding             (data1) signed (5)
             name                 (string) "int"

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/readelf.c