Initial support for DW_TAG_partial_unit
* src/abg-dwarf-reader.cc (read_context::cur_tu_die_): New member.
(read_context::read_context): Initialize the new member.
(read_context::cur_tu_die): New accessors.
(find_last_import_unit_point_before_die): New static function.
(get_parent_die): Take a logical current die offset parameter. If
the die we want the parent for is a partial unit, then find the
last DW_TAG_imported_unit that imports that partial unit before
the logical current die and return the parent of that
DW_TAG_imported_unit die.
(get_scope_for_die): Take a logical current die offset parameter.
Adjust.
(build_translation_unit_and_add_to_ir): Set/unset the current
translation unit DIE in the context. Adjust.
(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, build_ir_node_from_die):
Take a logical current die offset parameter. Adjust.
(build_corpus): Accept that we can have DIE that are not
DW_TAG_compile_unit at the top level, because, well, we can now
have DW_TAG_partial_unit too.
* tests/data/test-read-dwarf/test2-{0,1}.cc: New test source
files.
* tests/data/test-read-dwarf/test2.h: Likewise.
* tests/data/test-read-dwarf/test2.so: New input binary to read.
* tests/data/test-read-dwarf/test2.so.abi: New reference test to
compare against.
* tests/test-read-dwarf.cc: Adjust to launch the new test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-19 15:26:40 +00:00
|
|
|
<abi-corpus path='data/test-read-dwarf/test2.so'>
|
|
|
|
<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_typeC2Ev' 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 name='_ZN10first_typeC2Ev' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
|
|
<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 name='_ZN1a16build_first_typeEv' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
|
|
<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_typeC2Ev' 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 name='_ZN11second_typeC2Ev' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
|
|
<parameter type-id='type-id-10' is-artificial='yes'/>
|
|
|
|
</function-decl>
|
|
|
|
</member-function>
|
|
|
|
</class-decl>
|
2014-05-19 19:35:56 +00:00
|
|
|
<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'/>
|
Initial support for DW_TAG_partial_unit
* src/abg-dwarf-reader.cc (read_context::cur_tu_die_): New member.
(read_context::read_context): Initialize the new member.
(read_context::cur_tu_die): New accessors.
(find_last_import_unit_point_before_die): New static function.
(get_parent_die): Take a logical current die offset parameter. If
the die we want the parent for is a partial unit, then find the
last DW_TAG_imported_unit that imports that partial unit before
the logical current die and return the parent of that
DW_TAG_imported_unit die.
(get_scope_for_die): Take a logical current die offset parameter.
Adjust.
(build_translation_unit_and_add_to_ir): Set/unset the current
translation unit DIE in the context. Adjust.
(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, build_ir_node_from_die):
Take a logical current die offset parameter. Adjust.
(build_corpus): Accept that we can have DIE that are not
DW_TAG_compile_unit at the top level, because, well, we can now
have DW_TAG_partial_unit too.
* tests/data/test-read-dwarf/test2-{0,1}.cc: New test source
files.
* tests/data/test-read-dwarf/test2.h: Likewise.
* tests/data/test-read-dwarf/test2.so: New input binary to read.
* tests/data/test-read-dwarf/test2.so.abi: New reference test to
compare against.
* tests/test-read-dwarf.cc: Adjust to launch the new test.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-05-19 15:26:40 +00:00
|
|
|
<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 name='_ZN1a17build_second_typeEv' type='func-type' binding='global-binding' is-defined='yes'/>
|
|
|
|
<return type-id='type-id-10'/>
|
|
|
|
</function-decl>
|
|
|
|
</namespace-decl>
|
|
|
|
</abi-instr>
|
|
|
|
</abi-corpus>
|