libabigail/tests/data/test-diff-pkg/gtk2-debuginfo-2.24.22-5.el7.i686.rpm
Dodji Seketeli 10b029b385 Bug 19844 - Cannot try to canonicalize a type that is being constructed
maybe_canonicalize_type aborts because the assertion that
read_context::lookup_type_from_die_offset should always return a type
is violated.  read_context::lookup_type_from_die_offset is called on
the offset of a DIE of a type that is being constructed.  The problem
is that that fonction only looks in the map of types that are fully
constructed.

This patch addresses the issue by making
read_context::lookup_type_from_die_offset look up class and function
types being constructed as well.

While doing that I had to add maps for class and function types being
constructed and that are in the alternate debug info section.  I
adjusted the accessors for class and function types accordingly.  The
code using those accessors was adjusted accordingly as well.

The patch also prevents maybe_canonicalize_type for DIEs which no type
was built for, in buid_ir_node_from_die.  This is particularly for
DW_TAG_class_type and DW_TAG_structure_type DIEs.

	* src/abg-dwarf-reader.cc
	(read_context::{alternate_die_wip_classes_map_,
	alternate_die_wip_function_types_map_}): New data members.
	(read_context::lookup_type_from_die_offset): Lookup WIP class and
	function types too.
	(read_context::{die_wip_classes_map, die_wip_function_types_map}):
	Take a flag saying if we should get the map for the alternate
	debug info section or not.
	(read_context::{is_wip_class_die_offset,
	is_wip_function_type_die_offset}): Take a flagy saying if the DIE
	is in the alternate debug info section or not.
	(build_class_type_and_add_to_ir, build_function_type)
	(maybe_canonicalize_type): Adjust.
	(build_ir_node_from_die): Do not call maybe_canonicalize_type on
	type DIEs which no type has been constructed for.
	* tests/data/test-diff-pkg/gtk2-debuginfo-2.24.22-5.el7.i686.rpm:
	New test input.
	* tests/data/test-diff-pkg/gtk2-debuginfo-2.24.28-8.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.28-8.el7.i686.rpm:
	Likewise.
	* tests/data/test-diff-pkg/gtk2-immodule-xim-2.24.22-5.el7.i686--gtk2-immodule-xim-2.24.28-8.el7.i686-report-0.txt:
	New test reference output.
	* tests/data/Makefile.am: Add the new test material to the source
	distribution.
	* tests/test-diff-pkg.cc (in_out_spec): Make this test harness run
	on the new test input above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2016-03-18 18:15:29 +01:00

7.6 MiB