2014-03-29 05:44:13 +00:00
|
|
|
// -*- Mode: C++ -*-
|
|
|
|
//
|
2016-01-15 12:34:16 +00:00
|
|
|
// Copyright (C) 2013-2016 Red Hat, Inc.
|
2014-03-29 05:44:13 +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 program runs a diff between input ELF files containing DWARF
|
|
|
|
/// debugging information and compares the resulting report with a
|
|
|
|
/// reference report. If the resulting report is different from the
|
|
|
|
/// reference report, the test has failed. Note that the comparison
|
2014-09-26 08:58:16 +00:00
|
|
|
/// is done using the abidiff command line comparison tool.
|
2014-03-29 05:44:13 +00:00
|
|
|
///
|
|
|
|
/// The set of input files and reference reports to consider should be
|
|
|
|
/// present in the source distribution.
|
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
#include <cassert>
|
2014-03-29 05:44:13 +00:00
|
|
|
#include <string>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
#include <cstdlib>
|
2016-01-15 12:34:16 +00:00
|
|
|
#include "abg-workers.h"
|
2014-03-29 05:44:13 +00:00
|
|
|
#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;
|
2014-09-26 08:58:16 +00:00
|
|
|
const char* abidiff_options;
|
2014-03-29 05:44:13 +00:00
|
|
|
const char* in_report_path;
|
|
|
|
const char* out_report_path;
|
|
|
|
}; // end struct InOutSpec;
|
|
|
|
|
|
|
|
InOutSpec in_out_specs[] =
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test0-v0.o",
|
|
|
|
"data/test-diff-filter/test0-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-03-29 05:44:13 +00:00
|
|
|
"data/test-diff-filter/test0-report.txt",
|
|
|
|
"output/test-diff-filter/test0-report.txt",
|
|
|
|
},
|
2014-04-01 13:50:04 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test0-v0.o",
|
|
|
|
"data/test-diff-filter/test0-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--harmless --no-linkage-name --no-show-locs --no-redundant",
|
2014-04-01 13:50:04 +00:00
|
|
|
"data/test-diff-filter/test01-report.txt",
|
|
|
|
"output/test-diff-filter/test01-report.txt",
|
|
|
|
},
|
2014-03-31 11:07:04 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test1-v0.o",
|
|
|
|
"data/test-diff-filter/test1-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-03-31 11:07:04 +00:00
|
|
|
"data/test-diff-filter/test1-report.txt",
|
|
|
|
"output/test-diff-filter/test1-report.txt",
|
|
|
|
},
|
2014-04-01 13:50:04 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test2-v0.o",
|
|
|
|
"data/test-diff-filter/test2-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-01 13:50:04 +00:00
|
|
|
"data/test-diff-filter/test2-report.txt",
|
|
|
|
"output/test-diff-filter/test2-report.txt",
|
|
|
|
},
|
2014-04-02 15:23:56 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test3-v0.o",
|
|
|
|
"data/test-diff-filter/test3-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-02 15:23:56 +00:00
|
|
|
"data/test-diff-filter/test3-report.txt",
|
|
|
|
"output/test-diff-filter/test3-report.txt",
|
|
|
|
},
|
Do not hook type diff nodes to a parent
A given diff node for a type can be hung off of several contexts: a
function parameter type node, another type diff node, etc. For that
reason, a type diff node should not have a parent node. Thus, it's
should be the job of the context containing the type diff node to
propagate its categories to the context nodes. This actually fixes a bug
about category propagation.
* abg/comparison.cc (var_diff::var_diff): Do not set parent node
for the type diff of the var_diff.
(var_diff::traverse): Handle category propagation from the
type diff node to the var_diff node.
(pointer_diff::underlying_type_diff)
(reference_diff::underlying_type_diff)
(qualified_type_diff::underlying_type_diff, enum_diff::enum_diff)
(base_diff::get_underlying_class_diff)
(typedef_diff::underlying_type_diff): Do not set the parent node
here.
({pointer_diff, reference_diff, qualified_type, enum_diff,
class_diff, base_diff, function_decl_diff,
typedef_diff}::traverse): Handle category propagation here.
* tests/data/test-diff-filter/test4-v0.o: New input binary.
* tests/data/test-diff-filter/test4-v0.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test4-v1.o: New input binary.
* tests/data/test-diff-filter/test4-v1.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test4-report.txt: Reference diff
report for the input binaries above.
* tests/test-diff-filter.cc:: Run bidiff --no-harmless on the
binaries above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-04 12:44:50 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test4-v0.o",
|
|
|
|
"data/test-diff-filter/test4-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
Do not hook type diff nodes to a parent
A given diff node for a type can be hung off of several contexts: a
function parameter type node, another type diff node, etc. For that
reason, a type diff node should not have a parent node. Thus, it's
should be the job of the context containing the type diff node to
propagate its categories to the context nodes. This actually fixes a bug
about category propagation.
* abg/comparison.cc (var_diff::var_diff): Do not set parent node
for the type diff of the var_diff.
(var_diff::traverse): Handle category propagation from the
type diff node to the var_diff node.
(pointer_diff::underlying_type_diff)
(reference_diff::underlying_type_diff)
(qualified_type_diff::underlying_type_diff, enum_diff::enum_diff)
(base_diff::get_underlying_class_diff)
(typedef_diff::underlying_type_diff): Do not set the parent node
here.
({pointer_diff, reference_diff, qualified_type, enum_diff,
class_diff, base_diff, function_decl_diff,
typedef_diff}::traverse): Handle category propagation here.
* tests/data/test-diff-filter/test4-v0.o: New input binary.
* tests/data/test-diff-filter/test4-v0.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test4-v1.o: New input binary.
* tests/data/test-diff-filter/test4-v1.cc: Source code for the
input binary above.
* tests/data/test-diff-filter/test4-report.txt: Reference diff
report for the input binaries above.
* tests/test-diff-filter.cc:: Run bidiff --no-harmless on the
binaries above.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-04-04 12:44:50 +00:00
|
|
|
"data/test-diff-filter/test4-report.txt",
|
|
|
|
"output/test-diff-filter/test4-report.txt",
|
|
|
|
},
|
2014-04-05 09:59:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test5-v0.o",
|
|
|
|
"data/test-diff-filter/test5-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-05 09:59:16 +00:00
|
|
|
"data/test-diff-filter/test5-report.txt",
|
|
|
|
"output/test-diff-filter/test5-report.txt",
|
|
|
|
},
|
2014-04-06 13:59:38 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test6-v0.o",
|
|
|
|
"data/test-diff-filter/test6-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-06 13:59:38 +00:00
|
|
|
"data/test-diff-filter/test6-report.txt",
|
|
|
|
"output/test-diff-filter/test6-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test7-v0.o",
|
|
|
|
"data/test-diff-filter/test7-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-06 13:59:38 +00:00
|
|
|
"data/test-diff-filter/test7-report.txt",
|
|
|
|
"output/test-diff-filter/test7-report.txt",
|
|
|
|
},
|
2014-04-11 14:52:00 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test8-v0.o",
|
|
|
|
"data/test-diff-filter/test8-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-11 14:52:00 +00:00
|
|
|
"data/test-diff-filter/test8-report.txt",
|
|
|
|
"output/test-diff-filter/test8-report.txt",
|
|
|
|
},
|
2014-04-13 21:09:02 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test9-v0.o",
|
|
|
|
"data/test-diff-filter/test9-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-13 21:09:02 +00:00
|
|
|
"data/test-diff-filter/test9-report.txt",
|
|
|
|
"output/test-diff-filter/test9-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test10-v0.o",
|
|
|
|
"data/test-diff-filter/test10-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-13 21:09:02 +00:00
|
|
|
"data/test-diff-filter/test10-report.txt",
|
|
|
|
"output/test-diff-filter/test10-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test11-v0.o",
|
|
|
|
"data/test-diff-filter/test11-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-13 21:09:02 +00:00
|
|
|
"data/test-diff-filter/test11-report.txt",
|
|
|
|
"output/test-diff-filter/test11-report.txt",
|
|
|
|
},
|
2014-04-17 09:18:21 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test12-v0.o",
|
|
|
|
"data/test-diff-filter/test12-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-17 09:18:21 +00:00
|
|
|
"data/test-diff-filter/test12-report.txt",
|
|
|
|
"output/test-diff-filter/test12-report.txt",
|
|
|
|
},
|
2014-04-17 13:26:38 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test13-v0.o",
|
|
|
|
"data/test-diff-filter/test13-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2014-04-17 13:26:38 +00:00
|
|
|
"data/test-diff-filter/test13-report.txt",
|
|
|
|
"output/test-diff-filter/test13-report.txt",
|
|
|
|
},
|
2014-06-23 10:05:20 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test14-v0.o",
|
|
|
|
"data/test-diff-filter/test14-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-06-23 10:05:20 +00:00
|
|
|
"data/test-diff-filter/test14-0-report.txt",
|
|
|
|
"output/test-diff-filter/test14-0-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test14-v0.o",
|
|
|
|
"data/test-diff-filter/test14-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
2014-06-23 10:05:20 +00:00
|
|
|
"data/test-diff-filter/test14-1-report.txt",
|
|
|
|
"output/test-diff-filter/test14-1-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test15-v0.o",
|
|
|
|
"data/test-diff-filter/test15-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-06-23 10:05:20 +00:00
|
|
|
"data/test-diff-filter/test15-0-report.txt",
|
|
|
|
"output/test-diff-filter/test15-0-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test15-v0.o",
|
|
|
|
"data/test-diff-filter/test15-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
2014-06-23 10:05:20 +00:00
|
|
|
"data/test-diff-filter/test15-1-report.txt",
|
|
|
|
"output/test-diff-filter/test15-1-report.txt",
|
|
|
|
},
|
2014-08-28 14:12:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test16-v0.o",
|
|
|
|
"data/test-diff-filter/test16-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-08-28 14:12:16 +00:00
|
|
|
"data/test-diff-filter/test16-report.txt",
|
|
|
|
"output/test-diff-filter/test16-report.txt",
|
|
|
|
},
|
Recognize cyclic diff tree nodes as being redundant
Okay I need to introduce some vocabulary here. Suppose we have the
version 1 of a library named library-v1.so which source code is:
struct S
{
int m0;
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
And now suppose we have a version 2 of that library named
library-v2.so which source code is modified so that a new data member
is inserted into struct S:
struct S
{
int m0;
char m1; /* <--- a new data member is inserted here. */
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
struct S is said to be a cyclic type because it contains a (data)
member which type refers to struct S itself, namely, the type of the
data member S::m2 is struct S*, which refers to struct S.
So, by analogy, the diff node tree that represents the changes of
struct S is also said to be cyclic, for similar reasons: the diff
node of the change of S::m2 refers to the diff node of the change of
the type of S::m2, namely the diff node of struct S*, which refers to
the diff node for the change of struct S itself.
Now let's talk about redundancy. When walking the diff node tree of
struct S in a depth-first manner, at some point, we look at the diff
node for the data member S::m2, and we end up looking at the diff node
of its type which is the diff node for struct S*; we keep walking and
eventually we look the diff node of the change of the underlying type
of struct S, which is the diff node of struct S, and hah! that is a
redundant node because it's the first node that we visited when
visiting the diff node of ... struct S! So the diff tree node for
the change of struct S is not only a cyclic node, it's a redundant
diff node as well, and its second occurrence is located at the point
of appearance of data member S::m2. Hence the wording "cyclic
redundant diff tree node". There! We have our vocabulary all set now.
This patch enhances the code of the comparison engine so that a cyclic
diff tree node is marked as redundant from the point of its second
occurrence, onward.
First the patch separates the notion of visiting a diff node from the
notion of traversing it. Now traversing a diff node means visiting it
and visiting its children nodes. So one can visit a node without
traversing it, but one can not traverse a node without visiting it.
So, when walking diff node trees, we need to avoid ending up in
infinite loop in presence of cyclic nodes. This is why re-traversing
a node that is already being traversed is forbidden by this patch, but
visiting a node that is being visited is allowed. Before this patch,
the notions of visiting and traversing were conflated in one and were
not very clear; and one couldn't visit a node that was currently being
visited. As a result, in presence of a cyclic node, its redundant
nature wasn't being recognized, and so the diff tree node was not
being flagged as being redundant. Diff reports were then cluttered by
redundant references to changes involving cyclic types.
* include/abg-comparison.h (enum visiting_kind): Rename
enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into
DO_NOT_MARK_VISITED_NODES_AS_VISITED.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff::is_traversing): Move this from protected to public.
* src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_):
Rename diff_context::priv::traversed_diff_nodes_ into this.
(diff_context::priv::forbid_visiting_a_node_twice_): Rename
diff_context::priv::forbid_traversing_a_node_twice_ into this.
(diff_context::priv::priv): Adjust.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this. Adjust.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this. Adjust.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this. Adjust.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff_context::maybe_apply_filters): Adjust.
(diff::end_traversing): Remove the 'mark_as_traversed' parameter
of this. Remove the visited-marking code.
(diff::traverse): This is the crux of the changes of this patch.
Avoid traversing a node that is being traversed, but one can visit
a node being visited. Also, traversing a node means visiting it
and visiting its children nodes.
(diff::is_filtered_out): Simplify logic for filtering redundant
code. Basically all nodes that are redundant are filtered. All
the complicated logic that was due when diff nodes were shared is
not relevant anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes)
(propagate_categories, apply_suppressions)
(diff_node_printer::diff_node_printer, print_diff_tree)
(categorize_redundant_changed_sub_nodes)
(clear_redundancy_categorization)
(clear_redundancy_categorization): Adjust.
(redundancy_marking_visitor::visit_begin): Adjust. Also, if the
current diff node is already being traversed (that's a clyclic
node) then mark it as redundant.
* src/abg-comp-filter.cc (apply_filter): Adjust.
* tests/data/test-diff-filter/test16-report-2.txt: New test input data.
* tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New
test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source
code for the test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New
test input data.
* tests/data/test-diff-filter/test25-cyclic-type-report-1.txt:
Likewise.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs above to the list of test input data over which to run this
test harness.
* tests/data/Makefile.am: Add the new test files above to source
distribution.
* tests/data/test-diff-filter/test16-report.txt: Adjust.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-24 19:51:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test16-v0.o",
|
|
|
|
"data/test-diff-filter/test16-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
Recognize cyclic diff tree nodes as being redundant
Okay I need to introduce some vocabulary here. Suppose we have the
version 1 of a library named library-v1.so which source code is:
struct S
{
int m0;
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
And now suppose we have a version 2 of that library named
library-v2.so which source code is modified so that a new data member
is inserted into struct S:
struct S
{
int m0;
char m1; /* <--- a new data member is inserted here. */
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
struct S is said to be a cyclic type because it contains a (data)
member which type refers to struct S itself, namely, the type of the
data member S::m2 is struct S*, which refers to struct S.
So, by analogy, the diff node tree that represents the changes of
struct S is also said to be cyclic, for similar reasons: the diff
node of the change of S::m2 refers to the diff node of the change of
the type of S::m2, namely the diff node of struct S*, which refers to
the diff node for the change of struct S itself.
Now let's talk about redundancy. When walking the diff node tree of
struct S in a depth-first manner, at some point, we look at the diff
node for the data member S::m2, and we end up looking at the diff node
of its type which is the diff node for struct S*; we keep walking and
eventually we look the diff node of the change of the underlying type
of struct S, which is the diff node of struct S, and hah! that is a
redundant node because it's the first node that we visited when
visiting the diff node of ... struct S! So the diff tree node for
the change of struct S is not only a cyclic node, it's a redundant
diff node as well, and its second occurrence is located at the point
of appearance of data member S::m2. Hence the wording "cyclic
redundant diff tree node". There! We have our vocabulary all set now.
This patch enhances the code of the comparison engine so that a cyclic
diff tree node is marked as redundant from the point of its second
occurrence, onward.
First the patch separates the notion of visiting a diff node from the
notion of traversing it. Now traversing a diff node means visiting it
and visiting its children nodes. So one can visit a node without
traversing it, but one can not traverse a node without visiting it.
So, when walking diff node trees, we need to avoid ending up in
infinite loop in presence of cyclic nodes. This is why re-traversing
a node that is already being traversed is forbidden by this patch, but
visiting a node that is being visited is allowed. Before this patch,
the notions of visiting and traversing were conflated in one and were
not very clear; and one couldn't visit a node that was currently being
visited. As a result, in presence of a cyclic node, its redundant
nature wasn't being recognized, and so the diff tree node was not
being flagged as being redundant. Diff reports were then cluttered by
redundant references to changes involving cyclic types.
* include/abg-comparison.h (enum visiting_kind): Rename
enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into
DO_NOT_MARK_VISITED_NODES_AS_VISITED.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff::is_traversing): Move this from protected to public.
* src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_):
Rename diff_context::priv::traversed_diff_nodes_ into this.
(diff_context::priv::forbid_visiting_a_node_twice_): Rename
diff_context::priv::forbid_traversing_a_node_twice_ into this.
(diff_context::priv::priv): Adjust.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this. Adjust.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this. Adjust.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this. Adjust.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff_context::maybe_apply_filters): Adjust.
(diff::end_traversing): Remove the 'mark_as_traversed' parameter
of this. Remove the visited-marking code.
(diff::traverse): This is the crux of the changes of this patch.
Avoid traversing a node that is being traversed, but one can visit
a node being visited. Also, traversing a node means visiting it
and visiting its children nodes.
(diff::is_filtered_out): Simplify logic for filtering redundant
code. Basically all nodes that are redundant are filtered. All
the complicated logic that was due when diff nodes were shared is
not relevant anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes)
(propagate_categories, apply_suppressions)
(diff_node_printer::diff_node_printer, print_diff_tree)
(categorize_redundant_changed_sub_nodes)
(clear_redundancy_categorization)
(clear_redundancy_categorization): Adjust.
(redundancy_marking_visitor::visit_begin): Adjust. Also, if the
current diff node is already being traversed (that's a clyclic
node) then mark it as redundant.
* src/abg-comp-filter.cc (apply_filter): Adjust.
* tests/data/test-diff-filter/test16-report-2.txt: New test input data.
* tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New
test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source
code for the test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New
test input data.
* tests/data/test-diff-filter/test25-cyclic-type-report-1.txt:
Likewise.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs above to the list of test input data over which to run this
test harness.
* tests/data/Makefile.am: Add the new test files above to source
distribution.
* tests/data/test-diff-filter/test16-report.txt: Adjust.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-24 19:51:16 +00:00
|
|
|
"data/test-diff-filter/test16-report-2.txt",
|
|
|
|
"output/test-diff-filter/test16-report-2.txt",
|
|
|
|
},
|
2014-08-28 14:12:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test17-v0.o",
|
|
|
|
"data/test-diff-filter/test17-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-08-28 14:12:16 +00:00
|
|
|
"data/test-diff-filter/test17-0-report.txt",
|
|
|
|
"output/test-diff-filter/test17-0-report.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test17-v0.o",
|
|
|
|
"data/test-diff-filter/test17-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
2014-08-28 14:12:16 +00:00
|
|
|
"data/test-diff-filter/test17-1-report.txt",
|
|
|
|
"output/test-diff-filter/test17-1-report.txt",
|
|
|
|
},
|
2014-09-02 22:13:46 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test18-v0.o",
|
|
|
|
"data/test-diff-filter/test18-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-09-02 22:13:46 +00:00
|
|
|
"data/test-diff-filter/test18-report.txt",
|
|
|
|
"output/test-diff-filter/test18-report.txt",
|
|
|
|
},
|
2014-09-16 11:40:35 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test19-enum-v0.o",
|
|
|
|
"data/test-diff-filter/test19-enum-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-09-16 11:40:35 +00:00
|
|
|
"data/test-diff-filter/test19-enum-report-0.txt",
|
|
|
|
"output/test-diff-filter/test19-enum-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test19-enum-v0.o",
|
|
|
|
"data/test-diff-filter/test19-enum-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --harmless",
|
2014-09-16 11:40:35 +00:00
|
|
|
"data/test-diff-filter/test19-enum-report-1.txt",
|
|
|
|
"output/test-diff-filter/test19-enum-report-1.txt",
|
|
|
|
},
|
2014-09-16 12:53:30 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test20-inline-v0.o",
|
|
|
|
"data/test-diff-filter/test20-inline-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
2014-09-16 12:53:30 +00:00
|
|
|
"data/test-diff-filter/test20-inline-report-0.txt",
|
|
|
|
"output/test-diff-filter/test20-inline-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/test20-inline-v0.o",
|
|
|
|
"data/test-diff-filter/test20-inline-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --harmless",
|
2014-09-16 12:53:30 +00:00
|
|
|
"data/test-diff-filter/test20-inline-report-1.txt",
|
|
|
|
"output/test-diff-filter/test20-inline-report-1.txt",
|
|
|
|
},
|
Make determining of compatible types complete
Until now, two types that are different were considered compatible if
one type is a typedef of the other. This is useful because two
different types, if compatible, are not ABI-incompatible. This patch
extends the concept of compatible types to types which might have
sub-types that are typedefs of each others, including function types.
Note implementing this required that I fixed various other things left
and right. Like style fixes, crash avoiding fixes, etc.
* include/abg-fwd.h (is_reference_type, is_function_type)
(is_method_type): Declare new predicates.
* include/abg-ir.h (class qualified_type_def): Pimpl this class.
(qualified_type_def::qualified_type_def): Use the convenience
type_base_sptr typedef.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Use the
qualified_type_def::CV type rather than char.
(qualified_type_def::get_underlying_type): Use the convenience
type_base_sptr typedef.
(pointer_type_def::pointer_type_def): Likewise.
(function_decl::parameter::parameter): Add a new constructor.
* src/abg-ir.cc (is_reference_type, is_function_type)
(is_method_type): Define new predicates.
(class qualified_type_def::priv): Define this new private type,
for the purpose of Pimpl-ifying the qualified_type_def class.
(qualified_type_def::{qualified_type_def, build_name,
get_cv_quals_string_prefix, get_underlying_type}): Adjust for the
purpose of Pimpl-ifying the qualified_type_def class.
(equals): In the qualified_type_def, reference_type_def overloads,
trust the fact that we have operator== overload for the
type_base_sptr. This avoids crashes for when the (possible)
underlying type is null.
(pointer_type_def::operator==): Likewise.
(strip_typedef): Make this recursively strip
typedefs from sub-types.
(types_are_compatible): Handle null types.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Handle
qualified_type_def::CV rather than char.
(pointer_type_def::pointer_type_def): Use the convenience
type_base_sptr typedef.
* include/abg-comparison.h (distinct_diff::compatible_child_diff):
Declare new member function.
* src/abg-comparison.cc (distinct_diff::compatible_child_diff):
Define new member function.
(distinct_diff::chain_into_hierarchy):
Chain the compatible child diff node that might be present.
(distinct_diff::report): Now when a distinct diff carries a
compatible change, mention it in the report.
* src/abg-comp-filter.cc (is_compatible_change): A compatible
change can now involve types that are not typedefs. Only their
sub-types need to be involved with typedef-ness.
* tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust.
* tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source
code for the first data input binary above.
* tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source
code for the second data input binary above.
* tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-report-0.txt:
New test data input.
* tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source
code for the first test data input binary above.
* tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source
code for the second test data input binary above.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test data
input above to the list of test data this harness has to be run
over.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 06:25:01 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest21-compatible-vars-v0.so",
|
|
|
|
"data/test-diff-filter/libtest21-compatible-vars-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --harmless",
|
Make determining of compatible types complete
Until now, two types that are different were considered compatible if
one type is a typedef of the other. This is useful because two
different types, if compatible, are not ABI-incompatible. This patch
extends the concept of compatible types to types which might have
sub-types that are typedefs of each others, including function types.
Note implementing this required that I fixed various other things left
and right. Like style fixes, crash avoiding fixes, etc.
* include/abg-fwd.h (is_reference_type, is_function_type)
(is_method_type): Declare new predicates.
* include/abg-ir.h (class qualified_type_def): Pimpl this class.
(qualified_type_def::qualified_type_def): Use the convenience
type_base_sptr typedef.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Use the
qualified_type_def::CV type rather than char.
(qualified_type_def::get_underlying_type): Use the convenience
type_base_sptr typedef.
(pointer_type_def::pointer_type_def): Likewise.
(function_decl::parameter::parameter): Add a new constructor.
* src/abg-ir.cc (is_reference_type, is_function_type)
(is_method_type): Define new predicates.
(class qualified_type_def::priv): Define this new private type,
for the purpose of Pimpl-ifying the qualified_type_def class.
(qualified_type_def::{qualified_type_def, build_name,
get_cv_quals_string_prefix, get_underlying_type}): Adjust for the
purpose of Pimpl-ifying the qualified_type_def class.
(equals): In the qualified_type_def, reference_type_def overloads,
trust the fact that we have operator== overload for the
type_base_sptr. This avoids crashes for when the (possible)
underlying type is null.
(pointer_type_def::operator==): Likewise.
(strip_typedef): Make this recursively strip
typedefs from sub-types.
(types_are_compatible): Handle null types.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Handle
qualified_type_def::CV rather than char.
(pointer_type_def::pointer_type_def): Use the convenience
type_base_sptr typedef.
* include/abg-comparison.h (distinct_diff::compatible_child_diff):
Declare new member function.
* src/abg-comparison.cc (distinct_diff::compatible_child_diff):
Define new member function.
(distinct_diff::chain_into_hierarchy):
Chain the compatible child diff node that might be present.
(distinct_diff::report): Now when a distinct diff carries a
compatible change, mention it in the report.
* src/abg-comp-filter.cc (is_compatible_change): A compatible
change can now involve types that are not typedefs. Only their
sub-types need to be involved with typedef-ness.
* tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust.
* tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source
code for the first data input binary above.
* tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source
code for the second data input binary above.
* tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-report-0.txt:
New test data input.
* tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source
code for the first test data input binary above.
* tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source
code for the second test data input binary above.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test data
input above to the list of test data this harness has to be run
over.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 06:25:01 +00:00
|
|
|
"data/test-diff-filter/test21-compatible-vars-report-0.txt",
|
|
|
|
"output/test-diff-filter/test21-compatible-vars-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest21-compatible-vars-v0.so",
|
|
|
|
"data/test-diff-filter/libtest21-compatible-vars-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
Make determining of compatible types complete
Until now, two types that are different were considered compatible if
one type is a typedef of the other. This is useful because two
different types, if compatible, are not ABI-incompatible. This patch
extends the concept of compatible types to types which might have
sub-types that are typedefs of each others, including function types.
Note implementing this required that I fixed various other things left
and right. Like style fixes, crash avoiding fixes, etc.
* include/abg-fwd.h (is_reference_type, is_function_type)
(is_method_type): Declare new predicates.
* include/abg-ir.h (class qualified_type_def): Pimpl this class.
(qualified_type_def::qualified_type_def): Use the convenience
type_base_sptr typedef.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Use the
qualified_type_def::CV type rather than char.
(qualified_type_def::get_underlying_type): Use the convenience
type_base_sptr typedef.
(pointer_type_def::pointer_type_def): Likewise.
(function_decl::parameter::parameter): Add a new constructor.
* src/abg-ir.cc (is_reference_type, is_function_type)
(is_method_type): Define new predicates.
(class qualified_type_def::priv): Define this new private type,
for the purpose of Pimpl-ifying the qualified_type_def class.
(qualified_type_def::{qualified_type_def, build_name,
get_cv_quals_string_prefix, get_underlying_type}): Adjust for the
purpose of Pimpl-ifying the qualified_type_def class.
(equals): In the qualified_type_def, reference_type_def overloads,
trust the fact that we have operator== overload for the
type_base_sptr. This avoids crashes for when the (possible)
underlying type is null.
(pointer_type_def::operator==): Likewise.
(strip_typedef): Make this recursively strip
typedefs from sub-types.
(types_are_compatible): Handle null types.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Handle
qualified_type_def::CV rather than char.
(pointer_type_def::pointer_type_def): Use the convenience
type_base_sptr typedef.
* include/abg-comparison.h (distinct_diff::compatible_child_diff):
Declare new member function.
* src/abg-comparison.cc (distinct_diff::compatible_child_diff):
Define new member function.
(distinct_diff::chain_into_hierarchy):
Chain the compatible child diff node that might be present.
(distinct_diff::report): Now when a distinct diff carries a
compatible change, mention it in the report.
* src/abg-comp-filter.cc (is_compatible_change): A compatible
change can now involve types that are not typedefs. Only their
sub-types need to be involved with typedef-ness.
* tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust.
* tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source
code for the first data input binary above.
* tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source
code for the second data input binary above.
* tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-report-0.txt:
New test data input.
* tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source
code for the first test data input binary above.
* tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source
code for the second test data input binary above.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test data
input above to the list of test data this harness has to be run
over.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 06:25:01 +00:00
|
|
|
"data/test-diff-filter/test21-compatible-vars-report-1.txt",
|
|
|
|
"output/test-diff-filter/test21-compatible-vars-report-1.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest22-compatible-fns-v0.so",
|
|
|
|
"data/test-diff-filter/libtest22-compatible-fns-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --harmless",
|
Make determining of compatible types complete
Until now, two types that are different were considered compatible if
one type is a typedef of the other. This is useful because two
different types, if compatible, are not ABI-incompatible. This patch
extends the concept of compatible types to types which might have
sub-types that are typedefs of each others, including function types.
Note implementing this required that I fixed various other things left
and right. Like style fixes, crash avoiding fixes, etc.
* include/abg-fwd.h (is_reference_type, is_function_type)
(is_method_type): Declare new predicates.
* include/abg-ir.h (class qualified_type_def): Pimpl this class.
(qualified_type_def::qualified_type_def): Use the convenience
type_base_sptr typedef.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Use the
qualified_type_def::CV type rather than char.
(qualified_type_def::get_underlying_type): Use the convenience
type_base_sptr typedef.
(pointer_type_def::pointer_type_def): Likewise.
(function_decl::parameter::parameter): Add a new constructor.
* src/abg-ir.cc (is_reference_type, is_function_type)
(is_method_type): Define new predicates.
(class qualified_type_def::priv): Define this new private type,
for the purpose of Pimpl-ifying the qualified_type_def class.
(qualified_type_def::{qualified_type_def, build_name,
get_cv_quals_string_prefix, get_underlying_type}): Adjust for the
purpose of Pimpl-ifying the qualified_type_def class.
(equals): In the qualified_type_def, reference_type_def overloads,
trust the fact that we have operator== overload for the
type_base_sptr. This avoids crashes for when the (possible)
underlying type is null.
(pointer_type_def::operator==): Likewise.
(strip_typedef): Make this recursively strip
typedefs from sub-types.
(types_are_compatible): Handle null types.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Handle
qualified_type_def::CV rather than char.
(pointer_type_def::pointer_type_def): Use the convenience
type_base_sptr typedef.
* include/abg-comparison.h (distinct_diff::compatible_child_diff):
Declare new member function.
* src/abg-comparison.cc (distinct_diff::compatible_child_diff):
Define new member function.
(distinct_diff::chain_into_hierarchy):
Chain the compatible child diff node that might be present.
(distinct_diff::report): Now when a distinct diff carries a
compatible change, mention it in the report.
* src/abg-comp-filter.cc (is_compatible_change): A compatible
change can now involve types that are not typedefs. Only their
sub-types need to be involved with typedef-ness.
* tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust.
* tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source
code for the first data input binary above.
* tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source
code for the second data input binary above.
* tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-report-0.txt:
New test data input.
* tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source
code for the first test data input binary above.
* tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source
code for the second test data input binary above.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test data
input above to the list of test data this harness has to be run
over.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 06:25:01 +00:00
|
|
|
"data/test-diff-filter/test22-compatible-fns-report-0.txt",
|
|
|
|
"output/test-diff-filter/test22-compatible-fns-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest22-compatible-fns-v0.so",
|
|
|
|
"data/test-diff-filter/libtest22-compatible-fns-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --no-redundant",
|
Make determining of compatible types complete
Until now, two types that are different were considered compatible if
one type is a typedef of the other. This is useful because two
different types, if compatible, are not ABI-incompatible. This patch
extends the concept of compatible types to types which might have
sub-types that are typedefs of each others, including function types.
Note implementing this required that I fixed various other things left
and right. Like style fixes, crash avoiding fixes, etc.
* include/abg-fwd.h (is_reference_type, is_function_type)
(is_method_type): Declare new predicates.
* include/abg-ir.h (class qualified_type_def): Pimpl this class.
(qualified_type_def::qualified_type_def): Use the convenience
type_base_sptr typedef.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Use the
qualified_type_def::CV type rather than char.
(qualified_type_def::get_underlying_type): Use the convenience
type_base_sptr typedef.
(pointer_type_def::pointer_type_def): Likewise.
(function_decl::parameter::parameter): Add a new constructor.
* src/abg-ir.cc (is_reference_type, is_function_type)
(is_method_type): Define new predicates.
(class qualified_type_def::priv): Define this new private type,
for the purpose of Pimpl-ifying the qualified_type_def class.
(qualified_type_def::{qualified_type_def, build_name,
get_cv_quals_string_prefix, get_underlying_type}): Adjust for the
purpose of Pimpl-ifying the qualified_type_def class.
(equals): In the qualified_type_def, reference_type_def overloads,
trust the fact that we have operator== overload for the
type_base_sptr. This avoids crashes for when the (possible)
underlying type is null.
(pointer_type_def::operator==): Likewise.
(strip_typedef): Make this recursively strip
typedefs from sub-types.
(types_are_compatible): Handle null types.
(qualified_type_def::{get_cv_quals, set_cv_quals}): Handle
qualified_type_def::CV rather than char.
(pointer_type_def::pointer_type_def): Use the convenience
type_base_sptr typedef.
* include/abg-comparison.h (distinct_diff::compatible_child_diff):
Declare new member function.
* src/abg-comparison.cc (distinct_diff::compatible_child_diff):
Define new member function.
(distinct_diff::chain_into_hierarchy):
Chain the compatible child diff node that might be present.
(distinct_diff::report): Now when a distinct diff carries a
compatible change, mention it in the report.
* src/abg-comp-filter.cc (is_compatible_change): A compatible
change can now involve types that are not typedefs. Only their
sub-types need to be involved with typedef-ness.
* tests/data/test-diff-dwarf/test{2,4,5}-report.txt: Adjust.
* tests/data/test-diff-filter/libtest21-compatible-vars-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest21-compatible-vars-v1.so: Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-0.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-report-1.txt Likewise.
* tests/data/test-diff-filter/test21-compatible-vars-v0.cc: Source
code for the first data input binary above.
* tests/data/test-diff-filter/test21-compatible-vars-v1.cc: Source
code for the second data input binary above.
* tests/data/test-diff-filter/libtest22-compatible-fns-v0.so: New
test data input.
* tests/data/test-diff-filter/libtest22-compatible-fns-v1.so Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-report-0.txt:
New test data input.
* tests/data/test-diff-filter/test22-compatible-fns-report-1.txt: Likewise.
* tests/data/test-diff-filter/test22-compatible-fns-v0.c: Source
code for the first test data input binary above.
* tests/data/test-diff-filter/test22-compatible-fns-v1.c: Source
code for the second test data input binary above.
* tests/data/Makefile.am: Add the new test input data to source
distribution.
* tests/test-diff-filter.cc (in_out_specs): Add the new test data
input above to the list of test data this harness has to be run
over.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 06:25:01 +00:00
|
|
|
"data/test-diff-filter/test22-compatible-fns-report-1.txt",
|
|
|
|
"output/test-diff-filter/test22-compatible-fns-report-1.txt",
|
|
|
|
},
|
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
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so",
|
|
|
|
"data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs",
|
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
|
|
|
"data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt ",
|
|
|
|
"output/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt ",
|
|
|
|
},
|
2014-12-12 13:30:31 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest24-compatible-vars-v0.so",
|
|
|
|
"data/test-diff-filter/libtest24-compatible-vars-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs",
|
2014-12-12 13:30:31 +00:00
|
|
|
"data/test-diff-filter/test24-compatible-vars-report-0.txt ",
|
|
|
|
"output/test-diff-filter/test24-compatible-vars-report-0.txt ",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest24-compatible-vars-v0.so",
|
|
|
|
"data/test-diff-filter/libtest24-compatible-vars-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --harmless",
|
2014-12-12 13:30:31 +00:00
|
|
|
"data/test-diff-filter/test24-compatible-vars-report-1.txt ",
|
|
|
|
"output/test-diff-filter/test24-compatible-vars-report-1.txt ",
|
|
|
|
},
|
Recognize cyclic diff tree nodes as being redundant
Okay I need to introduce some vocabulary here. Suppose we have the
version 1 of a library named library-v1.so which source code is:
struct S
{
int m0;
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
And now suppose we have a version 2 of that library named
library-v2.so which source code is modified so that a new data member
is inserted into struct S:
struct S
{
int m0;
char m1; /* <--- a new data member is inserted here. */
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
struct S is said to be a cyclic type because it contains a (data)
member which type refers to struct S itself, namely, the type of the
data member S::m2 is struct S*, which refers to struct S.
So, by analogy, the diff node tree that represents the changes of
struct S is also said to be cyclic, for similar reasons: the diff
node of the change of S::m2 refers to the diff node of the change of
the type of S::m2, namely the diff node of struct S*, which refers to
the diff node for the change of struct S itself.
Now let's talk about redundancy. When walking the diff node tree of
struct S in a depth-first manner, at some point, we look at the diff
node for the data member S::m2, and we end up looking at the diff node
of its type which is the diff node for struct S*; we keep walking and
eventually we look the diff node of the change of the underlying type
of struct S, which is the diff node of struct S, and hah! that is a
redundant node because it's the first node that we visited when
visiting the diff node of ... struct S! So the diff tree node for
the change of struct S is not only a cyclic node, it's a redundant
diff node as well, and its second occurrence is located at the point
of appearance of data member S::m2. Hence the wording "cyclic
redundant diff tree node". There! We have our vocabulary all set now.
This patch enhances the code of the comparison engine so that a cyclic
diff tree node is marked as redundant from the point of its second
occurrence, onward.
First the patch separates the notion of visiting a diff node from the
notion of traversing it. Now traversing a diff node means visiting it
and visiting its children nodes. So one can visit a node without
traversing it, but one can not traverse a node without visiting it.
So, when walking diff node trees, we need to avoid ending up in
infinite loop in presence of cyclic nodes. This is why re-traversing
a node that is already being traversed is forbidden by this patch, but
visiting a node that is being visited is allowed. Before this patch,
the notions of visiting and traversing were conflated in one and were
not very clear; and one couldn't visit a node that was currently being
visited. As a result, in presence of a cyclic node, its redundant
nature wasn't being recognized, and so the diff tree node was not
being flagged as being redundant. Diff reports were then cluttered by
redundant references to changes involving cyclic types.
* include/abg-comparison.h (enum visiting_kind): Rename
enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into
DO_NOT_MARK_VISITED_NODES_AS_VISITED.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff::is_traversing): Move this from protected to public.
* src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_):
Rename diff_context::priv::traversed_diff_nodes_ into this.
(diff_context::priv::forbid_visiting_a_node_twice_): Rename
diff_context::priv::forbid_traversing_a_node_twice_ into this.
(diff_context::priv::priv): Adjust.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this. Adjust.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this. Adjust.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this. Adjust.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff_context::maybe_apply_filters): Adjust.
(diff::end_traversing): Remove the 'mark_as_traversed' parameter
of this. Remove the visited-marking code.
(diff::traverse): This is the crux of the changes of this patch.
Avoid traversing a node that is being traversed, but one can visit
a node being visited. Also, traversing a node means visiting it
and visiting its children nodes.
(diff::is_filtered_out): Simplify logic for filtering redundant
code. Basically all nodes that are redundant are filtered. All
the complicated logic that was due when diff nodes were shared is
not relevant anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes)
(propagate_categories, apply_suppressions)
(diff_node_printer::diff_node_printer, print_diff_tree)
(categorize_redundant_changed_sub_nodes)
(clear_redundancy_categorization)
(clear_redundancy_categorization): Adjust.
(redundancy_marking_visitor::visit_begin): Adjust. Also, if the
current diff node is already being traversed (that's a clyclic
node) then mark it as redundant.
* src/abg-comp-filter.cc (apply_filter): Adjust.
* tests/data/test-diff-filter/test16-report-2.txt: New test input data.
* tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New
test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source
code for the test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New
test input data.
* tests/data/test-diff-filter/test25-cyclic-type-report-1.txt:
Likewise.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs above to the list of test input data over which to run this
test harness.
* tests/data/Makefile.am: Add the new test files above to source
distribution.
* tests/data/test-diff-filter/test16-report.txt: Adjust.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-24 19:51:16 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest25-cyclic-type-v0.so",
|
|
|
|
"data/test-diff-filter/libtest25-cyclic-type-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs",
|
Recognize cyclic diff tree nodes as being redundant
Okay I need to introduce some vocabulary here. Suppose we have the
version 1 of a library named library-v1.so which source code is:
struct S
{
int m0;
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
And now suppose we have a version 2 of that library named
library-v2.so which source code is modified so that a new data member
is inserted into struct S:
struct S
{
int m0;
char m1; /* <--- a new data member is inserted here. */
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
struct S is said to be a cyclic type because it contains a (data)
member which type refers to struct S itself, namely, the type of the
data member S::m2 is struct S*, which refers to struct S.
So, by analogy, the diff node tree that represents the changes of
struct S is also said to be cyclic, for similar reasons: the diff
node of the change of S::m2 refers to the diff node of the change of
the type of S::m2, namely the diff node of struct S*, which refers to
the diff node for the change of struct S itself.
Now let's talk about redundancy. When walking the diff node tree of
struct S in a depth-first manner, at some point, we look at the diff
node for the data member S::m2, and we end up looking at the diff node
of its type which is the diff node for struct S*; we keep walking and
eventually we look the diff node of the change of the underlying type
of struct S, which is the diff node of struct S, and hah! that is a
redundant node because it's the first node that we visited when
visiting the diff node of ... struct S! So the diff tree node for
the change of struct S is not only a cyclic node, it's a redundant
diff node as well, and its second occurrence is located at the point
of appearance of data member S::m2. Hence the wording "cyclic
redundant diff tree node". There! We have our vocabulary all set now.
This patch enhances the code of the comparison engine so that a cyclic
diff tree node is marked as redundant from the point of its second
occurrence, onward.
First the patch separates the notion of visiting a diff node from the
notion of traversing it. Now traversing a diff node means visiting it
and visiting its children nodes. So one can visit a node without
traversing it, but one can not traverse a node without visiting it.
So, when walking diff node trees, we need to avoid ending up in
infinite loop in presence of cyclic nodes. This is why re-traversing
a node that is already being traversed is forbidden by this patch, but
visiting a node that is being visited is allowed. Before this patch,
the notions of visiting and traversing were conflated in one and were
not very clear; and one couldn't visit a node that was currently being
visited. As a result, in presence of a cyclic node, its redundant
nature wasn't being recognized, and so the diff tree node was not
being flagged as being redundant. Diff reports were then cluttered by
redundant references to changes involving cyclic types.
* include/abg-comparison.h (enum visiting_kind): Rename
enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into
DO_NOT_MARK_VISITED_NODES_AS_VISITED.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff::is_traversing): Move this from protected to public.
* src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_):
Rename diff_context::priv::traversed_diff_nodes_ into this.
(diff_context::priv::forbid_visiting_a_node_twice_): Rename
diff_context::priv::forbid_traversing_a_node_twice_ into this.
(diff_context::priv::priv): Adjust.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this. Adjust.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this. Adjust.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this. Adjust.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff_context::maybe_apply_filters): Adjust.
(diff::end_traversing): Remove the 'mark_as_traversed' parameter
of this. Remove the visited-marking code.
(diff::traverse): This is the crux of the changes of this patch.
Avoid traversing a node that is being traversed, but one can visit
a node being visited. Also, traversing a node means visiting it
and visiting its children nodes.
(diff::is_filtered_out): Simplify logic for filtering redundant
code. Basically all nodes that are redundant are filtered. All
the complicated logic that was due when diff nodes were shared is
not relevant anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes)
(propagate_categories, apply_suppressions)
(diff_node_printer::diff_node_printer, print_diff_tree)
(categorize_redundant_changed_sub_nodes)
(clear_redundancy_categorization)
(clear_redundancy_categorization): Adjust.
(redundancy_marking_visitor::visit_begin): Adjust. Also, if the
current diff node is already being traversed (that's a clyclic
node) then mark it as redundant.
* src/abg-comp-filter.cc (apply_filter): Adjust.
* tests/data/test-diff-filter/test16-report-2.txt: New test input data.
* tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New
test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source
code for the test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New
test input data.
* tests/data/test-diff-filter/test25-cyclic-type-report-1.txt:
Likewise.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs above to the list of test input data over which to run this
test harness.
* tests/data/Makefile.am: Add the new test files above to source
distribution.
* tests/data/test-diff-filter/test16-report.txt: Adjust.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-24 19:51:16 +00:00
|
|
|
"data/test-diff-filter/test25-cyclic-type-report-0.txt ",
|
|
|
|
"output/test-diff-filter/test25-cyclic-type-report-0.txt "
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest25-cyclic-type-v0.so",
|
|
|
|
"data/test-diff-filter/libtest25-cyclic-type-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
Recognize cyclic diff tree nodes as being redundant
Okay I need to introduce some vocabulary here. Suppose we have the
version 1 of a library named library-v1.so which source code is:
struct S
{
int m0;
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
And now suppose we have a version 2 of that library named
library-v2.so which source code is modified so that a new data member
is inserted into struct S:
struct S
{
int m0;
char m1; /* <--- a new data member is inserted here. */
struct S* m2;
};
int
foo(struct S* ptr)
{
return ptr;
}
struct S is said to be a cyclic type because it contains a (data)
member which type refers to struct S itself, namely, the type of the
data member S::m2 is struct S*, which refers to struct S.
So, by analogy, the diff node tree that represents the changes of
struct S is also said to be cyclic, for similar reasons: the diff
node of the change of S::m2 refers to the diff node of the change of
the type of S::m2, namely the diff node of struct S*, which refers to
the diff node for the change of struct S itself.
Now let's talk about redundancy. When walking the diff node tree of
struct S in a depth-first manner, at some point, we look at the diff
node for the data member S::m2, and we end up looking at the diff node
of its type which is the diff node for struct S*; we keep walking and
eventually we look the diff node of the change of the underlying type
of struct S, which is the diff node of struct S, and hah! that is a
redundant node because it's the first node that we visited when
visiting the diff node of ... struct S! So the diff tree node for
the change of struct S is not only a cyclic node, it's a redundant
diff node as well, and its second occurrence is located at the point
of appearance of data member S::m2. Hence the wording "cyclic
redundant diff tree node". There! We have our vocabulary all set now.
This patch enhances the code of the comparison engine so that a cyclic
diff tree node is marked as redundant from the point of its second
occurrence, onward.
First the patch separates the notion of visiting a diff node from the
notion of traversing it. Now traversing a diff node means visiting it
and visiting its children nodes. So one can visit a node without
traversing it, but one can not traverse a node without visiting it.
So, when walking diff node trees, we need to avoid ending up in
infinite loop in presence of cyclic nodes. This is why re-traversing
a node that is already being traversed is forbidden by this patch, but
visiting a node that is being visited is allowed. Before this patch,
the notions of visiting and traversing were conflated in one and were
not very clear; and one couldn't visit a node that was currently being
visited. As a result, in presence of a cyclic node, its redundant
nature wasn't being recognized, and so the diff tree node was not
being flagged as being redundant. Diff reports were then cluttered by
redundant references to changes involving cyclic types.
* include/abg-comparison.h (enum visiting_kind): Rename
enumerator DO_NOT_MARK_VISITED_NODES_AS_TRAVERSED into
DO_NOT_MARK_VISITED_NODES_AS_VISITED.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff::is_traversing): Move this from protected to public.
* src/abg-comparison.cc (diff_context::priv::visited_diff_nodes_):
Rename diff_context::priv::traversed_diff_nodes_ into this.
(diff_context::priv::forbid_visiting_a_node_twice_): Rename
diff_context::priv::forbid_traversing_a_node_twice_ into this.
(diff_context::priv::priv): Adjust.
(diff_context::diff_has_been_visited): Rename
diff_context::diff_has_been_traversed into this. Adjust.
(diff_context::mark_diff_as_visited): Rename
diff_context::mark_diff_as_traversed into this. Adjust.
(diff_context::forget_visited_diffs): Rename
diff_context::forget_traversed_diffs into this. Adjust.
(diff_context::forbid_visiting_a_node_twice): Rename
diff_context::forbid_traversing_a_node_twice into this.
(diff_context::visiting_a_node_twice_is_forbidden): Rename
diff_context::traversing_a_node_twice_is_forbidden into this.
(diff_context::maybe_apply_filters): Adjust.
(diff::end_traversing): Remove the 'mark_as_traversed' parameter
of this. Remove the visited-marking code.
(diff::traverse): This is the crux of the changes of this patch.
Avoid traversing a node that is being traversed, but one can visit
a node being visited. Also, traversing a node means visiting it
and visiting its children nodes.
(diff::is_filtered_out): Simplify logic for filtering redundant
code. Basically all nodes that are redundant are filtered. All
the complicated logic that was due when diff nodes were shared is
not relevant anymore.
(corpus_diff::priv::categorize_redundant_changed_sub_nodes)
(propagate_categories, apply_suppressions)
(diff_node_printer::diff_node_printer, print_diff_tree)
(categorize_redundant_changed_sub_nodes)
(clear_redundancy_categorization)
(clear_redundancy_categorization): Adjust.
(redundancy_marking_visitor::visit_begin): Adjust. Also, if the
current diff node is already being traversed (that's a clyclic
node) then mark it as redundant.
* src/abg-comp-filter.cc (apply_filter): Adjust.
* tests/data/test-diff-filter/test16-report-2.txt: New test input data.
* tests/data/test-diff-filter/libtest25-cyclic-type-v{0,1}.so: New
test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-v{0,1}.cc: Source
code for the test input binaries.
* tests/data/test-diff-filter/test25-cyclic-type-report-0.txt: New
test input data.
* tests/data/test-diff-filter/test25-cyclic-type-report-1.txt:
Likewise.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs above to the list of test input data over which to run this
test harness.
* tests/data/Makefile.am: Add the new test files above to source
distribution.
* tests/data/test-diff-filter/test16-report.txt: Adjust.
* tests/data/test-diff-filter/test17-0-report.txt: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-24 19:51:16 +00:00
|
|
|
"data/test-diff-filter/test25-cyclic-type-report-1.txt ",
|
|
|
|
"output/test-diff-filter/test25-cyclic-type-report-1.txt "
|
|
|
|
},
|
Fix chaining of descendant node of qualified type diff node
While looking at the abidiff report emitted for two versions of the
TBB library, I noticed that some diff nodes were not marked as
redundant as they should be. As a result, they were being reported as
having "been reported earlier", which seems to be an acceptable cruft
to me especially now that the comparison IR can do proper redundancy
detection and marking.
I tracked that down and it's because the child node of a
qualified_type_diff is just the underlying type diff node, whereas
during reporting, we report about the leaf underlying type diff node,
which can be different from the just the underlying type diff node
because the later is always non-qualified.
The fix is to make the child node of qualified_type_diff be the leaf
underlying type diff node, so that diff tree walking (for the purpose
of redundancy detection) and reporting are all looking at the same
tree.
* include/abg-comparison.h
(qualified_type_diff::leaf_underlying_type_diff): Declare new
accessor.
* src/abg-comparison.cc (get_leaf_type): Forward declare this
static function.
(qualified_type_diff::priv::leaf_underlying_type_diff): Define new
data member.
(qualified_type_diff::leaf_underlying_type_diff): Define this new
accessor.
(qualified_type_diff::chain_into_hierarchy): Call
leaf_underlying_type_diff() here rather than
underlying_type_diff().
(qualified_type_diff::report): Use leaf_underlying_type_diff()
rather than re-computing the diff between the two leaf underlying
type diff nodes.
* libtest26-qualified-redundant-node-v{0,1}.so: New binary test
input files.
* tests/data/test-diff-filter/test26-qualified-redundant-node-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/test-diff-filter.cc (int_out_spec): Add the new test input
to the vector of test input data over which to run this test
harness.
* tests/data/test-diff-filter/test26-qualified-redundant-node-report-{0,1.txt:
New test input file.
* tests/data/Makefile.am: Add the new test input data to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-26 10:38:08 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest26-qualified-redundant-node-v0.so",
|
|
|
|
"data/test-diff-filter/libtest26-qualified-redundant-node-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs",
|
Fix chaining of descendant node of qualified type diff node
While looking at the abidiff report emitted for two versions of the
TBB library, I noticed that some diff nodes were not marked as
redundant as they should be. As a result, they were being reported as
having "been reported earlier", which seems to be an acceptable cruft
to me especially now that the comparison IR can do proper redundancy
detection and marking.
I tracked that down and it's because the child node of a
qualified_type_diff is just the underlying type diff node, whereas
during reporting, we report about the leaf underlying type diff node,
which can be different from the just the underlying type diff node
because the later is always non-qualified.
The fix is to make the child node of qualified_type_diff be the leaf
underlying type diff node, so that diff tree walking (for the purpose
of redundancy detection) and reporting are all looking at the same
tree.
* include/abg-comparison.h
(qualified_type_diff::leaf_underlying_type_diff): Declare new
accessor.
* src/abg-comparison.cc (get_leaf_type): Forward declare this
static function.
(qualified_type_diff::priv::leaf_underlying_type_diff): Define new
data member.
(qualified_type_diff::leaf_underlying_type_diff): Define this new
accessor.
(qualified_type_diff::chain_into_hierarchy): Call
leaf_underlying_type_diff() here rather than
underlying_type_diff().
(qualified_type_diff::report): Use leaf_underlying_type_diff()
rather than re-computing the diff between the two leaf underlying
type diff nodes.
* libtest26-qualified-redundant-node-v{0,1}.so: New binary test
input files.
* tests/data/test-diff-filter/test26-qualified-redundant-node-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/test-diff-filter.cc (int_out_spec): Add the new test input
to the vector of test input data over which to run this test
harness.
* tests/data/test-diff-filter/test26-qualified-redundant-node-report-{0,1.txt:
New test input file.
* tests/data/Makefile.am: Add the new test input data to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-26 10:38:08 +00:00
|
|
|
"data/test-diff-filter/test26-qualified-redundant-node-report-0.txt",
|
|
|
|
"output/test-diff-filter/test26-qualified-redundant-node-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest26-qualified-redundant-node-v0.so",
|
|
|
|
"data/test-diff-filter/libtest26-qualified-redundant-node-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-show-locs --redundant",
|
Fix chaining of descendant node of qualified type diff node
While looking at the abidiff report emitted for two versions of the
TBB library, I noticed that some diff nodes were not marked as
redundant as they should be. As a result, they were being reported as
having "been reported earlier", which seems to be an acceptable cruft
to me especially now that the comparison IR can do proper redundancy
detection and marking.
I tracked that down and it's because the child node of a
qualified_type_diff is just the underlying type diff node, whereas
during reporting, we report about the leaf underlying type diff node,
which can be different from the just the underlying type diff node
because the later is always non-qualified.
The fix is to make the child node of qualified_type_diff be the leaf
underlying type diff node, so that diff tree walking (for the purpose
of redundancy detection) and reporting are all looking at the same
tree.
* include/abg-comparison.h
(qualified_type_diff::leaf_underlying_type_diff): Declare new
accessor.
* src/abg-comparison.cc (get_leaf_type): Forward declare this
static function.
(qualified_type_diff::priv::leaf_underlying_type_diff): Define new
data member.
(qualified_type_diff::leaf_underlying_type_diff): Define this new
accessor.
(qualified_type_diff::chain_into_hierarchy): Call
leaf_underlying_type_diff() here rather than
underlying_type_diff().
(qualified_type_diff::report): Use leaf_underlying_type_diff()
rather than re-computing the diff between the two leaf underlying
type diff nodes.
* libtest26-qualified-redundant-node-v{0,1}.so: New binary test
input files.
* tests/data/test-diff-filter/test26-qualified-redundant-node-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/test-diff-filter.cc (int_out_spec): Add the new test input
to the vector of test input data over which to run this test
harness.
* tests/data/test-diff-filter/test26-qualified-redundant-node-report-{0,1.txt:
New test input file.
* tests/data/Makefile.am: Add the new test input data to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-01-26 10:38:08 +00:00
|
|
|
"data/test-diff-filter/test26-qualified-redundant-node-report-1.txt",
|
|
|
|
"output/test-diff-filter/test26-qualified-redundant-node-report-1.txt"
|
|
|
|
},
|
2015-03-13 12:30:01 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v0.so",
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2015-03-13 12:30:01 +00:00
|
|
|
"data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt",
|
|
|
|
"output/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-0.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v0.so",
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --redundant",
|
2015-03-13 12:30:01 +00:00
|
|
|
"data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt",
|
|
|
|
"output/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-1.txt"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v0.so",
|
|
|
|
"data/test-diff-filter/libtest27-redundant-and-filtered-children-nodes-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --redundant --no-show-locs --harmless",
|
2015-03-13 12:30:01 +00:00
|
|
|
"data/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt",
|
|
|
|
"output/test-diff-filter/test27-redundant-and-filtered-children-nodes-report-2.txt"
|
|
|
|
},
|
Fix redundancy propagation on node with filtered local changes
Until now, if a diff node N has a local change, even if all of its
children nodes are redundant, N is not considered as being redundant.
This is an issue if the local changes of N are filtered out; in that
case, N should be considered redundant.
This patch fixes that. It introduces a second category bitmap on the
diff node that stores the categorization of the diff node that does
*NOT* take in account the categories inherited from its children
nodes. That way, it's possible to know if the *local changes* of a
given node have been filtered out.
* include/abg-comparison.h (diff::{get_local_category,
add_to_local_category, add_to_local_and_inherited_categories,
remove_from_local_category, set_local_category,
is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Declare new member functions.
* src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit,
visit_end}): Update local category too.
* src/abg-comparison.cc (diff::priv::local_category_): Add new
data member.
(diff::priv::priv): Initialize it.
(diff::priv::is_filtered_out): Add new member function. This is
factorized out of diff::is_filtered_out().
(diff::is_filtered_out): Re-write in terms of
diff::priv::is_filtered_out().
(diff::{get_local_category, add_to_local_category,
add_to_local_and_inherited_categories, remove_from_local_category,
set_local_category, is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Define new member functions.
(suppression_categorization_visitor::visit_begin): Update local
categories too.
(redundancy_marking_visitor::visit_end): If all of the children
nodes of the a diff node N are redundant and if N has filtered-out
local changes, then N is redundant too.
* tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so:
New binary test inputs.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt:
New test output references.
* tests/test-diff-filter.cc (in_out_specs): Add the test inputs
above to the set of inputs this test harness has to run over.
* tests/data/Makefile.am: Add the test materials above to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-18 17:01:48 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v0.so",
|
|
|
|
"data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
Fix redundancy propagation on node with filtered local changes
Until now, if a diff node N has a local change, even if all of its
children nodes are redundant, N is not considered as being redundant.
This is an issue if the local changes of N are filtered out; in that
case, N should be considered redundant.
This patch fixes that. It introduces a second category bitmap on the
diff node that stores the categorization of the diff node that does
*NOT* take in account the categories inherited from its children
nodes. That way, it's possible to know if the *local changes* of a
given node have been filtered out.
* include/abg-comparison.h (diff::{get_local_category,
add_to_local_category, add_to_local_and_inherited_categories,
remove_from_local_category, set_local_category,
is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Declare new member functions.
* src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit,
visit_end}): Update local category too.
* src/abg-comparison.cc (diff::priv::local_category_): Add new
data member.
(diff::priv::priv): Initialize it.
(diff::priv::is_filtered_out): Add new member function. This is
factorized out of diff::is_filtered_out().
(diff::is_filtered_out): Re-write in terms of
diff::priv::is_filtered_out().
(diff::{get_local_category, add_to_local_category,
add_to_local_and_inherited_categories, remove_from_local_category,
set_local_category, is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Define new member functions.
(suppression_categorization_visitor::visit_begin): Update local
categories too.
(redundancy_marking_visitor::visit_end): If all of the children
nodes of the a diff node N are redundant and if N has filtered-out
local changes, then N is redundant too.
* tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so:
New binary test inputs.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt:
New test output references.
* tests/test-diff-filter.cc (in_out_specs): Add the test inputs
above to the set of inputs this test harness has to run over.
* tests/data/Makefile.am: Add the test materials above to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-18 17:01:48 +00:00
|
|
|
"data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt",
|
|
|
|
"output/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-0.txt",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v0.so",
|
|
|
|
"data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v1.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --redundant --no-show-locs --harmless",
|
Fix redundancy propagation on node with filtered local changes
Until now, if a diff node N has a local change, even if all of its
children nodes are redundant, N is not considered as being redundant.
This is an issue if the local changes of N are filtered out; in that
case, N should be considered redundant.
This patch fixes that. It introduces a second category bitmap on the
diff node that stores the categorization of the diff node that does
*NOT* take in account the categories inherited from its children
nodes. That way, it's possible to know if the *local changes* of a
given node have been filtered out.
* include/abg-comparison.h (diff::{get_local_category,
add_to_local_category, add_to_local_and_inherited_categories,
remove_from_local_category, set_local_category,
is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Declare new member functions.
* src/abg-comp-filter.cc ({harmless, harmful}_filter::{visit,
visit_end}): Update local category too.
* src/abg-comparison.cc (diff::priv::local_category_): Add new
data member.
(diff::priv::priv): Initialize it.
(diff::priv::is_filtered_out): Add new member function. This is
factorized out of diff::is_filtered_out().
(diff::is_filtered_out): Re-write in terms of
diff::priv::is_filtered_out().
(diff::{get_local_category, add_to_local_category,
add_to_local_and_inherited_categories, remove_from_local_category,
set_local_category, is_filtered_out_wrt_non_inherited_categories,
has_local_changes_to_be_reported}): Define new member functions.
(suppression_categorization_visitor::visit_begin): Update local
categories too.
(redundancy_marking_visitor::visit_end): If all of the children
nodes of the a diff node N are redundant and if N has filtered-out
local changes, then N is redundant too.
* tests/data/test-diff-filter/libtest28-redundant-and-filtered-children-nodes-v{1,2}.so:
New binary test inputs.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-v{0,1}.cc:
Source code for the binary test inputs above.
* tests/data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-{0,1}.txt:
New test output references.
* tests/test-diff-filter.cc (in_out_specs): Add the test inputs
above to the set of inputs this test harness has to run over.
* tests/data/Makefile.am: Add the test materials above to the
source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-03-18 17:01:48 +00:00
|
|
|
"data/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt",
|
|
|
|
"output/test-diff-filter/test28-redundant-and-filtered-children-nodes-report-1.txt",
|
|
|
|
},
|
Fix redundancy marking for change of types used directly
If a type T is used directly (i.e, not through a pointer or reference)
as a function parameter or as a base class, a change in T should never
be marked as redundant in that context. Otherwise, the change in that
context might be filtered out, possibly hiding real ABI incompatible
changes.
This patch implements this policy.
Also, it turned out in some circumstances, we where marking the first
visited diff node of a given class of equivalence of nodes as being
redundant, while we should only mark the *subsequently* visited nodes
of that class of equivalence as visited. The patch also fixes that.
* include/abg-comparison.h (pointer_map): Make this be a map of
{size_t, size_t} pairs, rather than {size_t, bool}, so that each
pointer in the map can be associated to another one.
(diff_context::diff_has_been_visited): Return the pointer to the
first diff node of the equivalence class that has been visited.
* src/abg-comparison.cc (is_pointer_diff, is_reference_diff)
(is_reference_or_pointer_diff, is_fn_parm_diff, is_base_diff)
(is_child_node_of_function_parm_diff, is_child_node_of_base_diff):
Define new static functions.
(diff_context::diff_has_been_visited): Return the pointer to the
first diff node of the equivalence class that has been visited.
(diff_context::mark_diff_as_visited): Save the pointer to the
first diff node of a given class of equivalence that has been
visited.
(redundancy_marking_visitor::visit_begin): If a diff node is a
child node of a function parameter diff or base diff node and if
it's not a pointer or reference diff node, then do not mark it as
redundant. Also, make sure to not mark the first diff node of a
given class of equivalence that has been visited, as redundant;
only the other subsequent nodes should be marked redundant; we
were hitting this case because of an optimization that makes
equivalent class diff nodes to share their private (pimpl) data.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.o:
New test input binaries.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.cc:
Source code of the new test input binaries above.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt:
New test input.
* tests/data/Makefile.am: Add the new test material above to the
source distribution.
* tests/test-diff-filter.cc (in_out_specs): Make this test harness
run over the additional test input above.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-03 08:44:07 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test29-finer-redundancy-marking-v0.o",
|
|
|
|
"data/test-diff-filter/test29-finer-redundancy-marking-v1.o",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
Fix redundancy marking for change of types used directly
If a type T is used directly (i.e, not through a pointer or reference)
as a function parameter or as a base class, a change in T should never
be marked as redundant in that context. Otherwise, the change in that
context might be filtered out, possibly hiding real ABI incompatible
changes.
This patch implements this policy.
Also, it turned out in some circumstances, we where marking the first
visited diff node of a given class of equivalence of nodes as being
redundant, while we should only mark the *subsequently* visited nodes
of that class of equivalence as visited. The patch also fixes that.
* include/abg-comparison.h (pointer_map): Make this be a map of
{size_t, size_t} pairs, rather than {size_t, bool}, so that each
pointer in the map can be associated to another one.
(diff_context::diff_has_been_visited): Return the pointer to the
first diff node of the equivalence class that has been visited.
* src/abg-comparison.cc (is_pointer_diff, is_reference_diff)
(is_reference_or_pointer_diff, is_fn_parm_diff, is_base_diff)
(is_child_node_of_function_parm_diff, is_child_node_of_base_diff):
Define new static functions.
(diff_context::diff_has_been_visited): Return the pointer to the
first diff node of the equivalence class that has been visited.
(diff_context::mark_diff_as_visited): Save the pointer to the
first diff node of a given class of equivalence that has been
visited.
(redundancy_marking_visitor::visit_begin): If a diff node is a
child node of a function parameter diff or base diff node and if
it's not a pointer or reference diff node, then do not mark it as
redundant. Also, make sure to not mark the first diff node of a
given class of equivalence that has been visited, as redundant;
only the other subsequent nodes should be marked redundant; we
were hitting this case because of an optimization that makes
equivalent class diff nodes to share their private (pimpl) data.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.o:
New test input binaries.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-v{0,1}.cc:
Source code of the new test input binaries above.
* tests/data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt:
New test input.
* tests/data/Makefile.am: Add the new test material above to the
source distribution.
* tests/test-diff-filter.cc (in_out_specs): Make this test harness
run over the additional test input above.
* tests/data/test-diff-suppr/test5-fn-suppr-report-0.txt: Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2015-06-03 08:44:07 +00:00
|
|
|
"data/test-diff-filter/test29-finer-redundancy-marking-report-0.txt",
|
|
|
|
"output/test-diff-filter/test29-finer-redundancy-marking-report-0.txt",
|
|
|
|
},
|
2015-09-02 12:28:41 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-liba.so",
|
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-libb.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2015-09-02 12:28:41 +00:00
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-report0.txt",
|
|
|
|
"output/test-diff-filter/test30-pr18904-rvalueref-report0.txt",
|
|
|
|
},
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
{ // Just like the previous test, but emit loc info.
|
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-liba.so",
|
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-libb.so",
|
|
|
|
"--no-linkage-name --no-redundant",
|
|
|
|
"data/test-diff-filter/test30-pr18904-rvalueref-report1.txt",
|
|
|
|
"output/test-diff-filter/test30-pr18904-rvalueref-report1.txt",
|
|
|
|
},
|
2015-09-24 09:00:12 +00:00
|
|
|
{
|
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-4.8.3.so",
|
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-4.9.2.so",
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
"--no-linkage-name --no-show-locs --no-redundant",
|
2015-09-24 09:00:12 +00:00
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt",
|
|
|
|
"output/test-diff-filter/test31-pr18535-libstdc++-report-0.txt",
|
|
|
|
},
|
Add the option of printing the file, line and column information about a type being reported.
* bash-completion/abicompat: Complete the new "--no-show-locs" option.
* bash-completion/abidiff: Likewise.
* bash-completion/abidw: Likewise.
* bash-completion/abipkgdiff: Likewise.
* doc/manuals/abicompat.rst: Mention the new "--no-show-locs" option.
* doc/manuals/abidiff.rst: Likewise.
* doc/manuals/abidw.rst: Likewise.
* doc/manuals/abipkgdiff.rst: Likewise.
* include/abg-comparison.h (show_locs): Add declarations.
* src/abg-comparison.cc: (diff_context::priv): Add a new switch
called "show_locs_" and set its default value to false.
(report_loc_info): New function. Outputting the extra information
is conditionalized based on the associated diff contexts settings.
(show_locs): define a getter/setter for
diff_context::priv::show_locs_.
({distinct,pointer,reference,qualified_type,enum,class,scope,fn_parm,
typedef,corpus}_diff::report): Call report_loc_info when
appropriate.
(maybe_report_diff_for_member): Likewise.
(represent): Accept a const reference to a diff_context_sptr as a first
argument and call report_loc_info on its second argument.
* src/abg-dwarf-reader.cc:
* tests/data/Makefile.am: Add the new test reference files.
* tests/data/test-abicompat/test0-fn-changed-report-2.txt: New test
reference output.
* tests/data/test-abicompat/test5-fn-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test6-var-changed-report-1.txt: Likewise.
* tests/data/test-abicompat/test7-fn-changed-report-2.txt: Likewise.
* tests/data/test-diff-filter/test30-pr18904-rvalueref-report1.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-diff-pkg/dirpkg-3-report-2.txt: Likewise.
* tests/data/test-diff-suppr/test6-fn-suppr-report-0-1.txt: Likewise.
* tests/test-abidiff.cc: Explicitly create a diff context and turn off
location emitting.
* tests/test-diff-dwarf.cc: Likewise.
* tests/test-abicompat.cc: Add --no-show-locs to all existing test
arguments. Run a few of the existing tests again, but without this
option.
* tests/test-diff-filter.cc: Likewise.
* tests/test-diff-pkg.cc: Likewise.
* tests/test-diff-suppr.cc: Likewise.
* tools/abicompat.cc: Handle the new "--no-show-locs" option.
* tools/abidiff.cc: Likewise.
* tools/abidw.cc: Likewise.
* tools/abipkgdiff.cc: Likewise.
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-11-16 09:55:28 +00:00
|
|
|
{ // Just like the previous test, but emit loc info.
|
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-4.8.3.so",
|
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-4.9.2.so",
|
|
|
|
"--no-linkage-name --no-redundant",
|
|
|
|
"data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt",
|
|
|
|
"output/test-diff-filter/test31-pr18535-libstdc++-report-1.txt",
|
|
|
|
},
|
2014-03-29 05:44:13 +00:00
|
|
|
// This should be the last entry
|
|
|
|
{NULL, NULL, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
/// A task which launches abidiff on the binaries passed to the
|
|
|
|
/// constructor of the task. The test also launches gnu diff on the
|
|
|
|
/// result of the abidiff to compare it against a reference abidiff
|
|
|
|
/// result.
|
|
|
|
struct test_task : public abigail::workers::task
|
2014-03-29 05:44:13 +00:00
|
|
|
{
|
2016-01-15 12:34:16 +00:00
|
|
|
InOutSpec spec;
|
|
|
|
bool is_ok;
|
|
|
|
string diff_cmd;
|
|
|
|
string error_message;
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
test_task(const InOutSpec& s)
|
|
|
|
: spec(s),
|
|
|
|
is_ok(true)
|
|
|
|
{}
|
|
|
|
|
|
|
|
/// This virtual function overload actually performs the job of the
|
|
|
|
/// task.
|
|
|
|
///
|
|
|
|
/// It actually launches abidiff on the binaries passed to the
|
|
|
|
/// constructor of the task. It also launches gnu diff on the
|
|
|
|
/// result of the abidiff to compare it against a reference abidiff
|
|
|
|
/// result.
|
|
|
|
virtual void
|
|
|
|
perform()
|
|
|
|
{
|
|
|
|
using abigail::tests::get_src_dir;
|
|
|
|
using abigail::tests::get_build_dir;
|
|
|
|
using abigail::tools_utils::ensure_parent_dir_created;
|
|
|
|
using abigail::tools_utils::abidiff_status;
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
string in_elfv0_path, in_elfv1_path,
|
|
|
|
abidiff_options, abidiff, cmd,
|
|
|
|
ref_diff_report_path, out_diff_report_path;
|
|
|
|
|
|
|
|
in_elfv0_path = string(get_src_dir()) + "/tests/" + spec.in_elfv0_path;
|
|
|
|
in_elfv1_path = string(get_src_dir()) + "/tests/" + spec.in_elfv1_path;
|
|
|
|
abidiff_options = spec.abidiff_options;
|
|
|
|
ref_diff_report_path =
|
|
|
|
string(get_src_dir()) + "/tests/" + spec.in_report_path;
|
|
|
|
out_diff_report_path =
|
|
|
|
string(get_build_dir()) + "/tests/" + spec.out_report_path;
|
|
|
|
|
|
|
|
if (!ensure_parent_dir_created(out_diff_report_path))
|
2014-03-29 05:44:13 +00:00
|
|
|
{
|
2016-01-15 12:34:16 +00:00
|
|
|
error_message = string("could not create parent directory for ")
|
|
|
|
+ out_diff_report_path;
|
|
|
|
is_ok = false;
|
|
|
|
return;
|
|
|
|
}
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
abidiff = string(get_build_dir()) + "/tools/abidiff";
|
|
|
|
abidiff += " " + abidiff_options;
|
|
|
|
|
|
|
|
cmd = abidiff + " " + in_elfv0_path + " " + in_elfv1_path;
|
|
|
|
cmd += " > " + out_diff_report_path;
|
|
|
|
|
|
|
|
bool abidiff_ok = true;
|
|
|
|
abidiff_status status =
|
|
|
|
static_cast<abidiff_status>(system(cmd.c_str()) & 255);
|
|
|
|
if (abigail::tools_utils::abidiff_status_has_error(status))
|
|
|
|
abidiff_ok = false;
|
|
|
|
|
|
|
|
if (abidiff_ok)
|
|
|
|
{
|
|
|
|
cmd = "diff -u " + ref_diff_report_path
|
|
|
|
+ " " + out_diff_report_path;
|
|
|
|
|
|
|
|
string cmd_no_out = cmd + " > /dev/null";
|
|
|
|
if (system(cmd_no_out.c_str()))
|
2014-03-29 05:44:13 +00:00
|
|
|
{
|
|
|
|
is_ok = false;
|
2016-01-15 12:34:16 +00:00
|
|
|
diff_cmd = cmd;
|
2014-03-29 05:44:13 +00:00
|
|
|
}
|
2016-01-15 12:34:16 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
is_ok = false;
|
|
|
|
}
|
|
|
|
}; //end struct test_task.
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
/// A convenience typedef for shared
|
|
|
|
typedef shared_ptr<test_task> test_task_sptr;
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
int
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
using std::vector;
|
|
|
|
using std::tr1::dynamic_pointer_cast;
|
|
|
|
using abigail::workers::queue;
|
|
|
|
using abigail::workers::task;
|
|
|
|
using abigail::workers::task_sptr;
|
|
|
|
using abigail::workers::get_number_of_threads;
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
/// Create a task queue. The max number of worker threads of the
|
|
|
|
/// queue is the number of the concurrent threads supported by the
|
|
|
|
/// processor of the machine this code runs on.
|
|
|
|
const size_t num_tests = sizeof(in_out_specs) / sizeof (InOutSpec) - 1;
|
|
|
|
size_t num_workers = std::min(get_number_of_threads(), num_tests);
|
|
|
|
queue task_queue(num_workers);
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
bool is_ok = true;
|
|
|
|
|
|
|
|
for (InOutSpec* s = in_out_specs; s->in_elfv0_path; ++s)
|
|
|
|
{
|
|
|
|
test_task_sptr t(new test_task(*s));
|
|
|
|
assert(task_queue.schedule_task(t));
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Wait for all worker threads to finish their job, and wind down.
|
|
|
|
task_queue.wait_for_workers_to_complete();
|
|
|
|
|
|
|
|
// Now walk the results and print whatever error messages need to be
|
|
|
|
// printed.
|
|
|
|
|
|
|
|
const vector<task_sptr>& completed_tasks =
|
|
|
|
task_queue.get_completed_tasks();
|
|
|
|
|
|
|
|
assert(completed_tasks.size() == num_tests);
|
|
|
|
|
|
|
|
for (vector<task_sptr>::const_iterator ti = completed_tasks.begin();
|
|
|
|
ti != completed_tasks.end();
|
|
|
|
++ti)
|
|
|
|
{
|
|
|
|
test_task_sptr t = dynamic_pointer_cast<test_task>(*ti);
|
|
|
|
if (!t->is_ok)
|
|
|
|
{
|
2014-03-29 05:44:13 +00:00
|
|
|
is_ok = false;
|
2016-01-15 12:34:16 +00:00
|
|
|
if (!t->diff_cmd.empty())
|
|
|
|
system(t->diff_cmd.c_str());
|
|
|
|
if (!t->error_message.empty())
|
|
|
|
cerr << t->error_message << '\n';
|
|
|
|
}
|
|
|
|
}
|
2014-03-29 05:44:13 +00:00
|
|
|
|
2016-01-15 12:34:16 +00:00
|
|
|
return !is_ok;
|
2014-03-29 05:44:13 +00:00
|
|
|
}
|