Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
//
|
2015-01-07 12:53:58 +00:00
|
|
|
// Copyright (C) 2013-2015 Red Hat, Inc.
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
//
|
|
|
|
// This file is part of the GNU Application Binary Interface Generic
|
|
|
|
// Analysis and Instrumentation Library (libabigail). This library is
|
|
|
|
// free software; you can redistribute it and/or modify it under the
|
|
|
|
// terms of the GNU Lesser General Public License as published by the
|
|
|
|
// Free Software Foundation; either version 3, or (at your option) any
|
|
|
|
// later version.
|
|
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Lesser Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this program; see the file COPYING-LGPLV3. If
|
|
|
|
// not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
// Author: Dodji Seketeli
|
|
|
|
|
|
|
|
/// @file
|
|
|
|
///
|
|
|
|
/// This test harness program runs a diff between input ELF files
|
|
|
|
/// containing DWARF debugging information, exercising the
|
|
|
|
/// suppressions features of the "bidiff" command line program.
|
|
|
|
///
|
|
|
|
/// So it runs the diff diff between the two input files, using a
|
|
|
|
/// suppression file and compares the resulting diff with a reference
|
|
|
|
/// one.
|
|
|
|
|
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <cstdlib>
|
|
|
|
#include "abg-tools-utils.h"
|
|
|
|
#include "test-utils.h"
|
|
|
|
|
|
|
|
using std::string;
|
|
|
|
using std::cerr;
|
|
|
|
|
|
|
|
/// This is an aggregate that specifies where a test shall get its
|
|
|
|
/// input from and where it shall write its ouput to.
|
|
|
|
struct InOutSpec
|
|
|
|
{
|
|
|
|
const char* in_elfv0_path;
|
|
|
|
const char* in_elfv1_path;
|
|
|
|
const char* in_suppr_path;
|
|
|
|
const char* bidiff_options;
|
|
|
|
const char* in_report_path;
|
|
|
|
const char* out_report_path;
|
|
|
|
}; // end struct InOutSpec;
|
|
|
|
|
|
|
|
InOutSpec in_out_specs[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/test0-type-suppr-v0.o",
|
|
|
|
"data/test-diff-suppr/test0-type-suppr-v1.o",
|
|
|
|
NULL,
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test0-type-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test0-type-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test0-type-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test0-type-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test0-type-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test0-type-suppr-report-2.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test0-type-suppr-report-3.txt",
|
|
|
|
"output/test-diff-suppr/test0-type-suppr-report-3.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/test1-typedef-suppr-v0.o",
|
|
|
|
"data/test-diff-suppr/test1-typedef-suppr-v1.o",
|
|
|
|
"",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test1-typedef-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test1-typedef-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test1-typedef-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test1-typedef-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test1-typedef-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test1-typedef-suppr-report-2.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test2-struct-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test2-struct-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test2-struct-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test2-struct-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/test3-struct-suppr-v0.o",
|
|
|
|
"data/test-diff-suppr/test3-struct-suppr-v1.o",
|
|
|
|
NULL,
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test3-struct-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test3-struct-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test3-struct-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test3-struct-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
"data/test-diff-suppr/test3-struct-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test3-struct-suppr-report-2.txt",
|
|
|
|
},
|
Properly propagate {REDUNDANT, SUPPRESSED}_CATEGORY wrt local changes
* src/abg-comparison.cc
(suppression_categorization_visitor::visit_end): If a diff node
carries local changes, then, even if all of its children node have
been suppressed, this diff node shall not be categorized as
suppressed by way of propagation.
(redundancy_marking_visitor::visit_end): If a diff node carries
local changes, then, even if all of its children nodes are
redundant, this diff node shall not be categorized as being
redundant by way of propagation.
* tests/data/test-diff-suppr/libtest4-local-suppr-v{0,1}.so: New test
inputs.
* tests/data/test-diff-suppr/test4-local-suppr-0.suppr: Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-report-{0,1}.txt:
Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-v{0,1}.{c,h}:
Source code of the new tests inputs.
* tests/Makefile.am: Add the new test material to the source
distribution.
* tests/test-diff-suppr.cc (in_out_spec): Run this test harness
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-13 14:27:28 +00:00
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Properly propagate {REDUNDANT, SUPPRESSED}_CATEGORY wrt local changes
* src/abg-comparison.cc
(suppression_categorization_visitor::visit_end): If a diff node
carries local changes, then, even if all of its children node have
been suppressed, this diff node shall not be categorized as
suppressed by way of propagation.
(redundancy_marking_visitor::visit_end): If a diff node carries
local changes, then, even if all of its children nodes are
redundant, this diff node shall not be categorized as being
redundant by way of propagation.
* tests/data/test-diff-suppr/libtest4-local-suppr-v{0,1}.so: New test
inputs.
* tests/data/test-diff-suppr/test4-local-suppr-0.suppr: Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-report-{0,1}.txt:
Likewise.
* tests/data/test-diff-suppr/test4-local-suppr-v{0,1}.{c,h}:
Source code of the new tests inputs.
* tests/Makefile.am: Add the new test material to the source
distribution.
* tests/test-diff-suppr.cc (in_out_spec): Run this test harness
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-13 14:27:28 +00:00
|
|
|
"data/test-diff-suppr/test4-local-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test4-local-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test4-local-suppr-report-0.txt",
|
|
|
|
},
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest5-fn-suppr-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest5-fn-suppr-v1.so",
|
|
|
|
"",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-2.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-3.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-3.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-4.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-4.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test5-fn-suppr-report-5.txt",
|
|
|
|
"output/test-diff-suppr/test5-fn-suppr-report-5.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest6-fn-suppr-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest6-fn-suppr-v1.so",
|
|
|
|
"",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test6-fn-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test6-fn-suppr-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test6-fn-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test6-fn-suppr-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test6-fn-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test6-fn-suppr-report-2.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for function suppressions
* include/abg-comparison.h (enum visiting_kind): Change the
meaning of this. It was to determine if traversal was to be done
in a pre or post manner. But with the recent addition of
diff_node_visitor::visit_{begin,end}() notifiers, the pre/post
handling is taken care of in a different way. So now the meaning
of this enum is changed to handle whether diff node children
should be visited or not. So the enumerators are now
DEFAULT_VISITING_KIND, and SKIP_CHILDREN_VISITING_KIND. And it's
a bit-field.
(operator{&,~}): Declare more bit manipulation operators for the
enum visiting_kind.
(function_suppression_sptr, function_suppressions_type): New
typedefs.
(function_suppression, function_suppression::parameter_spec):
Declare new types.
(read_function_suppressions): Declare new function.
(diff_node_visitor::diff_node_visitor): Adjust for the enum
visiting_kind change. Value-initialize the visiting_kind_ data
member.
* src/abg-comparison.cc (operator{&,~}): Define these operators
for enum visiting_kind.
(read_type_suppressions): Forward declare this static function.
(read_function_suppression, read_parameter_spec_from_string):
Define new static functions.
(read_suppressions): Update to read function suppressions too,
using the new read_function_suppression function above.
(class function_suppression::parameter_spec::priv): Define new
type.
(function_suppression::parameter_spec::*): Define the member
functions of the new function_suppression::parameter_spec type.
(class function_suppression::priv): Define new type.
(function_suppression::*): Define the member functions of the new
function_suppression type.
(diff::traverse): There is no more {PRE,POST}_VISITING_KIND
enumerator. So nuke the code that was dealing with it.
(redundancy_marking_visitor::skip_children_nodes_): New data
member flag.
(redundancy_marking_visitor::visit_begin): If the current diff
node is not be reported (is filtered out), do not bother visit its
children nodes for the purpose of marking redundant nodes. So use
the new skip_children_nodes_ flag above to know we are in that case.
(redundancy_marking_visitor::visit_end): Unset the new
skip_children_nodes_ flag above when appropriate.
* include/abg-fwd.h (is_function_decl): Declare new function.
* include/abg-ir.h
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Declare new member function.
* src/abg-ir.cc (is_function_decl): Define new function.
(function_type::get_parm_at_index_from_first_non_implicit_parm):
Define new member function.
* src/abg-comp-filter.cc (apply_filter): Adjust for the enum
visiting_kind change. No need to set it for filters anymore
* doc/suppr-doc.txt: Update examples of function suppression.
* doc/manuals/libabigail-concepts.rst: Update the manual for the
function suppression addition.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest5-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v0.so: New test input.
* tests/data/test-diff-suppr/libtest6-fn-suppr-v1.so: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-4.suppr: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-report-5.txt: New test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test5-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-1.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-2.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-3.suppr: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-1.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-2.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-3.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-report-4.txt: New test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v0.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-v1.cc: Source code for
new test input.
* tests/data/test-diff-suppr/test6-fn-suppr-version-script: New
test input.
* tests/Makefile.am: Add the new files above to source
the distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the test inputs
above to the list of tests to be run by this harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-10-28 10:32:15 +00:00
|
|
|
"data/test-diff-suppr/test6-fn-suppr-report-3.txt",
|
|
|
|
"output/test-diff-suppr/test6-fn-suppr-report-3.txt",
|
|
|
|
},
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest7-var-suppr-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest7-var-suppr-v1.so",
|
|
|
|
"",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-2.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-3.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-3.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-4.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-4.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-5.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-5.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-6.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-6.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-7.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-7.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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",
|
Temporarily disable redundant diff report elimination
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>
2014-12-10 17:24:41 +00:00
|
|
|
"--no-redundant",
|
Initial support for variable suppressions
* include/abg-comparison.h (variable_suppression_sptr)
(variable_suppressions_type): New convenience typedefs.
(class variable_suppression): Declare new type.
* src/abg-comparison.cc (is_var_diff): New predicate.
(read_variable_suppression): Define new static function.
(class variable_suppression::priv): Define type for the private
data of the variable_suppression type.
(variable_suppression::{variable_suppression,
~variable_suppression, get_name, set_name, get_name_regex_str,
set_name_regex_str, get_symbol_name, set_symbol_name,
get_symbol_name_regex_str, set_symbol_name_regex_str,
get_symbol_version, set_symbol_version,
get_symbol_version_regex_str, set_symbol_version_regex_str,
get_type_name, set_type_name, get_type_name_regex_str,
set_type_name_regex_str, suppresses_diff}): Define new member
functions for the variable_suppression type.
* tests/data/test-diff-suppr/libtest7-var-suppr-v0.so: Add new
test input.
* tests/data/test-diff-suppr/libtest7-var-suppr-v1.so: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-2.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-3.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-4.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-5.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-6.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-7.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-8.suppr: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-3.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-4.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-5.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-6.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-7.txt: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-report-8.txt:
Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-version-script: Likewise.
* tests/data/test-diff-suppr/test7-var-suppr-v0.cc: Source code
for the librairie above.
* tests/data/test-diff-suppr/test7-var-suppr-v1.cc: Source code
for the librairie above.
* tests/Makefile.am: Add the new test input data to the source
distribution.
* tests/test-diff-suppr.cc: Update to make this harness to run
over the new test input above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-11-01 10:55:14 +00:00
|
|
|
"data/test-diff-suppr/test7-var-suppr-report-8.txt",
|
|
|
|
"output/test-diff-suppr/test7-var-suppr-report-8.txt"
|
|
|
|
},
|
Un-share diff nodes in the comparison IR
Until now, the diff nodes of the comparison IR were shared. That is,
two diffs about the same subjects were represented by the same diff
node that would appear twice in the tree.
This was preventing us from spotting e.g, the first occurrence of a
diff node that would later (in the tree) turn to be redundant because
all redundant diff nodes are represented by the same diff node
pointer.
This patch now makes each diff node be different, as far of pointer
comparison is concerned. But it introduces the concept of canonical
diff node to ease the comparison between two diff nodes. Two diff
nodes that are equal have the same canonical diff node.
With this facility, it's now possible to tell the difference between
diff nodes that are (structurally) equal. It's not possible to say
things like "this is the first or second occurrence of the redundant
diff node foo'.
* include/abg-ir.h: Prefix the doc string with "///", rather than
writing it inside a /**/ comment.
* include/abg-comparison.h (function_decl_diff)
(function_decl_diff_sptr, fn_parm_diff, fn_parm_diff_sptr)
(var_diff_sptr, base_diff, class_diff, class_diff_sptr): Move
these class & typedef decls to the top of the file.
(string_changed_base_map, string_changed_parm_map)
(unsigned_changed_parm_map, changed_function_ptr)
(string_changed_function_ptr_map): Remove these typedefs.
(string_base_diff_sptr_map, string_fn_parm_diff_sptr_map)
(unsigned_fn_parm_diff_sptr_map, string_var_diff_sptr_map)
(unsigned_var_diff_sptr_map, string_function_decl_diff_sptr_map)
(string_var_diff_ptr_map): New typedefs.
(diff_context::{has_diff_for,add_diff}): Make these member
functions private.
(diff_context::{set_canonical_diff_for,
set_or_get_canonical_diff_for}): Declare new private member
functions.
(diff_context::{get_canonical_diff_for,
initialize_canonical_diff}): New public member functions.
(diff_context::maybe_apply_filters): Set the default value of the
'traverse_nodes_once' parameter to false.
(compute_diff): Make the overload for class_decl_sptr friend of
the diff_context class.
(class diff): Make the diff_context class a friend of this one.
(diff::set_canonical_diff): Declare new private member function.
(diff::get_canonical_diff): Declare new public member function.
(diff::children_nodes): Make this return a vector<diff_sptr>, rather
than a vector<diff*>.
(diff::append_child_node): Make this take a diff_sptr rather than
a diff*.
(class fn_parm_diff): Declare new type.
(compute_diff): Declare new overload for the new
function_decl::parameter_sptr.
(function_decl_diff::subtype_changed_parms): Return a
string_fn_parm_diff_sptr_map rather than a string_changed_parm.
(function_decl_diff::children_nodes): Return a vector<diff_sptr>.
(function_decl_diff::append_child_node): Take a diff_sptr.
(function_decl_diff::changed_functions): Return a
string_function_decl_diff_sptr_map.
(function_decl_diff::changed_variables): Return a
string_var_diff_sptr.
(class function_decl::parameter): Make this a pimpled class.
Also, make it inherit decl_base.
(equals): New overload for function_decl::parameter.
(struct function_decl::parameter::hash): Declare this.
(ir_node_visitor::visit): Declare new overload for
function_decl::parameter.
* src/abg-comparison.cc: Add doc-string about the internal
representation of the comparison engine and also about the concept
of canonical diff of the comparison engine.
(RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER)
(RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER2)
(RETURN_IF_BEING_REPORTED_OR_WAS_REPORTED_EARLIER3): Consider the
canonical diff when trying to know if the current node was
reported earlier.
(diff_context::priv::canonical_diffs): New data member.
(diff_context::{get_canonical_diff_for, set_canonical_diff_for,
set_or_get_canonical_diff_for, initialize_canonical_diff}): Define
new member functions.
(diff_context::{diff_has_been_traversed, mark_diff_as_traversed):
Consider canonical diff for these tests and actions.
(diff::priv::children_): Change the type of this to
vector<diff_sptr>.
(diff::canonical_diff_): New data member.
(diff::diff): Initialize the diff::canonical_diff_ data member.
(diff::begin_traversing): Mark the canonical diff node too.
(diff::is_traversing): Consider the canonical diff node in this
test.
(diff::end_traversing): Make the canonical diff node too. Also
mark the current node as having been traversed.
(diff::children_nodes): Return a vector<diff_sptr> type.
(diff::{get_canonical_diff, set_canonical_diff}): Define new
member functions.
(diff::append_child_node): Take a diff_sptr type parameter.
(diff::{reported_once, currently_reporting}): Flag the canonical
diff node too. And consider the canonical diff node when checking
the flag.
(diff::traverse): No need to mark the node as being traversed
because the diff::end_traversing() function does it now. Adjust
the code because diff::children_nodes() now returns
vector<diff_sptr>.
({distinct_diff, var_diff, pointer_diff, array_diff,
reference_diff, qualified_type_diff, enum_diff, class_diff,
base_diff, scope_diff, function_decl_diff, typedef_diff,
corpus_diff}::chain_into_hierarchy): Adjust to the new type that
diff::append_child_node() takes. Also, take into account that the
diff nodes are now un-shared.
(compute_diff_for_distinct_kinds, compute_diff_for_types)
(compute_diff): Do not share diff nodes anymore. Initialize the
canonical diff node for the new created node.
(represent): Take a var_diff_sptr rather than two var_decl_sptr.
Adjust. Also take in account the fact that diff nodes are not
shared anymore, and that they do have canonical diffs.
(var_diff::type_diff): Make the computation of the type_diff of
the var_diff be lazy. This avoids infinite (recursive) creation
of diff nodes when a class diff node has a sub-type of data member
that is a class diff node too.
(var_diff::report): Detect redundant reporting of this kind of
diff node.
(class_diff::priv::changed_bases_): Change the type of this to
string_base_diff_sptr_map.
(class_diff::priv::subtype_changed_dm_): Change the type of this
to string_var_diff_sptr_map.
(class_diff::priv::changed_dm_): Change the type of this to
unsigned_var_diff_sptr_map.
(class_diff::priv::{count_filtered_subtype_changed_dm,
count_filtered_bases}): Do not take a diff_context_sptr anymore.
(class_diff::ensure_lookup_tables_populated): changed_bases_
subtype_changed_dm_ and changed_dm_ are now *NOT* shared diff
nodes anymore.
(class_diff::priv::base_has_changed): Adjust.
(class_diff::priv::subtype_changed_dm): Adjust.
(class_diff::priv::count_filtered_bases): Adjust as changed_bases_
is now a map of un-shared diff nodes.
(class_diff::priv::count_filtered_subtype_changed_dm): Adjust as
subtype_changed_dm_ is now a map of un-shared diff nodes.
(class_diff::priv::{count_filtered_changed_mem_fns,
count_filtered_inserted_mem_fns, count_filtered_deleted_mem_fns,
}): Adjust for change of the default parameter value of
diff_context::maybe_apply_filters().
(class_diff::~class_diff): New destructor.
(class_diff::changed_bases): Return a string_base_diff_sptr_map&
type.
(class_diff::{inserted_data_members, deleted_data_members,
changed_member_fns}): Add doc strings.
(struct changed_data_member_comp): Remove.
(struct var_diff_comp): New comparison functor.
(sort_changed_data_members): Remove.
(sort_var_diffs): Define new sorting function.
(class_diff::report): Adjust.
(fn_parm_diff::*): Define member types and functions of the new
fn_parm_diff type.
(function_decl_diff::priv::{subtype_changed_parms_,
changed_parms_by_id_}): Make these take a map of fn_parm_diff_sptr
nodes.
(function_decl_diff::ensure_lookup_tables_populated): Adjust to
the fact that priv_->subtype_changed_parms_ and
priv_->priv_->changed_parms_by_id_ now are maps of un-shared
fn_parm_diff_sptr nodes.
(function_decl_diff::subtype_changed_parms): Adjust.
(struct changed_parm_comp): Remove.
(struct fn_parm_diff_comp): New comparison functor.
(sort_changed_parm_map): Remove.
(sort_string_fn_parm_diff_sptr_map): New sorting function.
(function_decl_diff::report): Adjust.
(corpus_diff::priv::children_): Change the type of this to
vector<diff_sptr>.
(corpus_diff::priv::changed_fns_): Changed the type of this to
string_function_decl_diff_sptr_map.
(corpus_diff::priv::changed_vars_): Changed the type of this to
string_var_diff_sptr_map.
(corpus_diff::priv::ensure_lookup_tables_populated): Adjust.
(corpus_diff::priv::apply_filters_and_compute_diff_stats}):
Adjust. Do not need to clear redundancy categorization anymore
because the diff nodes are not shared anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes):
Adjust.
(corpus_diff::priv::clear_redundancy_categorization): Adjust.
(corpus_diff::changed_variables): Adjust.
(struct changed_function_ptr_comp): Remove.
(struct function_decl_diff_comp): New comparison functor.
(sort_string_changed_function_ptr_map): Remove.
(sort_string_function_decl_diff_sptr_map): Define new sorting
function.
(struct changed_vars_comp): Remove.
(struct var_diff_sptr_comp): New comparison functor.
(sort_changed_vars): Remove.
(sort_string_var_diff_sptr_map): Define new sorting function.
(corpus_diff::report): Adjust.
(corpus_diff::traverse): Adjust.
({category_propagation_visitor,
suppression_categorization_visitor}::visit_end): Adjust.
(clear_redundancy_categorization): Adjust.
* src/abg-hash.cc (function_decl::parameter::hash::operator):
Adjust.
* src/abg-ir.cc (struct function_decl::parameter::priv): Define
here as part of pimpl-ifying the function_decl::parameter type.
(function_decl::parameter::*): Define here the member functions as
part of pimpl-ifying the function_decl::parameter type.
(equals): Define the overload for function_decl::parameter here
too.
(ir_node_visitor::visit(function_decl::parameter*)): Define this.
* tests/data/test-abicompat/test0-fn-changed-report-0.txt: Adjust.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust.
* tests/data/test-diff-dwarf/libtest21-redundant-fn-v0.so: New
test input data.
* tests/data/test-diff-dwarf/libtest21-redundant-fn-v1.so:
Likewise.
* tests/data/test-diff-dwarf/test21-redundant-fn-v0.cc: Source
code for test input binary above.
* tests/data/test-diff-dwarf/test21-redundant-fn-v1.cc: Likewise.
* tests/data/test-diff-dwarf/test21-redundant-fn-report-0.txt: New
test input data.
* tests/data/test-diff-dwarf/libtest22-changed-parm-c-v0.so: New
test input data.
* tests/data/test-diff-dwarf/libtest22-changed-parm-c-v1.so:
Likewise.
* tests/data/test-diff-dwarf/test22-changed-parm-c-v0.c: Source
code for test input binary above.
* tests/data/test-diff-dwarf/test22-changed-parm-c-v1.c: Likewise.
* tests/test-diff-dwarf.cc (in_out_spec): Add the new test input
data to the vector the test inputs to run this harness over.
* tests/data/test-diff-suppr/test8-redundant-fn-report-0.txt: New
test input data.
* tests/data/test-diff-suppr/test8-redundant-fn-report-1.txt:
Likewise.
* tests/data/test-diff-suppr/libtest8-redundant-fn-v0.so: New test
input binary.
* tests/data/test-diff-suppr/libtest8-redundant-fn-v1.so: Likewise.
* tests/data/test-diff-suppr/test8-redundant-fn-v0.cc: Source code
code for binary test input above.
* tests/data/test-diff-suppr/test8-redundant-fn-v1.cc: Likewise.
* tests/data/test-diff-suppr/test9-changed-parm-c-report-0.txt:
New test input data.
* tests/data/test-diff-suppr/test9-changed-parm-c-report-1.txt:
Likewise.
* tests/data/test-diff-suppr/libtest9-changed-parm-c-v0.so: New
test input binary.
* tests/data/test-diff-suppr/libtest9-changed-parm-c-v1.so: New
test input binary.
* tests/data/test-diff-suppr/test9-changed-parm-c-v0.c: Source
code for binary test input above.
* tests/data/test-diff-suppr/test9-changed-parm-c-v1.c: Likewise.
* tests/test-diff-suppr.cc (in_out_specs): Add the new test input
data to the vector the test inputs to run this harness over.
* tests/data/Makefile.am: Add the new files to the source
distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-26 12:22:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest8-redundant-fn-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest8-redundant-fn-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test8-redundant-fn-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test8-redundant-fn-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest8-redundant-fn-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest8-redundant-fn-v1.so",
|
|
|
|
"",
|
|
|
|
"--redundant",
|
|
|
|
"data/test-diff-suppr/test8-redundant-fn-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test8-redundant-fn-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest9-changed-parm-c-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest9-changed-parm-c-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test9-changed-parm-c-report-0.txt",
|
|
|
|
"output/test-diff-suppr/est9-changed-parm-c-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest9-changed-parm-c-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest9-changed-parm-c-v1.so",
|
|
|
|
"",
|
|
|
|
"--redundant",
|
|
|
|
"data/test-diff-suppr/test9-changed-parm-c-report-1.txt",
|
|
|
|
"output/test-diff-suppr/est9-changed-parm-c-report-1.txt"
|
|
|
|
},
|
2014-12-26 13:46:27 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest10-changed-parm-c-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest10-changed-parm-c-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test10-changed-parm-c-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test10-changed-parm-c-report-0.txt"
|
|
|
|
},
|
Support specifying data member insertion in suppressions
This patch is for supporting this kind of things:
[suppress_type]
name = S
has_data_member_inserted_between = {8, end}
or:
[suppress_type]
name = S
has_data_members_inserted_between = {{8, 31}, {64, end}}
or:
[suppress_type]
name = S
has_data_members_inserted_at = offset_after(member0)
How cool is that, heh?
Anyway, to do this, the patch adds support for tuple values (i.e,
lists of values) in INI files.
Then on top of that the patch adds support for the specific
has_data_member_inserted_between, has_data_members_inserted_between
and has_data_members_inserted_at properties.
* include/abg-comparison.h (type_suppression::insertion_range):
Declare new type.
(type_suppression::insertion_ranges): Declare new typedef.
(type_suppression::{s,g}et_data_member_insertion_ranges): Declare
new member functions.
(is_integer_boundary, is_fn_call_expr_boundary): Declare new
functions.
(type_suppression::insertion_range::{boundary, integer_boundary,
fn_call_expr_boundary}): Define new types.
* src/abg-comparison.cc:
(struct type_suppression::insertion_range::priv): New type.
(type_suppression::insertion_range::{insertion_range, begin,
end}): Define new member functions.
(type_suppression::priv::insertion_ranges_): Add data member.
(type_suppression::{s,g}et_data_member_insertion_ranges): Define
new member functions.
(type_suppression::insertion_range::boundary::priv): Define new
type.
(type_suppression::insertion_range::boundary::{boundary,
~boundary}): Define new member functions.
(type_suppression::insertion_range::integer_boundary::priv):
Define new type.
(type_suppression::insertion_range::integer_boundary::{integer_boundary,
as_integer, operator int, ~integer_boundary}): Define member
functions.
(type_suppression::insertion_range::fn_call_expr_boundary::priv):
Define new type.
(type_suppression::insertion_range::fn_call_expr_boundary::{fn_call_expr_boundary,
as_function_call_expr, operator ini::function_call_expr_sptr}):
Define new member functions.
(type_suppression::insertion_range::{create_integer_boundary,
type_suppression::insertion_range::create_fn_call_expr_boundary,
type_suppression::insertion_range::eval_boundary}): Define new
member functions.
(is_integer_boundary, is_fn_call_expr_boundary): Define new
functions.
(read_type_suppression, read_function_suppression)
(read_variable_suppression): Support the new kinds of
property-related types. Aslo, in read_type_suppression, support
the new properties has_data_member_inserted_at,
has_data_member_inserted_between and
has_data_members_inserted_between.
(type_suppression::suppresses_diff): If we are looking at a type
diff node that has inserted data members, evaluate the insertion
ranges of the current type_suppression and see if they match the
inserted data members.
* include/abg-ini.h (property, simple_property, property_value)
(string_property_value, tuple_property_value, function_call_expr):
Declare new types.
(property_sptr, property_value_sptr, string_property_value_sptr)
(tuple_property_value_sptr): Declare new typedefs.
(is_string_property_value, is_tuple_property_value)
(is_simple_property, is_tuple_property, read_function_call_expr):
Declare new functions.
* src/abg-ini.cc (char_is_white_space, char_is_comment_start)
(char_is_delimiter, char_is_property_value_char)
(char_is_section_name_char, char_is_property_name_char)
(char_is_comment_start, char_is_white_space)
(remove_trailing_white_spaces, is_string_property_value)
(is_tuple_property_value, is_simple_property, is_tuple_property)
(write_property_value, char_is_function_name_char)
(char_is_function_argument_char): Define new functions.
(property::priv, tuple_property_value::priv)
(simple_property::priv, tuple_property::priv): Define new types.
(property::{property, get_name, set_name, ~property}): Define new
member functions.
(struct property_value::priv): Define new type.
(property_value::{property_value, get_kind, operator const
string&(), ~property_value}): Define new member functions.
(struct string_property_value::priv): Define new type.
(string_property_value::{string_property_value, set_content,
as_string, operator string()}, ~string_property_value): Define new
member functions.
(tuple_property_value::{tuple_property_value, get_value_items,
~tuple_property_value, as_string}): Likewise.
(simple_property::{simple_property, get_value, set_value,
~simple_property}): Likewise.
(tuple_property::{tuple_property, set_value, get_value}):
Likewise.
(config::section::find_property): Adjust return type.
(read_context::{char_is_delimiter, char_is_property_value_char,
char_is_section_name_char, char_is_property_name_char,
char_is_comment_start, char_is_white_space}): Remove these from
here as they got moved them to be non-member functions above.
(read_context::read_property_value): Return a property_value_sptr
and do not take any parameter anymore.
(read_context::{read_string_property_value,
read_tuple_property_value, read_function_name,
read_function_argument, read_function_call_expr}): Define new
member functions.
(read_context::read_property): Adjust return type. Also, change to read
the different new kinds of properties values.
(function_call_expr::priv): Define new type.
(function_call_expr::{function_call_expr, get_name,
get_arguments}): New member functions.
(read_context::read_section): Adjust.
(write_property, write_section): Adjust.
* tests/data/test-diff-suppr/libtest{11,12}-add-data-member-v{0,1}.so:
New test input binaries.
* tests/data/test-diff-suppr/test{11,12}-add-data-member-{0,1}.suppr:
New input suppression files.
* tests/data/test-diff-suppr/test11-add-data-member-{2,3,4}.suppr:
Add new test input files.
* tests/data/test-diff-suppr/test{11,12}-add-data-member-report-{0,1}.txt:
New reference output files.
* tests/data/test-diff-suppr/test12-add-data-member-report-2.txt:
Likewise.
* tests/data/test-diff-suppr/test{11,12}-add-data-member-v{0,1}.cc:
Source code for the new binaries above.
* tests/test-diff-suppr.cc (in_out_specs): Add new test inputs.
* tests/data/Makefile.am: Add the new test related files above to
source distribution.
* doc/manuals/libabigail-concepts.rst: Document the new properties
has_data_member_inserted_at, has_data_member_inserted_between and
has_data_members_inserted_between.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-04-22 18:40:57 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-0.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-1.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-2.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-3.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest11-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-4.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test11-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test11-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test12-add-data-member-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test12-add-data-member-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test12-add-data-member-0.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test12-add-data-member-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test12-add-data-member-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest12-add-data-member-v1.so",
|
|
|
|
"data/test-diff-suppr/test12-add-data-member-1.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test12-add-data-member-report-2.txt",
|
|
|
|
"output/test-diff-suppr/test12-add-data-member-report-2.txt"
|
|
|
|
},
|
Support new 'accessed_through' suppression property
It turned out it's important to be able to suppress changes about
types that are reachable from a function parameter only through e.g, a
pointer or a reference, so that only changes types that are reachable
directly from a function parameter are emitted.
This patch adds that feature.
While doing this, I noticed this: Suppose a diff node D2 is marked as
being redundant with a diff node D1 seen previously. So only D1 is
reported; D2 is not, because it's been filtered out, because it's
redundant with D1. But then suppose D1 is filtered out, due to a
suppression specification. At that point, D2 should not be marked
redundant anymore, and should be reported.
Of course, the code before this patch was wrongly filtering D2 *and*
D1 out. So this patch fixes that.
* include/abg-comparison.h (enum type_suppression::reach_kind):
Define new enum.
(type_suppression::{get_consider_reach_kind,
set_consider_reach_kind, get_reach_kind,
mark_last_diff_visited_per_class_of_equivalence,
clear_last_diffs_visited_per_class_of_equivalence,
get_last_visited_diff_of_class_of_equivalence}): Declare new
member functions.
* src/abg-comparison.cc (diff_has_ancestor_filtered_out)
(read_suppression_reach_kind): Define static function.
(type_suppression::priv::{consider_reach_kind_, reach_kind_}):
Define new data members.
(type_suppression::priv::priv): Take a new reach_kind parameter.
(type_suppression::type_suppression): Adjust to new prototype of
priv constructor.
(type_suppression::{get_consider_reach_kind,
set_consider_reach_kind, get_reach_kind, set_reach_kind}): Define
new member functions.
(type_suppression::suppresses_diff): Interpret the result of
type_suppression::get_reach_kind() to determine if the suppression
specification suppresses a given diff node.
(read_type_suppression): Support reading the content of the
"accessed_through" property.
(diff_context::priv::last_visited_diff_node_): New data member.
(diff_context::{mark_last_diff_visited_per_class_of_equivalence,
clear_last_diffs_visited_per_class_of_equivalence,
get_last_visited_diff_of_class_of_equivalence}): Define new data
members.
(redundancy_marking_visitor::visit_begin): So if the current diff
node has already been visited, but if the previously visited node
has been filtered out, then do not mark this node as being
redundant. And mark the current diff node as being the last
visited one in its class of equivalence.
(categorize_redundancy): Clear the map of diff nodes visited per
class of equivalence.
* doc/manuals/libabigail-concepts.rst: Document the new
'accessed_through' property.
* tests/data/test-diff-suppr/test13-suppr-through-pointer-0.suppr:
New test input data.
* tests/data/test-diff-suppr/test13-suppr-through-pointer-report-{0,1}.txt:
Likewise.
* tests/data/test-diff-suppr/libtest13-suppr-through-pointer-v{0,1}.so:
New test input binaries.
* tests/data/test-diff-suppr/test13-suppr-through-pointer-v{0,1}.cc:
Source code of the test input binaries above.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-0.suppr:
New test input data.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt:
Likewise.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-v{0,1}.o:
New test input binaries.
* tests/data/test-diff-suppr/test14-suppr-non-redundant-v{0,1}.cc:
Source code of the binaries above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-03 17:02:13 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest13-suppr-through-pointer-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest13-suppr-through-pointer-v1.so",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test13-suppr-through-pointer-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test13-suppr-through-pointer-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/libtest13-suppr-through-pointer-v0.so",
|
|
|
|
"data/test-diff-suppr/libtest13-suppr-through-pointer-v1.so",
|
|
|
|
"data/test-diff-suppr/test13-suppr-through-pointer-0.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test13-suppr-through-pointer-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test13-suppr-through-pointer-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-v0.o",
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-v1.o",
|
|
|
|
"",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-report-0.txt",
|
|
|
|
"output/test-diff-suppr/test14-suppr-non-redundant-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-v0.o",
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-v1.o",
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-0.suppr",
|
|
|
|
"--no-redundant",
|
|
|
|
"data/test-diff-suppr/test14-suppr-non-redundant-report-1.txt",
|
|
|
|
"output/test-diff-suppr/test14-suppr-non-redundant-report-1.txt"
|
|
|
|
},
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
// This should be the last entry
|
|
|
|
{NULL, NULL, NULL, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
using abigail::tests::get_src_dir;
|
|
|
|
using abigail::tests::get_build_dir;
|
2015-01-08 10:34:03 +00:00
|
|
|
using abigail::tools_utils::ensure_parent_dir_created;
|
Make abidiff and abicompat return meaningful exit codes
As per https://sourceware.org/bugzilla/show_bug.cgi?id=18146, abidiff
the exit code of abidiff and abicompat is now a bit field that can be
inspected to know if the ABI change reported is incompatible for sure,
or if it needs user review of the output to decide.
This patch also updates the documentation.
* doc/manuals/abicompat.rst: Update documentation for abicompat
exit codes.
* doc/manuals/abidiff.rst: Likewise for abidiff exit codes.
* include/abg-tools-utils.h (enum abidiff_status): Declare new
enum.
(operator{|,&,|=}): Declare new operators for the new enum
abidiff_status.
(abidiff_status_has_error, abidiff_status_has_abi_change)
(abidiff_status_has_incompatible_abi_change): Declare new
functions.
* src/abg-tools-utils.cc (operator{|,&,|=}): Define these new
operators.
(abidiff_status_has_error, abidiff_status_has_abi_change)
(abidiff_status_has_incompatible_abi_change): Define new
functions.
* tests/test-diff-filter.cc (main): Adjust for the new exit code
of abidiff.
* tests/test-diff-suppr.cc (main): Likewise.
* tests/test-abicompat.cc (main): Likewise.
* tools/abicompat.cc (enum abicompat_status): Remove.
(operator{|,&,|=}): Remove these operators for enum
abicompat_status.
(perform_compat_check_in_normal_mode)
(perform_compat_check_in_weak_mode): Return abidiff_status instead
of abicompat_status. Adjust therefore.
(main): Adjust to return abidiff_status now, instead of a just
zero for all non-error cases.
* tools/abidiff.cc (main): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-04-10 13:42:35 +00:00
|
|
|
using abigail::tools_utils::abidiff_status;
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
|
|
|
|
bool is_ok = true;
|
|
|
|
string in_elfv0_path, in_elfv1_path,
|
|
|
|
in_suppression_path, bidiff_options, bidiff, cmd,
|
|
|
|
ref_diff_report_path, out_diff_report_path;
|
|
|
|
|
|
|
|
for (InOutSpec* s = in_out_specs; s->in_elfv0_path; ++s)
|
|
|
|
{
|
|
|
|
in_elfv0_path = get_src_dir() + "/tests/" + s->in_elfv0_path;
|
|
|
|
in_elfv1_path = get_src_dir() + "/tests/" + s->in_elfv1_path;
|
|
|
|
if (s->in_suppr_path && strcmp(s->in_suppr_path, ""))
|
|
|
|
in_suppression_path = get_src_dir() + "/tests/" + s->in_suppr_path;
|
|
|
|
else
|
|
|
|
in_suppression_path.clear();
|
|
|
|
|
|
|
|
bidiff_options = s->bidiff_options;
|
|
|
|
ref_diff_report_path = get_src_dir() + "/tests/" + s->in_report_path;
|
|
|
|
out_diff_report_path = get_build_dir() + "/tests/" + s->out_report_path;
|
|
|
|
|
|
|
|
if (!ensure_parent_dir_created(out_diff_report_path))
|
|
|
|
{
|
|
|
|
cerr << "could not create parent directory for "
|
|
|
|
<< out_diff_report_path;
|
|
|
|
is_ok = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
bidiff = get_build_dir() + "/tools/abidiff";
|
|
|
|
bidiff += " " + bidiff_options;
|
|
|
|
|
|
|
|
if (!in_suppression_path.empty())
|
|
|
|
bidiff += " --suppressions " + in_suppression_path;
|
|
|
|
|
|
|
|
cmd = bidiff + " " + in_elfv0_path + " " + in_elfv1_path;
|
|
|
|
cmd += " > " + out_diff_report_path;
|
|
|
|
|
|
|
|
bool bidiff_ok = true;
|
Make abidiff and abicompat return meaningful exit codes
As per https://sourceware.org/bugzilla/show_bug.cgi?id=18146, abidiff
the exit code of abidiff and abicompat is now a bit field that can be
inspected to know if the ABI change reported is incompatible for sure,
or if it needs user review of the output to decide.
This patch also updates the documentation.
* doc/manuals/abicompat.rst: Update documentation for abicompat
exit codes.
* doc/manuals/abidiff.rst: Likewise for abidiff exit codes.
* include/abg-tools-utils.h (enum abidiff_status): Declare new
enum.
(operator{|,&,|=}): Declare new operators for the new enum
abidiff_status.
(abidiff_status_has_error, abidiff_status_has_abi_change)
(abidiff_status_has_incompatible_abi_change): Declare new
functions.
* src/abg-tools-utils.cc (operator{|,&,|=}): Define these new
operators.
(abidiff_status_has_error, abidiff_status_has_abi_change)
(abidiff_status_has_incompatible_abi_change): Define new
functions.
* tests/test-diff-filter.cc (main): Adjust for the new exit code
of abidiff.
* tests/test-diff-suppr.cc (main): Likewise.
* tests/test-abicompat.cc (main): Likewise.
* tools/abicompat.cc (enum abicompat_status): Remove.
(operator{|,&,|=}): Remove these operators for enum
abicompat_status.
(perform_compat_check_in_normal_mode)
(perform_compat_check_in_weak_mode): Return abidiff_status instead
of abicompat_status. Adjust therefore.
(main): Adjust to return abidiff_status now, instead of a just
zero for all non-error cases.
* tools/abidiff.cc (main): Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-04-10 13:42:35 +00:00
|
|
|
abigail::tools_utils::abidiff_status status =
|
|
|
|
static_cast<abidiff_status>(system(cmd.c_str()) & 255);
|
|
|
|
if (abigail::tools_utils::abidiff_status_has_error(status))
|
Initial support for type suppressions
* include/abg-comparison.h (diff_category::SUPPRESSED_CATEGORY):
New enumerator.
(diff_category::{SIZE_OR_OFFSET_CHANGE_CATEGORY,
VIRTUAL_MEMBER_CHANGE_CATEGORY): Update the enumerator values for
these.
(diff::EVERYTHING_CATEGORY): Adjust.
(suppression_base, type_suppression): Declare new types.
(suppression_ptr, suppressions_type, type_suppression_sptr)
(type_suppressions_type): New typedefs.
(read_type_suppressions, read_suppressions): Declare new
functions.
(diff_context::{suppressions, add_suppression, add_suppressions}):
Declare new methods.
(diff::is_suppressed): Declare new member function.
(apply_suppressions): Declare new function & overloads.
* src/abg-comparison.cc (is_type_diff): Define new static
function.
({suppression_base, type_suppression}::priv): Define new types.
({suppression_base, type_suppression}::*): Define the methods of the new
suppression_base, type_suppressions types.
(read_type_suppression, read_type_suppressions, read_suppressions)
(read_type_suppressions): Define new static functions.
(diff_context::priv::supprssions_): New data member.
(diff_context::{suppressions, add_suppression, add_suppressions}):
New methods.
(diff::is_filtered_out): Consider that a diff node that is in the
SUPPRESSED_CATEGORY is filtered out.
(diff::is_suppressed): Define new member function.
(operator<<(ostream& o, diff_category c)): Support the
SUPPRESSED_CATEGORY category.
(corpus_diff::report): Apply suppressions before reporting
anything.
(category_propagation_visitor::visit_end): Do not propagate
SUPPRESSED_CATEGORY. This is just like what we do for
REDUNDANT_CATEGORY.
(struct suppression_categorization_visitor): New visitor.
(apply_suppressions): Define function & overloads.
* include/abg-ini.h (config::section::find_property): New method.
(config::section): Fix end of class comment.
* src/abg-ini.cc (config::section::find_property): Define new
method.
* tests/data/test-diff-suppr/test0-type-suppr-{0,1,2}.suppr: New
test input files.
* tests/data/test-diff-suppr/test0-type-suppr-report-{0,1,2,3}.txt:
Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.o: Likewise.
* tests/data/test-diff-suppr/test0-type-suppr-v{0,1}.cc: Source code
for new test input.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.o: New test
input files.
* tests/data/test-diff-suppr/test1-typedef-suppr.h: Source code
for new test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-v{0,1}.c: Likewise
* tests/data/test-diff-suppr/test1-typedef-suppr-{0,1}.suppr: New
test input files.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test1-typedef-suppr-report-2.txt: Likewise.
* tests/test-diff-suppr.cc: New test harness to run type suppression tests
using the input files above.
* tests/data/test-diff-suppr/test3-struct-suppr-0.suppr: New test input.
* tests/data/test-diff-suppr/test3-struct-suppr-1.suppr: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-0.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-1.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v0.o: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.cc: Likewise.
* tests/data/test-diff-suppr/test3-struct-suppr-v1.o: Likewise.
* tests/Makefile.am: Build the new runtestdiffsuppr test harness
from the test-diff-filter.cc file. Add the new test files to the
build system and source distribution.
* tools/bidiff.cc (options::suppressions): New data member.
(display_usage): Add a help string for the new
--suppressions command line switch.
(parse_command_line): Parse the --suppressions command line
switch.
(set_diff_context_from_opts): Read the suppressions provided by
the --suppression command line switch and stuff them into the diff
context.
2014-09-19 09:55:49 +00:00
|
|
|
bidiff_ok = false;
|
|
|
|
|
|
|
|
if (bidiff_ok)
|
|
|
|
{
|
|
|
|
cmd = "diff -u " + ref_diff_report_path
|
|
|
|
+ " " + out_diff_report_path;
|
|
|
|
if (system(cmd.c_str()))
|
|
|
|
is_ok = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
is_ok = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return !is_ok;
|
|
|
|
}
|