From: Dodji Seketeli Date: Thu, 12 Nov 2015 12:44:59 +0000 (+0100) Subject: Correctly handle fn DIE with abstract_origin in alt debug info X-Git-Tag: 1.0.rc0~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18c3ce3e568b990bf3891c8b0806352f26da756d;p=platform%2Fupstream%2Flibabigail.git Correctly handle fn DIE with abstract_origin in alt debug info When a function decl DIE is in the main DWARF file but has an abstract origin that is in the alternate DWARF file, the dwarf reader mistakenly considers the resulting function decl as being for a DIE that is in the alternate DWARF file. Fixed thus. * src/abg-dwarf-reader.cc (build_ir_node_from_die): Consider that the function decl is for a DIE in the alternate debug info file only if the DIE itself comes from the alternate debug info file, not if the specification or the origin of the function comes from the alternate debug info file. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm: New test input rpm. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm: Likewise. * tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-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_specs): Use the new test rpm inputs. Signed-off-by: Dodji Seketeli --- diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index a463cacf..1eda045c 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -8264,7 +8264,7 @@ build_ir_node_from_die(read_context& ctxt, // of 'd'. fn = fn->clone(); ctxt.associate_die_to_decl(dwarf_dieoffset(die), - is_in_alternate_debug_info, + die_is_from_alt_di, fn); } } diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index d2b8eb57..a430ce2b 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -948,4 +948,9 @@ test-diff-pkg/tarpkg-0-dir2.tar \ test-diff-pkg/tarpkg-0-dir2.ta \ test-diff-pkg/tarpkg-0-dir2.tar.bz2 \ test-diff-pkg/tarpkg-0-dir2.tar.gz \ -test-diff-pkg/tarpkg-0-report-0.txt +test-diff-pkg/tarpkg-0-report-0.txt \ +test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm \ +test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm \ +test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm \ +test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm \ +test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt diff --git a/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm b/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm new file mode 100644 index 00000000..f1f05bfb Binary files /dev/null and b/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm differ diff --git a/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt b/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt new file mode 100644 index 00000000..e69de29b diff --git a/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm b/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm new file mode 100644 index 00000000..d5d8aa76 Binary files /dev/null and b/tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm differ diff --git a/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm b/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm new file mode 100644 index 00000000..a7ac683c Binary files /dev/null and b/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm differ diff --git a/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm b/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm new file mode 100644 index 00000000..6f658b49 Binary files /dev/null and b/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm differ diff --git a/tests/test-diff-pkg.cc b/tests/test-diff-pkg.cc index f788282a..5dca56e4 100644 --- a/tests/test-diff-pkg.cc +++ b/tests/test-diff-pkg.cc @@ -244,6 +244,16 @@ static InOutSpec in_out_specs[] = "data/test-diff-pkg/test-rpm-report-5.txt", "output/test-diff-pkg/test-rpm-report-5.txt" }, + { + "data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm", + "data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm", + "--no-added-syms", + "", + "data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm", + "data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm", + "data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt", + "output/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64--qemu-img-rhev-2.3.0-20.el7.ppc64-report-0.txt" + }, #endif //WITH_RPM #ifdef WITH_DEB