From 86b503bd85e3a0e8b32616d5af67c7d176a6263e Mon Sep 17 00:00:00 2001 From: Andrey Ponomarenko Date: Fri, 11 Dec 2015 23:40:03 +0300 Subject: Fixed false positives in the report if input ABI dumps contain __unknown__ types. --- INSTALL | 77 ++++++++++++++++++++++++----------------------- abi-compliance-checker.pl | 33 +++++++++++++++++++- doc/Changelog.html | 8 ++++- doc/index.html | 2 +- 4 files changed, 80 insertions(+), 40 deletions(-) diff --git a/INSTALL b/INSTALL index c402723..a446c6c 100644 --- a/INSTALL +++ b/INSTALL @@ -9,8 +9,8 @@ All rights reserved. RELEASE INFORMATION Project: ABI Compliance Checker (ACC) -Version: 1.99.14.2 -Date: 2015-11-12 +Version: 1.99.15 +Date: 2015-12-11 This file explains how to install and setup environment @@ -22,8 +22,8 @@ Content: 1. Requirements for Linux and FreeBSD 2. Requirements for Mac OS X 3. Requirements for MS Windows - 4. Configuring and Installing - 5. Running the Tool + 4. Configure and Install + 5. Usage 6. Usage with ABI Dumper @@ -62,8 +62,8 @@ Content: -4. CONFIGURING AND INSTALLING -============================= +4. CONFIGURE AND INSTALL +======================== This command will install the abi-compliance-checker program into the PREFIX/bin system directory and private modules into the PREFIX/share: @@ -76,48 +76,51 @@ Content: -5. RUNNING THE TOOL -=================== +5. USAGE +======== - 1. Create XML-descriptors for two versions - of a library (OLD.xml and NEW.xml): + Create XML-descriptors for two versions + of a library (OLD.xml and NEW.xml): - - 1.0 - + + 1.0 + - - /path1/to/header(s)/ - /path2/to/header(s)/ - ... - + + /path1/to/header(s)/ + /path2/to/header(s)/ + ... + - - /path1/to/library(ies)/ - /path2/to/library(ies)/ - ... - + + /path1/to/library(ies)/ + /path2/to/library(ies)/ + ... + - 2. abi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml - 3. For advanced usage, see doc/Readme.html or --help option + Check compatibility: + + abi-compliance-checker -lib NAME -old OLD.xml -new NEW.xml + + For advanced usage, see doc/Readme.html or --help option. 6. USAGE WITH ABI DUMPER ======================== - 1. Library should be compiled with -g - option to contain DWARF debug info - - 2. Create ABI dumps for both library versions - using the ABI Dumper tool (https://github.com/lvc/abi-dumper): - - abi-dumper OLD.so -o ABI-0.dump -lver 0 - abi-dumper NEW.so -o ABI-1.dump -lver 1 - - 3. Compare ABI dumps: - - abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump + Library should be compiled with -g + option to contain DWARF debug info. + + Create ABI dumps for both library versions + using the ABI Dumper tool (https://github.com/lvc/abi-dumper): + + abi-dumper OLD.so -o ABI-0.dump -lver 0 + abi-dumper NEW.so -o ABI-1.dump -lver 1 + + Compare ABI dumps: + + abi-compliance-checker -l NAME -old ABI-0.dump -new ABI-1.dump Enjoy! diff --git a/abi-compliance-checker.pl b/abi-compliance-checker.pl index e9a1c2b..6366088 100644 --- a/abi-compliance-checker.pl +++ b/abi-compliance-checker.pl @@ -11406,7 +11406,7 @@ sub mergeTypes($$$) my ($Type1_Id, $Type2_Id, $Level) = @_; return {} if(not $Type1_Id or not $Type2_Id); - if($Cache{"mergeTypes"}{$Level}{$Type1_Id}{$Type2_Id}) + if(defined $Cache{"mergeTypes"}{$Level}{$Type1_Id}{$Type2_Id}) { # already merged return $Cache{"mergeTypes"}{$Level}{$Type1_Id}{$Type2_Id}; } @@ -11423,6 +11423,15 @@ sub mergeTypes($$$) $CheckedTypes{$Level}{$Type1_Pure{"Name"}} = 1; + if(defined $UsedDump{1}{"DWARF"}) + { + if($Type1_Pure{"Name"} eq "__unknown__" + or $Type2_Pure{"Name"} eq "__unknown__") + { # Error ABI dump + return ($Cache{"mergeTypes"}{$Level}{$Type1_Id}{$Type2_Id} = {}); + } + } + my %SubProblems = (); if($Type1_Pure{"Name"} eq $Type2_Pure{"Name"}) @@ -11535,6 +11544,16 @@ sub mergeTypes($$$) } my %Base1_Pure = get_PureType($Base_1{"Tid"}, $TypeInfo{1}); my %Base2_Pure = get_PureType($Base_2{"Tid"}, $TypeInfo{2}); + + if(defined $UsedDump{1}{"DWARF"}) + { + if($Base1_Pure{"Name"}=~/\b__unknown__\b/ + or $Base2_Pure{"Name"}=~/\b__unknown__\b/) + { # Error ABI dump + return ($Cache{"mergeTypes"}{$Level}{$Type1_Id}{$Type2_Id} = {}); + } + } + if(tNameLock($Base_1{"Tid"}, $Base_2{"Tid"})) { if(diffTypes($Base1_Pure{"Tid"}, $Base2_Pure{"Tid"}, $Level)) @@ -14600,9 +14619,21 @@ sub detectTypeChange($$$$) my %Type2 = get_Type($Type2_Id, 2); my %Type1_Pure = get_PureType($Type1_Id, $TypeInfo{1}); my %Type2_Pure = get_PureType($Type2_Id, $TypeInfo{2}); + my %Type1_Base = ($Type1_Pure{"Type"} eq "Array")?get_OneStep_BaseType($Type1_Pure{"Tid"}, $TypeInfo{1}):get_BaseType($Type1_Id, 1); my %Type2_Base = ($Type2_Pure{"Type"} eq "Array")?get_OneStep_BaseType($Type2_Pure{"Tid"}, $TypeInfo{2}):get_BaseType($Type2_Id, 2); + if(defined $UsedDump{1}{"DWARF"}) + { + if($Type1_Pure{"Name"} eq "__unknown__" + or $Type2_Pure{"Name"} eq "__unknown__" + or $Type1_Base{"Name"} eq "__unknown__" + or $Type2_Base{"Name"} eq "__unknown__") + { # Error ABI dump + return (); + } + } + my $Type1_PLevel = get_PLevel($Type1_Id, 1); my $Type2_PLevel = get_PLevel($Type2_Id, 2); return () if(not $Type1{"Name"} or not $Type2{"Name"}); diff --git a/doc/Changelog.html b/doc/Changelog.html index b7c3f92..6ff72a6 100644 --- a/doc/Changelog.html +++ b/doc/Changelog.html @@ -44,12 +44,18 @@


-Version 1.99.14.1 (November 11, 2015)
+Version 1.99.15 (December 11, 2015)
Bug Fixes


diff --git a/doc/index.html b/doc/index.html index 56b377e..cbe6f55 100644 --- a/doc/index.html +++ b/doc/index.html @@ -94,7 +94,7 @@

Downloads

All releases can be downloaded from this page.

-

Latest release: abi-compliance-checker-1.99.14.1.tar.gz

+

Latest release: abi-compliance-checker-1.99.15.tar.gz

Read-only access to the latest development version:

-- cgit v1.2.3