Correctly handle fn DIE with abstract_origin in alt debug info
authorDodji Seketeli <dodji@redhat.com>
Thu, 12 Nov 2015 12:44:59 +0000 (13:44 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 12 Nov 2015 15:53:36 +0000 (16:53 +0100)
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 <dodji@redhat.com>
src/abg-dwarf-reader.cc
tests/data/Makefile.am
tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-20.el7.ppc64.rpm [new file with mode: 0644]
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 with mode: 0644]
tests/data/test-diff-pkg/qemu-img-rhev-2.3.0-7.el7.ppc64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-20.el7.ppc64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm [new file with mode: 0644]
tests/test-diff-pkg.cc

index a463cacfea8aeeab78d1b710fee30d8ae18c77dc..1eda045c294ba82913304ade17692ab66cf9848b 100644 (file)
@@ -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);
                    }
                }
index d2b8eb57193b36695500e8b857ce6d2f87f315dc..a430ce2baafb42411e53d093a6d98f98e3017af1 100644 (file)
@@ -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 (file)
index 0000000..f1f05bf
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 (file)
index 0000000..e69de29
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 (file)
index 0000000..d5d8aa7
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 (file)
index 0000000..a7ac683
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 (file)
index 0000000..6f658b4
Binary files /dev/null and b/tests/data/test-diff-pkg/qemu-kvm-rhev-debuginfo-2.3.0-7.el7.ppc64.rpm differ
index f788282accfbb280325873216ed1436d2d6f7e16..5dca56e4af6e8e3e5529023d191e3b599d7fce9c 100644 (file)
@@ -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