libabigail/src
Giuliano Procida d5576ba30a Fix decl_base comparison function
When two decl_base ojects are compared, there are both fast and slow
paths to the name comparison. The latter is roughly equivalent to
comparing names after applying the regex
s/(__anonymous_(?:struct|union|enum)__)\d+/\1/g to the names before
comparing them while the former is a straight string comparison with
some tweaks for detecting anonymous types.

The slow path is taken care of by the helper function
tools_utils::decl_names_equal but unfortunately, there is a missing
negation of the returned bool. This commit fixes this and updates the
few affected tests.

Rather than just adding a '!', this commit replaces the negative
decls_are_different with a positive decls_are_same. I spent far too
long staring at the code before I spotted the mistake and having
positively-named things improves readability.

The same helper function is also called by has_harmless_name_change
and that should be reviewed as well.

	* src/abg-ir.cc (equals): In the decl_base overload, note that
	the value returned by decl_names_equal should be negated and
	replace decls_are_different with decls_are_same, negating all
	occurrences.
	* tests/data/test-diff-dwarf/PR25058-liblttng-ctl-report-1.txt:
	Update tests, removing some spurious anonymous union name change.
	* tests/data/test-diff-filter/test33-report-0.txt: Diff now
	completely empty.
	* tests/data/test-diff-pkg/elfutils-libs-0.170-4.el7.x86_64-multiple-sym-vers-report-0.txt:
	3 functions previously considered to have harmless changes are
	now deemed to have no changes.
	* tests/data/test-diff-pkg/spice-server-0.12.4-19.el7.x86_64-0.12.8-1.el7.x86_64-report-2.txt:
	1 struct RedStore data member previously considered to have
	harmless changes is now deemed to have no changes.
	* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi:
	One instance of an anonymous struct removed and a typedef
	repointed at another existing instance; many type ids
	renumbered.

Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-08-04 17:07:24 +02:00
..
abg-comp-filter.cc Simplify peel_typedef_pointer_or_reference_type 2020-07-27 15:26:27 +02:00
abg-comparison-priv.h cleanup: std::weak_ptr use: replace manual lock by std::weak_ptr::lock 2020-06-17 09:54:01 +02:00
abg-comparison.cc Remove unused is_reference_or_pointer_diff. 2020-07-27 15:26:04 +02:00
abg-config.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-corpus-priv.h Use regex::match wrapper instead of regexec. 2020-05-12 18:33:27 +02:00
abg-corpus.cc Tidy #includes in a few files. 2020-05-11 15:21:46 +02:00
abg-default-reporter.cc Fix corpus_diff::has_net_changes for --leaf-changes-only mode 2020-07-21 08:53:19 +02:00
abg-diff-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-dwarf-reader.cc Bug 26261 - Fix logic for canonicalizing DW_TAG_subroutine_type DIEs 2020-08-03 11:41:08 +02:00
abg-elf-helpers.cc Eliminate non-ASCII characters. 2020-06-15 10:56:44 +02:00
abg-elf-helpers.h abg-elf-helpers: migrate maybe_adjust_et_rel_sym_addr_to_abs_addr 2020-04-22 11:40:02 +02:00
abg-hash.cc Support incomplete enums in core and diff code. 2020-07-08 16:59:56 +02:00
abg-ini.cc Eliminate non-ASCII characters. 2020-06-15 10:56:44 +02:00
abg-internal.h Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-ir-priv.h Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-ir.cc Fix decl_base comparison function 2020-08-04 17:07:24 +02:00
abg-leaf-reporter.cc Fix corpus_diff::has_net_changes for --leaf-changes-only mode 2020-07-21 08:53:19 +02:00
abg-libxml-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-libzip-utils.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-reader.cc reader: Remove useless support for WIP types 2020-07-09 14:44:57 +02:00
abg-regex.cc Add POSIX regex wrapper functions. 2020-05-11 18:30:44 +02:00
abg-reporter-priv.cc reporter: Fix report whitespace typos. 2020-07-10 15:09:33 +02:00
abg-reporter-priv.h Bug 25661 - Support data member replacement by anonymous data member 2020-05-18 13:42:50 +02:00
abg-suppression-priv.h Use regex::match wrapper instead of regexec. 2020-05-12 18:33:27 +02:00
abg-suppression.cc Refactor read_parameter_spec_from_string logic. 2020-05-13 09:49:25 +02:00
abg-tools-utils.cc Make decl_names_equal more accurate 2020-08-04 14:51:13 +02:00
abg-traverse.cc Pimpl-ify traversable_base and remove its unused traverse method 2020-07-27 17:50:50 +02:00
abg-viz-common.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-viz-dot.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-viz-svg.cc Update copyright year to 2020 2020-02-21 17:05:01 +01:00
abg-workers.cc abg-workers: guard bring_workers_down to avoid dead lock 2020-03-18 13:51:56 +01:00
abg-writer.cc abg-writer.cc: Fix indentation of XML output 2020-07-28 17:07:03 +02:00
Makefile.am Move regex definitions to own files. 2020-05-04 11:15:23 +02:00