]> sourceware.org Git - libabigail.git/commitdiff
dwarf-reader: Support fast DW_FORM_line_strp string comparison
authorDodji Seketeli <dodji@redhat.com>
Tue, 26 Jan 2021 18:19:01 +0000 (19:19 +0100)
committerDodji Seketeli <dodji@redhat.com>
Tue, 26 Jan 2021 18:19:01 +0000 (19:19 +0100)
When running Libabigail on Fedora 34 it appeared that we don't support
DW_FORM_line_strp in the fast string comparison scheme, during DIE
de-duplication.

This patch fixes that.

* src/abg-dwarf-reader.cc (compare_dies_string_attribute_value):
Support DW_FORM_line_strp.
* tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt:
New reference test output.
* tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm: New
test input.
* tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm:
Likewise.
* tests/data/Makefile.am: Add the new testing material above to
source distribution.
* tests/test-diff-pkg.cc (in_out_specs): Add the test input above
to this harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
tests/data/Makefile.am
tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt [new file with mode: 0644]
tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm [new file with mode: 0644]
tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm [new file with mode: 0644]
tests/test-diff-pkg.cc

index 099bff759b1249067630ac86aa55308ec3cb857a..4b39e966e385bba099bfadca9447674f290e5a60 100644 (file)
@@ -9414,19 +9414,23 @@ compare_dies_string_attribute_value(const Dwarf_Die *l, const Dwarf_Die *r,
   ABG_ASSERT(l_attr.form == DW_FORM_strp
             || l_attr.form == DW_FORM_string
             || l_attr.form == DW_FORM_GNU_strp_alt
-            || form_is_DW_FORM_strx(l_attr.form));
+            || form_is_DW_FORM_strx(l_attr.form)
+            || l_attr.form == DW_FORM_line_strp);
 
   ABG_ASSERT(r_attr.form == DW_FORM_strp
             || r_attr.form == DW_FORM_string
             || r_attr.form == DW_FORM_GNU_strp_alt
-            || form_is_DW_FORM_strx(r_attr.form));
+            || form_is_DW_FORM_strx(r_attr.form)
+            || l_attr.form == DW_FORM_line_strp);
 
   if ((l_attr.form == DW_FORM_strp
        && r_attr.form == DW_FORM_strp)
       || (l_attr.form == DW_FORM_GNU_strp_alt
          && r_attr.form == DW_FORM_GNU_strp_alt)
       || (form_is_DW_FORM_strx(l_attr.form)
-         && form_is_DW_FORM_strx(r_attr.form)))
+         && form_is_DW_FORM_strx(r_attr.form))
+      || (l_attr.form == DW_FORM_line_strp
+         && r_attr.form == DW_FORM_line_strp))
     {
       // So these string attributes are actually pointers into a
       // string table.  The string table is most likely de-duplicated
index 56a4c4a17d18ef5ae2b8e045b1c7d9dc96aa3de2..a23dbc6343faa723cdd6422aa5f458cf9eea3762 100644 (file)
@@ -1785,6 +1785,9 @@ test-diff-pkg/cogl-debuginfo-1.22.8-2.fc33.x86_64.rpm \
 test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt \
 test-diff-pkg/glibc-2.32-3.fc33.aarch64.rpm \
 test-diff-pkg/glibc-debuginfo-2.32-3.fc33.aarch64.rpm \
+test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt \
+test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm \
+test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm \
 \
 test-fedabipkgdiff/dbus-glib-0.104-3.fc23.x86_64.rpm \
 test-fedabipkgdiff/dbus-glib-debuginfo-0.104-3.fc23.x86_64.rpm \
diff --git a/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt
new file mode 100644 (file)
index 0000000..05d079f
--- /dev/null
@@ -0,0 +1 @@
+==== SELF CHECK SUCCEEDED for 'sshpass' ====
diff --git a/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm
new file mode 100644 (file)
index 0000000..6ba415b
Binary files /dev/null and b/tests/data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm differ
diff --git a/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm b/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm
new file mode 100644 (file)
index 0000000..c17bf0b
Binary files /dev/null and b/tests/data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm differ
index b18e09de88d0f830db9f3259c3a478e36d2e6485..a1aa16ca8bcadd6e7f5401a4f607387435b7747f 100644 (file)
@@ -658,6 +658,18 @@ static InOutSpec in_out_specs[] =
     "output/test-diff-pkg/glibc-2.32-3.fc33.aarch64-self-check-report-0.txt"
   }
   ,
+  {
+    "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm",
+    "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64.rpm",
+    "--self-check",
+    "",
+    "data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm",
+    "data/test-diff-pkg/sshpass-debuginfo-1.07-1.fc34.x86_64.rpm",
+    "",
+    "",
+    "data/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt",
+    "output/test-diff-pkg/sshpass-1.07-1.fc34.x86_64-self-check-report-0.txt"
+  },
 #endif // WITH_RPM_4_15
 #endif //WITH_RPM
 
This page took 0.077537 seconds and 5 git commands to generate.