mirror of
git://sourceware.org/git/libabigail.git
synced 2025-02-06 08:41:37 +00:00
7b126c03a0
ABGBZ#17193 * include/abg-dwarf-reader.h (class read_context) (typedef read_context_sptr, create_read_context) (has_alt_debug_info): Declare these. (read_corpus_from_elf): Declare new overload. * src/abg-dwarf-reader.cc (find_alt_debug_info) (is_die_attribute_resolved_through_gnu_ref_alt) (build_primary_die_parent_relations_under) (build_alternate_die_parent_relations_under): Define new static functions. (read_context::{alt_dwarf_, alt_debug_info_path_, alternate_die_decl_map_, alternate_die_parent_map_}): New data members. (read_context::{alt_dwarf, alt_debug_info_path, alternate_die_decl_map, associate_die_to_decl_primary, associate_die_to_decl_alternate, associate_die_to_decl, lookup_decl_from_die_offset_primary, lookup_decl_from_die_offset_alternate, lookup_decl_from_die_offset, alternate_die_parent_map}): New member functions. (read_context::load_debug_info): Painfully Get a handle on the alternate debug info section too. We shouldn't have to do all this work; we could use the new dwarf_getalt() function from libdw, but we cannot as we want to support supports that predate that api. When a version of elfutils gets released with that api though, we should conditionally use that instead. (build_ir_node_from_die, get_parent_die, get_scope_for_die) (build_namespace_decl_and_add_to_ir) (build_class_type_and_add_to_ir, build_qualified_type) (build_pointer_type_def, build_reference_type, build_typedef_type) (build_var_decl, build_function_decl): Take a new parameter that tells if the input DIE is from alternate debug info. Adjust their code accordingly. (die_die_attribute): Take a new output parameter that tells if the resolved DIE is from alternate debug info. Also take a new parameter that tells if the input DIE is from alternate debug info sections. (build_die_parent_relations_under): Take the DIE -> parent map to act upon. Also, add a new overload that takes a flag saying if the DIE is from alternate debug info or not, and act upon that. (build_die_parent_maps): Renamed build_die_parent_map into this and make it build DIE -> parent DIE relationship for the alternate debug info file as well. (find_last_import_unit_point_before_die, ): Adjust to use the information about if the relevant DIEs are in alternate debug info or not. (build_translation_unit_and_add_to_ir): Clear the alternate DIE -> decl map, that is per TU just as the primary DIE -> decl map. Adjust to use the information about if the relevant DIEs are in alternate debug info or not. (read_debug_info_into_corpus): Build the two DIE -> DIE parent maps (one for the primary debug info and one for the alternate debug info). (create_read_context, has_alt_debug_info): Define new public entry points. (read_corpus_from_elf): New entry point overload that takes a read_context. * tools/bidw.cc (options::{check_alt_debug_info_path, show_base_name_alt_debug_info_path}): New data members. (display_usage): Update for the two new options --check-alternate-debug-info and check-alternate-debug-info-base-name. (parse_command_line): Parse the two options above. (main) Handle the two new options above. * tests/Makefile.am: Build the new runtestaltdwarf test. Add the new data/test-alt-dwarf-file/* files to the build system. * tests/test-alt-dwarf-file.cc: New test driver. * tests/data/test-alt-dwarf-file/test0-common.cc: New test input files. * tests/data/test-alt-dwarf-file/libtest0-common.so: Likewise. * tests/data/test-alt-dwarf-file/test0.cc: Likewise. * tests/data/test-alt-dwarf-file/libtest0.so: Likewise. * tests/data/test-alt-dwarf-file/test0.h: Likewise. * tests/data/test-alt-dwarf-file/test0-common-dwz.debug: Likewise. * tests/data/test-alt-dwarf-file/test0-debug-dir/.build-id/16/7088580c513b439c9ed95fe6a8b29496495f26.debug: Likewise. * tests/data/test-alt-dwarf-file/test0-debug-dir/test0-common-dwz.debug: Likewise. * tests/data/test-read-dwarf/test1.abi: Adjust. bidw doesn't emit an abstract constructor/destructor anymore. It emits just the functions matching the cdtor symbols found in the binary. * tests/data/test-read-dwarf/test2.so.abi: Likewise. Signed-off-by: Dodji Seketeli <dodji@redhat.com>
63 lines
5.1 KiB
Plaintext
63 lines
5.1 KiB
Plaintext
<abi-corpus path='data/test-read-dwarf/test2.so'>
|
|
<elf-function-symbols>
|
|
<elf-symbol name='_ZN1a17build_second_typeEv' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
<elf-symbol name='_fini' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
<elf-symbol name='_ZN10first_typeC1Ev' type='func-type' binding='global-binding' alias='_ZN10first_typeC2Ev' is-defined='yes'/>
|
|
<elf-symbol name='_init' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
<elf-symbol name='_ZN1a16build_first_typeEv' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
<elf-symbol name='_ZN11second_typeC1Ev' type='func-type' binding='global-binding' alias='_ZN11second_typeC2Ev' is-defined='yes'/>
|
|
<elf-symbol name='_ZN10first_typeC2Ev' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
<elf-symbol name='_ZN11second_typeC2Ev' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
</elf-function-symbols>
|
|
<abi-instr version='1.0' address-size='64' path='test2-0.cc'>
|
|
<class-decl name='first_type' size-in-bits='64' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='4' column='1' id='type-id-1'>
|
|
<data-member access='public' layout-offset-in-bits='0'>
|
|
<var-decl name='member0' type-id='type-id-2' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='6' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='32'>
|
|
<var-decl name='member1' type-id='type-id-3' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='7' column='1'/>
|
|
</data-member>
|
|
<member-function access='public' constructor='yes'>
|
|
<function-decl name='first_type' mangled-name='_ZN10first_typeC1Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='9' column='1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='64' elf-symbol-id='_ZN10first_typeC1Ev'>
|
|
<parameter type-id='type-id-4' is-artificial='yes'/>
|
|
</function-decl>
|
|
</member-function>
|
|
</class-decl>
|
|
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-5'/>
|
|
<typedef-decl name='integer' type-id='type-id-5' id='type-id-2'/>
|
|
<type-decl name='unsigned char' size-in-bits='8' alignment-in-bits='8' id='type-id-6'/>
|
|
<typedef-decl name='character' type-id='type-id-6' id='type-id-3'/>
|
|
<pointer-type-def type-id='type-id-1' size-in-bits='64' alignment-in-bits='64' id='type-id-4'/>
|
|
<namespace-decl name='a'>
|
|
<function-decl name='build_first_type' mangled-name='_ZN1a16build_first_typeEv' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2-0.cc' line='13' column='1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='64' elf-symbol-id='_ZN1a16build_first_typeEv'>
|
|
<return type-id='type-id-4'/>
|
|
</function-decl>
|
|
</namespace-decl>
|
|
</abi-instr>
|
|
<abi-instr version='1.0' address-size='64' path='test2-1.cc'>
|
|
<class-decl name='second_type' size-in-bits='64' is-struct='yes' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='12' column='1' id='type-id-7'>
|
|
<data-member access='public' layout-offset-in-bits='0'>
|
|
<var-decl name='member0' type-id='type-id-8' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='14' column='1'/>
|
|
</data-member>
|
|
<data-member access='public' layout-offset-in-bits='32'>
|
|
<var-decl name='member1' type-id='type-id-9' visibility='default' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='15' column='1'/>
|
|
</data-member>
|
|
<member-function access='public' constructor='yes'>
|
|
<function-decl name='second_type' mangled-name='_ZN11second_typeC1Ev' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2.h' line='17' column='1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='64' elf-symbol-id='_ZN11second_typeC1Ev'>
|
|
<parameter type-id='type-id-10' is-artificial='yes'/>
|
|
</function-decl>
|
|
</member-function>
|
|
</class-decl>
|
|
<type-decl name='int' size-in-bits='32' alignment-in-bits='32' id='type-id-11'/>
|
|
<typedef-decl name='integer' type-id='type-id-11' id='type-id-8'/>
|
|
<type-decl name='unsigned char' size-in-bits='8' alignment-in-bits='8' id='type-id-12'/>
|
|
<typedef-decl name='character' type-id='type-id-12' id='type-id-9'/>
|
|
<pointer-type-def type-id='type-id-7' size-in-bits='64' alignment-in-bits='64' id='type-id-10'/>
|
|
<namespace-decl name='a'>
|
|
<function-decl name='build_second_type' mangled-name='_ZN1a17build_second_typeEv' filepath='/home/dodji/git/libabigail/dwarf/tests/data/test-read-dwarf/test2-1.cc' line='13' column='1' visibility='default' binding='global' size-in-bits='64' alignment-in-bits='64' elf-symbol-id='_ZN1a17build_second_typeEv'>
|
|
<return type-id='type-id-10'/>
|
|
</function-decl>
|
|
</namespace-decl>
|
|
</abi-instr>
|
|
</abi-corpus>
|