]> sourceware.org Git - libabigail.git/commitdiff
Temporarily disable redundant diff report elimination
authorDodji Seketeli <dodji@redhat.com>
Wed, 10 Dec 2014 17:24:41 +0000 (18:24 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 10 Dec 2014 18:19:57 +0000 (19:19 +0100)
So, this is all about problem report
https://sourceware.org/bugzilla/show_bug.cgi?id=17693.

When redundant diff node reporting is enabled and when a diff node
appears twice in a diff tree, we detect that and the second occurrence
of the diff node is flagged as being redundant.  Later at diff tree
node reporting time, the redundant diff node is not reported.

The problem is that diff nodes are canonicalized.  That is, when the
same change is present twice in a diff, the same diff node is going to
be present twice.  So flagging the second occurrence as being
redundant amounts as flagging the first occurrence as being redundant
too!  So at reporting time, the diff tree visitor that walks the diff
tree nodes will avoid reporting the two occurrences of diff tree nodes
altogether.  This is what happens in the example of the bug above.  I
am reproducing the example here for convenience:

So suppose we have a first version of a library named lib-v0.so which
is made of this C code:

    int add(int a, int b)
    {
    }

Then suppose that code was changed in a subsequent version of the
library named lib-v1.so, leading to the following code:

    int add(float a, float b)
    {
    }

So, the diff tree node for the 'add' function is going to have several
child diff tree nodes, among which, one that carries the change for
the first parameter (int a becoming float a) and the one carrying the
change for the second parameter (int b becoming float b).

The diff tree node for the second parameter is going to be same diff
tree node as the one for the first parameter because what counts is
the change in the *type* of the parameter.  Thus, the diff tree node
for the second parameter is going to be marked as being redundant; and
so is the first parameter.

So abidiff lib-v0.so lib-v1.so yields:

    Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added
    function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

You can see that even the function 'add' is not mentioned in the
report.  This is because it has also been considered as being
redundant because of a phenomenon named 'propagation'.  The
redundant-ness of the children nodes of the diff tree node of the
'add' function is propagated to the diff tree node of the add function
itself because that add function diff tree node has no child but
redundant diff children nodes.  This categorization behaviour is
correct.

What is not correct is that only the second child node of the add
function diff tree node should have been marked redundant.

I am going to tackle this issue a bit later.  For now, I am
temporarily disabling redundancy categorization for diff tree nodes by
default.  Hence this patch.

With this patch, abidiff lib-v0.so lib-v1.so yields:

    Functions changes summary: 0 Removed, 1 Changed, 0 Added function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

    1 function with some indirect sub-type change:

      [C]'function int add(int, int)' has some indirect sub-type changes:
parameter 0 of type 'int' changed:
  name changed from 'int' to 'float'
parameter 1 of type 'int' changed:
  name changed from 'int' to 'float'

Note how the change on the second parameter appears equal to the
change on the first.

* src/abg-comparison.cc
(diff_context::priv::priv): Show redundant changes by default.
(categorize_redundancy): Do not categorize redundancy if the
diff_context says that we shouldn't.
* tools/abicompat.cc (options::show_redundant): New data member.
(options::options): Initialize to true.
(display_usage): Add new help string for new --no-redundant and
--redundant options.
(parse_command_line): Parse new --no-redundant and --redundant
command line options.
(main): Initialize the diff context with respect to the
options::show_redundant property.
* tools/abidiff.cc (options::options): Initialize the
show_redundant_changes data member to true.
(display_usage): Show new help string for the new --no-redundant
command line option.
(parse_command_line): Parse the new --no-redundant command line
option.
* tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so:
New test data input.
* tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so:
Likewise.
* tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt:
Likewise.
* tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c:
Source code for the first binary above.
* tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c:
Source code for the second binary above.
* tests/data/Makefile.am: Add the new test data input to source
distribution.
* tests/test-abicompat.cc (in_out_specs): Add --no-redundant to
abicompat when we don't want it to show redundant diff reports.
* test-diff-filter.cc (in_out_specs): Likewise for abidiff.
* test-diff-suppr.cc (in_out_specs): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
12 files changed:
src/abg-comparison.cc
tests/data/Makefile.am
tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so [new file with mode: 0755]
tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so [new file with mode: 0755]
tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt [new file with mode: 0644]
tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c [new file with mode: 0644]
tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c [new file with mode: 0644]
tests/test-abicompat.cc
tests/test-diff-filter.cc
tests/test-diff-suppr.cc
tools/abicompat.cc
tools/abidiff.cc

index e34cd548acd7937c10c68fb3105190c964ae434b..fd32cc8f4048280d1dbedec58b3a0a251909e5c2 100644 (file)
@@ -2218,7 +2218,7 @@ struct diff_context::priv
       show_changed_vars_(true),
       show_added_vars_(true),
       show_linkage_names_(false),
-      show_redundant_changes_(false),
+      show_redundant_changes_(true),
       show_syms_unreferenced_by_di_(true),
       show_added_syms_unreferenced_by_di_(true)
    {}
@@ -11657,6 +11657,8 @@ struct redundancy_clearing_visitor : public diff_node_visitor
 void
 categorize_redundancy(diff* diff_tree)
 {
+  if (diff_tree->context()->show_redundant_changes())
+    return;
   redundancy_marking_visitor v;
   bool s = diff_tree->context()->traversing_a_node_twice_is_forbidden();
   diff_tree->context()->forbid_traversing_a_node_twice(false);
index 7ef31854bbdc535b6990cd74d5636caa18934d6c..ddddc11ebf42864656df2b40a93b83f3da223653 100644 (file)
@@ -329,6 +329,11 @@ test-diff-filter/test22-compatible-fns-report-0.txt  \
 test-diff-filter/test22-compatible-fns-report-1.txt  \
 test-diff-filter/test22-compatible-fns-v0.c \
 test-diff-filter/test22-compatible-fns-v1.c \
+test-diff-filter/libtest23-redundant-fn-parm-change-v0.so \
+test-diff-filter/libtest23-redundant-fn-parm-change-v1.so \
+test-diff-filter/test23-redundant-fn-parm-change-report-0.txt \
+test-diff-filter/test23-redundant-fn-parm-change-v0.c \
+test-diff-filter/test23-redundant-fn-parm-change-v1.c \
 \
 test-diff-suppr/test0-type-suppr-v0.cc \
 test-diff-suppr/test0-type-suppr-v1.cc \
diff --git a/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so b/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so
new file mode 100755 (executable)
index 0000000..a1ab1d9
Binary files /dev/null and b/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so differ
diff --git a/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so b/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so
new file mode 100755 (executable)
index 0000000..45ddd34
Binary files /dev/null and b/tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so differ
diff --git a/tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt b/tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt
new file mode 100644 (file)
index 0000000..19c73c3
--- /dev/null
@@ -0,0 +1,11 @@
+Functions changes summary: 0 Removed, 1 Changed, 0 Added function
+Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
+
+1 function with some indirect sub-type change:
+
+  [C]'function int add(int, int)' has some indirect sub-type changes:
+    parameter 0 of type 'int' changed:
+      name changed from 'int' to 'float'
+    parameter 1 of type 'int' changed:
+      name changed from 'int' to 'float'
+
diff --git a/tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c b/tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c
new file mode 100644 (file)
index 0000000..16ca173
--- /dev/null
@@ -0,0 +1,7 @@
+/* Compile with:
+     gcc -g -Wall -shared -o libtest23-redundant-fn-parm-change-v0.so test23-redundant-fn-parm-change-v0.c
+ */
+
+int
+add(int a, int b)
+{return a+b;}
diff --git a/tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c b/tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c
new file mode 100644 (file)
index 0000000..ee13b66
--- /dev/null
@@ -0,0 +1,7 @@
+/* Compile with:
+     gcc -g -Wall -shared -o libtest23-redundant-fn-parm-change-v1.so test23-redundant-fn-parm-change-v1.c
+ */
+
+int
+add(float a, float b)
+{return a+b;}
index 488e2d07eeee19f7738b592ac53940876962605b..071af652bebd97614d0cc557dbc53a341e9ed2e4 100644 (file)
@@ -61,7 +61,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest0-fn-changed-libapp-v0.so",
     "data/test-abicompat/libtest0-fn-changed-libapp-v1.so",
     "",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test0-fn-changed-report-0.txt",
     "output/test-abicompat/test0-fn-changed-report-0.txt",
   },
@@ -70,7 +70,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest0-fn-changed-libapp-v0.so",
     "data/test-abicompat/libtest0-fn-changed-libapp-v1.so",
     "data/test-abicompat/test0-fn-changed-0.suppr",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test0-fn-changed-report-1.txt",
     "output/test-abicompat/test0-fn-changed-report-1.txt",
   },
@@ -79,7 +79,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest1-fn-removed-v0.so",
     "data/test-abicompat/libtest1-fn-removed-v1.so",
     "",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test1-fn-removed-report-0.txt",
     "output/test-abicompat/test1-fn-removed-report-0.txt",
   },
@@ -88,7 +88,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest2-var-removed-v0.so",
     "data/test-abicompat/libtest2-var-removed-v1.so",
     "",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test2-var-removed-report-0.txt",
     "output/test-abicompat/test2-var-removed-report-0.txt",
   },
@@ -97,7 +97,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest3-fn-removed-v0.so",
     "data/test-abicompat/libtest3-fn-removed-v1.so",
     "",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test3-fn-removed-report-0.txt",
     "output/test-abicompat/test3-fn-removed-report-0.txt",
   },
@@ -106,7 +106,7 @@ InOutSpec in_out_specs[] =
     "data/test-abicompat/libtest4-soname-changed-v0.so",
     "data/test-abicompat/libtest4-soname-changed-v1.so",
     "",
-    "--show-base-names",
+    "--show-base-names --no-redundant",
     "data/test-abicompat/test4-soname-changed-report-0.txt",
     "output/test-abicompat/test4-soname-changed-report-0.txt",
   },
index 4303c3aed39e9d00556cf5a78a80027c035ebd2a..46d3a3ffb599bcce7be61a6632bbdd3bd32174d4 100644 (file)
@@ -57,112 +57,112 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/test0-v0.o",
     "data/test-diff-filter/test0-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test0-report.txt",
     "output/test-diff-filter/test0-report.txt",
   },
   {
     "data/test-diff-filter/test0-v0.o",
     "data/test-diff-filter/test0-v1.o",
-    "--harmless --no-linkage-name",
+    "--harmless --no-linkage-name --no-redundant",
     "data/test-diff-filter/test01-report.txt",
     "output/test-diff-filter/test01-report.txt",
   },
   {
     "data/test-diff-filter/test1-v0.o",
     "data/test-diff-filter/test1-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test1-report.txt",
     "output/test-diff-filter/test1-report.txt",
   },
   {
     "data/test-diff-filter/test2-v0.o",
     "data/test-diff-filter/test2-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test2-report.txt",
     "output/test-diff-filter/test2-report.txt",
   },
   {
     "data/test-diff-filter/test3-v0.o",
     "data/test-diff-filter/test3-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test3-report.txt",
     "output/test-diff-filter/test3-report.txt",
   },
   {
     "data/test-diff-filter/test4-v0.o",
     "data/test-diff-filter/test4-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test4-report.txt",
     "output/test-diff-filter/test4-report.txt",
   },
   {
     "data/test-diff-filter/test5-v0.o",
     "data/test-diff-filter/test5-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test5-report.txt",
     "output/test-diff-filter/test5-report.txt",
   },
   {
     "data/test-diff-filter/test6-v0.o",
     "data/test-diff-filter/test6-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test6-report.txt",
     "output/test-diff-filter/test6-report.txt",
   },
   {
     "data/test-diff-filter/test7-v0.o",
     "data/test-diff-filter/test7-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test7-report.txt",
     "output/test-diff-filter/test7-report.txt",
   },
   {
     "data/test-diff-filter/test8-v0.o",
     "data/test-diff-filter/test8-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test8-report.txt",
     "output/test-diff-filter/test8-report.txt",
   },
   {
     "data/test-diff-filter/test9-v0.o",
     "data/test-diff-filter/test9-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test9-report.txt",
     "output/test-diff-filter/test9-report.txt",
   },
   {
     "data/test-diff-filter/test10-v0.o",
     "data/test-diff-filter/test10-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test10-report.txt",
     "output/test-diff-filter/test10-report.txt",
   },
   {
     "data/test-diff-filter/test11-v0.o",
     "data/test-diff-filter/test11-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test11-report.txt",
     "output/test-diff-filter/test11-report.txt",
   },
   {
     "data/test-diff-filter/test12-v0.o",
     "data/test-diff-filter/test12-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test12-report.txt",
     "output/test-diff-filter/test12-report.txt",
   },
   {
     "data/test-diff-filter/test13-v0.o",
     "data/test-diff-filter/test13-v1.o",
-    "--no-linkage-name",
+    "--no-linkage-name --no-redundant",
     "data/test-diff-filter/test13-report.txt",
     "output/test-diff-filter/test13-report.txt",
   },
   {
     "data/test-diff-filter/test14-v0.o",
     "data/test-diff-filter/test14-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test14-0-report.txt",
     "output/test-diff-filter/test14-0-report.txt",
   },
@@ -176,7 +176,7 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/test15-v0.o",
     "data/test-diff-filter/test15-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test15-0-report.txt",
     "output/test-diff-filter/test15-0-report.txt",
   },
@@ -190,14 +190,14 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/test16-v0.o",
     "data/test-diff-filter/test16-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test16-report.txt",
     "output/test-diff-filter/test16-report.txt",
   },
   {
     "data/test-diff-filter/test17-v0.o",
     "data/test-diff-filter/test17-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test17-0-report.txt",
     "output/test-diff-filter/test17-0-report.txt",
   },
@@ -211,14 +211,14 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/test18-v0.o",
     "data/test-diff-filter/test18-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test18-report.txt",
     "output/test-diff-filter/test18-report.txt",
   },
   {
     "data/test-diff-filter/test19-enum-v0.o",
     "data/test-diff-filter/test19-enum-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test19-enum-report-0.txt",
     "output/test-diff-filter/test19-enum-report-0.txt",
   },
@@ -232,7 +232,7 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/test20-inline-v0.o",
     "data/test-diff-filter/test20-inline-v1.o",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test20-inline-report-0.txt",
     "output/test-diff-filter/test20-inline-report-0.txt",
   },
@@ -253,7 +253,7 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/libtest21-compatible-vars-v0.so",
     "data/test-diff-filter/libtest21-compatible-vars-v1.so",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test21-compatible-vars-report-1.txt",
     "output/test-diff-filter/test21-compatible-vars-report-1.txt",
   },
@@ -267,10 +267,17 @@ InOutSpec in_out_specs[] =
   {
     "data/test-diff-filter/libtest22-compatible-fns-v0.so",
     "data/test-diff-filter/libtest22-compatible-fns-v1.so",
-    "",
+    "--no-redundant",
     "data/test-diff-filter/test22-compatible-fns-report-1.txt",
     "output/test-diff-filter/test22-compatible-fns-report-1.txt",
   },
+  {
+    "data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so",
+    "data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so",
+    "",
+    "data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt ",
+    "output/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt ",
+  },
   // This should be the last entry
   {NULL, NULL, NULL, NULL, NULL}
 };
index 38fed707806aac0ac31811a0a73c6acf2aa528ce..36f76f6863b17c1e948ecb886ec95ad91da04c9d 100644 (file)
@@ -59,7 +59,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test0-type-suppr-v0.o",
     "data/test-diff-suppr/test0-type-suppr-v1.o",
     NULL,
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test0-type-suppr-report-0.txt",
     "output/test-diff-suppr/test0-type-suppr-report-0.txt",
   },
@@ -67,7 +67,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test0-type-suppr-v0.o",
     "data/test-diff-suppr/test0-type-suppr-v1.o",
     "data/test-diff-suppr/test0-type-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test0-type-suppr-report-1.txt",
     "output/test-diff-suppr/test0-type-suppr-report-1.txt",
   },
@@ -75,7 +75,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test0-type-suppr-v0.o",
     "data/test-diff-suppr/test0-type-suppr-v1.o",
     "data/test-diff-suppr/test0-type-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test0-type-suppr-report-2.txt",
     "output/test-diff-suppr/test0-type-suppr-report-2.txt",
   },
@@ -83,7 +83,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test0-type-suppr-v0.o",
     "data/test-diff-suppr/test0-type-suppr-v1.o",
     "data/test-diff-suppr/test0-type-suppr-2.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test0-type-suppr-report-3.txt",
     "output/test-diff-suppr/test0-type-suppr-report-3.txt",
   },
@@ -91,7 +91,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test1-typedef-suppr-v0.o",
     "data/test-diff-suppr/test1-typedef-suppr-v1.o",
     "",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test1-typedef-suppr-report-0.txt",
     "output/test-diff-suppr/test1-typedef-suppr-report-0.txt",
   },
@@ -99,7 +99,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test1-typedef-suppr-v0.o",
     "data/test-diff-suppr/test1-typedef-suppr-v1.o",
     "data/test-diff-suppr/test1-typedef-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test1-typedef-suppr-report-1.txt",
     "output/test-diff-suppr/test1-typedef-suppr-report-1.txt",
   },
@@ -107,7 +107,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test1-typedef-suppr-v0.o",
     "data/test-diff-suppr/test1-typedef-suppr-v1.o",
     "data/test-diff-suppr/test1-typedef-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test1-typedef-suppr-report-2.txt",
     "output/test-diff-suppr/test1-typedef-suppr-report-2.txt",
   },
@@ -115,7 +115,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test2-struct-suppr-v0.o",
     "data/test-diff-suppr/test2-struct-suppr-v1.o",
     "data/test-diff-suppr/test2-struct-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test2-struct-suppr-report-0.txt",
     "output/test-diff-suppr/test2-struct-suppr-report-0.txt",
   },
@@ -123,7 +123,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test2-struct-suppr-v0.o",
     "data/test-diff-suppr/test2-struct-suppr-v1.o",
     "data/test-diff-suppr/test2-struct-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test2-struct-suppr-report-1.txt",
     "output/test-diff-suppr/test2-struct-suppr-report-1.txt",
   },
@@ -131,7 +131,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test3-struct-suppr-v0.o",
     "data/test-diff-suppr/test3-struct-suppr-v1.o",
     NULL,
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test3-struct-suppr-report-0.txt",
     "output/test-diff-suppr/test3-struct-suppr-report-0.txt",
   },
@@ -139,7 +139,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test3-struct-suppr-v0.o",
     "data/test-diff-suppr/test3-struct-suppr-v1.o",
     "data/test-diff-suppr/test3-struct-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test3-struct-suppr-report-1.txt",
     "output/test-diff-suppr/test3-struct-suppr-report-1.txt",
   },
@@ -147,7 +147,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/test3-struct-suppr-v0.o",
     "data/test-diff-suppr/test3-struct-suppr-v1.o",
     "data/test-diff-suppr/test3-struct-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test3-struct-suppr-report-2.txt",
     "output/test-diff-suppr/test3-struct-suppr-report-2.txt",
   },
@@ -155,7 +155,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest4-local-suppr-v0.so",
     "data/test-diff-suppr/libtest4-local-suppr-v1.so",
     "data/test-diff-suppr/test4-local-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test4-local-suppr-report-1.txt",
     "output/test-diff-suppr/test4-local-suppr-report-1.txt",
   },
@@ -171,7 +171,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-0.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-0.txt",
   },
@@ -179,7 +179,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "data/test-diff-suppr/test5-fn-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-1.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-1.txt",
   },
@@ -187,7 +187,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "data/test-diff-suppr/test5-fn-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-2.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-2.txt",
   },
@@ -195,7 +195,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "data/test-diff-suppr/test5-fn-suppr-2.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-3.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-3.txt",
   },
@@ -203,7 +203,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "data/test-diff-suppr/test5-fn-suppr-3.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-4.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-4.txt",
   },
@@ -211,7 +211,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest5-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest5-fn-suppr-v1.so",
     "data/test-diff-suppr/test5-fn-suppr-4.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test5-fn-suppr-report-5.txt",
     "output/test-diff-suppr/test5-fn-suppr-report-5.txt",
   },
@@ -219,7 +219,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest6-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest6-fn-suppr-v1.so",
     "",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test6-fn-suppr-report-0.txt",
     "output/test-diff-suppr/test6-fn-suppr-report-0.txt",
   },
@@ -227,7 +227,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest6-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest6-fn-suppr-v1.so",
     "data/test-diff-suppr/test6-fn-suppr-0.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test6-fn-suppr-report-1.txt",
     "output/test-diff-suppr/test6-fn-suppr-report-1.txt",
   },
@@ -235,7 +235,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest6-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest6-fn-suppr-v1.so",
     "data/test-diff-suppr/test6-fn-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test6-fn-suppr-report-2.txt",
     "output/test-diff-suppr/test6-fn-suppr-report-2.txt",
   },
@@ -243,7 +243,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest6-fn-suppr-v0.so",
     "data/test-diff-suppr/libtest6-fn-suppr-v1.so",
     "data/test-diff-suppr/test6-fn-suppr-2.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test6-fn-suppr-report-3.txt",
     "output/test-diff-suppr/test6-fn-suppr-report-3.txt",
   },
@@ -251,7 +251,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-0.txt",
     "output/test-diff-suppr/test7-var-suppr-report-0.txt"
   },
@@ -259,7 +259,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-1.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-1.txt",
     "output/test-diff-suppr/test7-var-suppr-report-1.txt"
   },
@@ -267,7 +267,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-2.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-2.txt",
     "output/test-diff-suppr/test7-var-suppr-report-2.txt"
   },
@@ -275,7 +275,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-3.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-3.txt",
     "output/test-diff-suppr/test7-var-suppr-report-3.txt"
   },
@@ -283,7 +283,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-4.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-4.txt",
     "output/test-diff-suppr/test7-var-suppr-report-4.txt"
   },
@@ -291,7 +291,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-5.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-5.txt",
     "output/test-diff-suppr/test7-var-suppr-report-5.txt"
   },
@@ -299,7 +299,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-6.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-6.txt",
     "output/test-diff-suppr/test7-var-suppr-report-6.txt"
   },
@@ -307,7 +307,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-7.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-7.txt",
     "output/test-diff-suppr/test7-var-suppr-report-7.txt"
   },
@@ -315,7 +315,7 @@ InOutSpec in_out_specs[] =
     "data/test-diff-suppr/libtest7-var-suppr-v0.so",
     "data/test-diff-suppr/libtest7-var-suppr-v1.so",
     "data/test-diff-suppr/test7-var-suppr-8.suppr",
-    "",
+    "--no-redundant",
     "data/test-diff-suppr/test7-var-suppr-report-8.txt",
     "output/test-diff-suppr/test7-var-suppr-report-8.txt"
   },
index 5c18724d22a8d1d9d6d6a4b17a29c00252092624..897bfa5a6f37dac3db66713eec30ee0048b0bc44 100644 (file)
@@ -62,11 +62,13 @@ struct options
   bool                 display_help;
   bool                 list_undefined_symbols_only;
   bool                 show_base_names;
+  bool                 show_redundant;
 
   options()
     :display_help(),
      list_undefined_symbols_only(),
-     show_base_names()
+     show_base_names(),
+     show_redundant(true)
   {}
 }; // end struct options
 
@@ -89,6 +91,8 @@ display_usage(const string& prog_name, ostream& out)
       << "  --lib-debug-info-dir2 <path-to-lib-debug-info2>  set the path "
          "to the debug information directory for the second library\n"
       <<  "--suppressions <path> specify a suppression file\n"
+      << "--no-redundant  do not display redundant changes\n"
+      << "--redundant  display redundant changes (this is the default)\n"
     ;
 }
 
@@ -158,6 +162,10 @@ parse_command_line(int argc, char* argv[], options& opts)
          opts.suppression_paths.push_back(argv[j]);
          ++i;
        }
+      else if (!strcmp(argv[i], "--redundant"))
+       opts.show_redundant = true;
+      else if (!strcmp(argv[i], "--no-redundant"))
+       opts.show_redundant = false;
       else if (!strcmp(argv[i], "--help")
               || !strcmp(argv[i], "-h"))
        {
@@ -353,6 +361,7 @@ main(int argc, char* argv[])
   ctxt->show_added_vars(false);
   ctxt->show_added_symbols_unreferenced_by_debug_info(false);
   ctxt->show_linkage_names(true);
+  ctxt->show_redundant_changes(opts.show_redundant);
   ctxt->switch_categories_off
     (abigail::comparison::ACCESS_CHANGE_CATEGORY
      | abigail::comparison::COMPATIBLE_TYPE_CHANGE_CATEGORY
index 380a9c473536f9b001df6244ca816f257514a057..f45eaa2f366b23c68e2ccde527336cebd44b274c 100644 (file)
@@ -95,7 +95,7 @@ struct options
       show_linkage_names(true),
       show_harmful_changes(true),
       show_harmless_changes(false),
-      show_redundant_changes(false),
+      show_redundant_changes(true),
       show_symbols_not_referenced_by_debug_info(true)
   {}
 };//end struct options;
@@ -129,7 +129,8 @@ display_usage(const string& prog_name, ostream& out)
       << " --keep-var  <regex>  keep only variables matching a regex\n"
       << " --harmless  display the harmless changes\n"
       << " --no-harmful  do not display the harmful changes\n"
-      << " --redundant  display redundant changes\n"
+      << " --redundant  display redundant changes (this is the default)\n"
+      << " --no-redundant  do not display redundant changes\n"
       << " --help  display this message\n";
 }
 
@@ -313,6 +314,8 @@ parse_command_line(int argc, char* argv[], options& opts)
        opts.show_harmful_changes = false;
       else if (!strcmp(argv[i], "--redundant"))
        opts.show_redundant_changes = true;
+      else if (!strcmp(argv[i], "--no-redundant"))
+       opts.show_redundant_changes = false;
       else
        return false;
     }
This page took 0.081445 seconds and 5 git commands to generate.