Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package abi-dumper for openSUSE:Factory checked in at 2025-01-13 17:53:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/abi-dumper (Old) and /work/SRC/openSUSE:Factory/.abi-dumper.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "abi-dumper" Mon Jan 13 17:53:46 2025 rev:6 rq:1237517 version:1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/abi-dumper/abi-dumper.changes 2021-01-06 19:56:46.381113372 +0100 +++ /work/SRC/openSUSE:Factory/.abi-dumper.new.1881/abi-dumper.changes 2025-01-13 17:53:51.647882941 +0100 @@ -1,0 +2,10 @@ +Mon Jan 13 14:59:48 UTC 2025 - Michael Vetter <mvet...@suse.com> + +- Update to 1.4: + * fix: handle data_member_location == 2^64-1 #28 + * fixed symbol search sentence judgment + * Fix usage notes in readme + * Fix usage notes in readme + * Add -extra-dump option to dump more symbols info (for new ABI Viewer tool) + +------------------------------------------------------------------- Old: ---- abi-dumper-1.2.tar.gz New: ---- abi-dumper-1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ abi-dumper.spec ++++++ --- /var/tmp/diff_new_pack.8PitGN/_old 2025-01-13 17:53:53.039940482 +0100 +++ /var/tmp/diff_new_pack.8PitGN/_new 2025-01-13 17:53:53.055941144 +0100 @@ -1,7 +1,7 @@ # # spec file for package abi-dumper # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: abi-dumper -Version: 1.2 +Version: 1.4 Release: 0 Summary: Tool to dump ABI of an ELF object containing DWARF debug info License: LGPL-2.1-or-later ++++++ abi-dumper-1.2.tar.gz -> abi-dumper-1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.2/INSTALL new/abi-dumper-1.4/INSTALL --- old/abi-dumper-1.2/INSTALL 2020-11-20 08:55:42.000000000 +0100 +++ new/abi-dumper-1.4/INSTALL 2025-01-11 19:39:00.000000000 +0100 @@ -1,13 +1,13 @@ -Copyright (C) 2013-2017 Andrey Ponomarenko's ABI Laboratory +Copyright (C) 2013-2025 Andrey Ponomarenko's ABI Laboratory All rights reserved. RELEASE INFORMATION Project: ABI Dumper -Version: 1.1 -Date: August 30, 2017 +Version: 1.4 +Date: Jan 11, 2025 This file explains how to install and setup environment diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.2/README.md new/abi-dumper-1.4/README.md --- old/abi-dumper-1.2/README.md 2020-11-20 08:55:42.000000000 +0100 +++ new/abi-dumper-1.4/README.md 2025-01-11 19:39:00.000000000 +0100 @@ -1,4 +1,4 @@ -ABI Dumper 1.2 +ABI Dumper 1.4 ============== ABI Dumper â a tool to dump ABI of an ELF object containing DWARF debug info. @@ -38,7 +38,7 @@ Usage ----- -Input objects should be compiled with `-g -Og` additional options to contain DWARF debug info. +Input objects should be compiled with `-g -Og -fno-eliminate-unused-debug-types` additional options to contain DWARF debug info. abi-dumper libTest.so -o ABI.dump abi-dumper Module.ko.debug diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/abi-dumper-1.2/abi-dumper.pl new/abi-dumper-1.4/abi-dumper.pl --- old/abi-dumper-1.2/abi-dumper.pl 2020-11-20 08:55:42.000000000 +0100 +++ new/abi-dumper-1.4/abi-dumper.pl 2025-01-11 19:39:00.000000000 +0100 @@ -1,9 +1,9 @@ #!/usr/bin/perl ########################################################################### -# ABI Dumper 1.2 +# ABI Dumper 1.3 # Dump ABI of an ELF object containing DWARF debug info # -# Copyright (C) 2013-2020 Andrey Ponomarenko's ABI Laboratory +# Copyright (C) 2013-2025 Andrey Ponomarenko's ABI Laboratory # # Written by Andrey Ponomarenko # @@ -22,6 +22,7 @@ # # COMPATIBILITY # ============= +# ABI Viewer >= 1.0 # ABI Compliance Checker >= 2.2 # # This library is free software; you can redistribute it and/or @@ -47,7 +48,7 @@ use Storable qw(dclone); use Data::Dumper; -my $TOOL_VERSION = "1.2"; +my $TOOL_VERSION = "1.4"; my $ABI_DUMP_VERSION = "3.5"; my $ORIG_DIR = cwd(); my $TMP_DIR = tempdir(CLEANUP=>1); @@ -70,7 +71,7 @@ $IgnoreTagsPath, @CtagsDef, $KernelExport, $UseTU, $ReimplementStd, $IncludePreamble, $IncludePaths, $CacheHeaders, $MixedHeaders, $Debug, $SearchDirDebuginfo, $KeepRegsAndOffsets, $Quiet, $IncludeDefines, -$AllUnits, $LambdaSupport, $LdLibraryPath); +$AllUnits, $LambdaSupport, $LdLibraryPath, $ExtraDump); my $CmdName = getFilename($0); @@ -91,9 +92,9 @@ "No_Exported"=>12 ); -my $ShortUsage = "ABI Dumper $TOOL_VERSION +my $ShortUsage = "ABI Dumper $TOOL_VERSION EE Dump ABI of an ELF object containing DWARF debug info -Copyright (C) 2019 Andrey Ponomarenko's ABI Laboratory +Copyright (C) 2025 Andrey Ponomarenko's ABI Laboratory License: GNU LGPL 2.1 Usage: $CmdName [options] [object] @@ -150,6 +151,7 @@ "ld-library-path=s" => \$LdLibraryPath, # internal options "addr2name!" => \$AddrToName, + "extra-dump!" => \$ExtraDump, # obsolete "reimplement-std!" => \$ReimplementStd ) or errMsg(); @@ -162,14 +164,14 @@ my $HelpMessage=" NAME: - ABI Dumper ($CmdName) + ABI Dumper EE ($CmdName) Dump ABI of an ELF object containing DWARF debug info DESCRIPTION: ABI Dumper is a tool for dumping ABI information of an ELF object containing DWARF debug info. - The tool is intended to be used with ABI Compliance Checker tool for + The tool is intended to be used with ABI Viewer or ABICC tool for tracking ABI changes of a C/C++ library or kernel module. This tool is free software: you can redistribute it and/or modify it @@ -409,6 +411,7 @@ "subroutine_type"=>"Func", "array_type"=>"Array", "base_type"=>"Intrinsic", + "atomic_type"=>"Intrinsic", "unspecified_type"=>"Unspecified", "const_type"=>"Const", "pointer_type"=>"Pointer", @@ -448,11 +451,18 @@ my %SymbolTable; my %Symbol_Bind; +# Extra Dump +my %SymbolAttribute; +my $GLOBAL_ID_T = 0; +my %FullLoc = (); + # Kernel my %KSymTab; # VTables my %VirtualTable; +my %VTable_Symbol; +my %VTable_Class; # Env my $SYS_ARCH; @@ -757,7 +767,7 @@ if(my ($Value, $Size, $Type, $Bind, $Vis, $Ndx, $Symbol) = readline_ELF($_)) { # read ELF entry $Symbol_Bind{$Symbol} = $Bind; - if(index($Symbol, '@')) + if(index($Symbol, '@')!=-1) { if($Symbol=~/\A(.+?)\@/) { $Symbol_Bind{$1} = $Bind; @@ -808,6 +818,18 @@ { $Symbol_Value{$Symbol} = $Value; $Value_Symbol{$Value}{$Symbol} = 1; + + if(defined $ExtraDump) + { + $SymbolAttribute{$Symbol} = { + "Val" => $Value, + "Size" => $Size, + "Kind" => $Type, + "Bind" => $Bind, + "Vis" => $Vis, + "Ndx" => $Ndx + }; + } } if(not $symtab) @@ -944,12 +966,25 @@ if(/\A\s*(.+?)\Z/) { $DirTable{keys(%DirTable)+1} = $1; } + elsif(/\A\s*(\d+)\s+(.+?)\s+\(\d+\)\Z/) + { # F34 + $DirTable{$1} = $2; + } } } - if(/(\d+)\s+(\d+)\s+\d+\s+\d+\s+([^ ]+)/) + my ($Num, $Dir, $File) = (); + + if(/(\d+)\s+(\d+)\s+\d+\s+\d+\s+([^ ]+)/) { + ($Num, $Dir, $File) = ($1, $2, $3) + } + elsif(/(\d+)\s+([^ ]+)\s+\(\d+\)\,\s+(\d+)/) + { # F34 + ($Num, $File, $Dir) = ($1, $2, $3); + } + + if($File) { - my ($Num, $Dir, $File) = ($1, $2, $3); chomp($File); if(defined $AddDirs) @@ -1181,9 +1216,13 @@ if(defined $DirTable_Def) { - if(/\A\s*(.+?)\Z/) { + if(/\A\s*([^\[\]\(\)]+?)\Z/) { $DirTable{keys(%DirTable)+1} = $1; } + elsif(/\A\s*(\d+)\s+(.+?)\s+\(\d+\)\Z/) + { # F34 + $DirTable{$1} = $2; + } } } @@ -1191,21 +1230,32 @@ and /Table at offset (\w+)/) { $Offset = $1; } - elsif(defined $Offset - and /(\d+)\s+(\d+)\s+\d+\s+\d+\s+([^ ]+)/) + elsif(defined $Offset) { - my ($Num, $Dir, $File) = ($1, $2, $3); - chomp($File); + my ($Num, $Dir, $File) = (); - if(defined $AddDirs) + if(/(\d+)\s+(\d+)\s+\d+\s+\d+\s+([^ ]+)/) { + ($Num, $Dir, $File) = ($1, $2, $3); + } + elsif(/(\d+)\s+([^ ]+)\s+\(\d+\)\,\s+(\d+)/) + { # F34 + ($Num, $File, $Dir) = ($1, $2, $3); + } + + if($File) { - if(my $DName = $DirTable{$Dir}) + chomp($File); + + if(defined $AddDirs) { - $File = $DName."/".$File; + if(my $DName = $DirTable{$Dir}) + { + $File = $DName."/".$File; + } } + + $SourceFile{$Offset}{$Num} = $File; } - - $SourceFile{$Offset}{$Num} = $File; } } close(SRC); @@ -1226,6 +1276,8 @@ open(LOC, $EU_READELF_L." $AddOpt --debug-dump=loc \"$Path\" 2>\"$TMP_DIR/error\" |"); } + my $Offset = undef; + while(<LOC>) { if(/\A \[\s*(\w+)\].*\[\s*\w+\]\s*(.+)\Z/) { @@ -1234,6 +1286,14 @@ elsif(/\A \[\s*(\w+)\]/) { $DebugLoc{$1} = ""; } + elsif(/Offset:\s+(.+?),/) + { # F34 + $Offset = $1; + } + elsif($Offset and /\A\s+\[\s*\w+\]\s*(.+)\Z/) + { # F34 + $DebugLoc{$Offset} = $1; + } } close(LOC); @@ -1483,19 +1543,31 @@ { if($Val=~/\)\s*\Z/) { # value on the next line - $Val .= <$FH>; + my $NL = <$FH>; + $Val .= $NL; + + if(defined $ExtraDump) + { + if($NL=~/\A\s{4,}\[\s*(\w+)\]\s*(piece \d+|\w+)/) + { + $FullLoc{$ID}{$1} = $2; + } + } if(index($Val, "GNU_entry_value")!=-1) { # value on the next line - $Val .= <$FH>; + $NL = <$FH>; + $Val .= $NL; } } if($Val=~/\A\(\w+\)\s*(-?)(\w+)\Z/) { # (data1) 1c - $Val = hex($2); - if($1) { - $Val = -$Val; + if ($2 != 0xFFFFFFFFFFFFFFFF) { + $Val = hex($2); + if($1) { + $Val = -$Val; + } } } else @@ -1611,7 +1683,7 @@ $Val=~s/\A\"//; $Val=~s/\"\Z//; - if($Val=~/GNU\s+(C\d*|C\+\+|GIMPLE)\s+(.+)\Z/) + if($Val=~/GNU\s+(C\d*|C\+\+\d*|GIMPLE)\s+(.+)\Z/) { $SYS_GCCV = $2; if($SYS_GCCV=~/\A(\d+\.\d+)(\.\d+|)/) @@ -1676,6 +1748,10 @@ } } } + elsif(defined $ExtraDump and $Line=~/\A\s{4,}\[\s*(\w+)\]\s*(piece \d+|\w+)/) + { + $FullLoc{$ID}{$1} = $2; + } elsif($Line=~/\A \[\s*(\w+)\](\s*)(\w+)/) { $ID = hex($1); @@ -1941,6 +2017,15 @@ $VirtualTable{$CName}{$1} = $2; } } + + if(defined $ExtraDump) + { + if($Entries[0]=~/\A(\w+)\:/) + { + $VTable_Symbol{$CName} = $1; + $VTable_Class{$1} = $CName; + } + } } } } @@ -1953,7 +2038,14 @@ { my $TName = $TypeInfo{$Tid}{"Name"}; $TName=~s/\bstruct //g; - if(defined $VirtualTable{$TName}) { + if(defined $VirtualTable{$TName}) + { + $TypeInfo{$Tid}{"VTable"} = $VirtualTable{$TName}; + + if(defined $ExtraDump) + { + $TypeInfo{$Tid}{"VTable_Sym"} = $VTable_Symbol{$TName}; + } $TypeInfo{$Tid}{"VTable"} = $VirtualTable{$TName}; } } @@ -2022,7 +2114,11 @@ else { $ABI{"Compiler"} = $SYS_COMP; } - + + if(defined $ExtraDump) { + $ABI{"ExtraDump"} = "On"; + } + if(defined $PublicHeadersPath) { $ABI{"PublicABI"} = "1"; } @@ -2533,6 +2629,14 @@ $SelectedSymbols{$ID} = $S; delete($SymbolInfo{$ID}{"External"}); + + # add attributes + if(defined $ExtraDump) + { + foreach my $Attr (keys(%{$SymbolAttribute{$Symbol}})) { + $SymbolInfo{$ID}{$Attr} = $SymbolAttribute{$Symbol}{$Attr}; + } + } } } @@ -2849,7 +2953,10 @@ if(not defined $SInfo->{"Param"} or $SInfo->{"Param"}{0}{"name"} ne "this") { - $SInfo->{"Static"} = 1; + if(not $ExtraDump or index($Symbol, "_ZTV")!=0) + { + $SInfo->{"Static"} = 1; + } } } @@ -3026,7 +3133,15 @@ sub selectPublic($$) { my ($Symbol, $ID) = @_; - + + if($ExtraDump) + { + if(index($Symbol, "_ZTV")==0) + { + return 1; + } + } + my $Header = getFilename($SymbolInfo{$ID}{"Header"}); if($OBJ_LANG eq "C++") { @@ -3066,6 +3181,49 @@ return 1; } +sub add_VtableSymbols() +{ + foreach my $Symbol (sort {lc($a) cmp lc($b)} keys(%VTable_Class)) + { + my $CName = $VTable_Class{$Symbol}; + my $ID = ++$GLOBAL_ID; + + $SymbolInfo{$ID}{"MnglName"} = $Symbol; + + # TODO: move VTable attr from TypeInfo to SymbolInfo + + if(not defined $TName_Tid{"Class"}{$CName} + and not defined $TName_Tid{"Struct"}{$CName}) + { # create class + my $ID_T = ++$GLOBAL_ID_T; + + $TName_Tid{"Class"}{$CName} = $ID_T; + + $TypeInfo{$ID_T}{"Type"} = "Class"; + $TypeInfo{$ID_T}{"Name"} = $CName; + + if($CName=~/\A([\w\:]+)\:\:/) { + $TypeInfo{$ID_T}{"NameSpace"} = $1; + } + + if(defined $VirtualTable{$CName}) { + %{$TypeInfo{$ID_T}{"VTable"}} = %{$VirtualTable{$CName}}; + } + } + + if(defined $TName_Tid{"Class"}{$CName}) { + $SymbolInfo{$ID}{"Class"} = $TName_Tid{"Class"}{$CName}; + } + elsif(defined $TName_Tid{"Struct"}{$CName}) { + $SymbolInfo{$ID}{"Class"} = $TName_Tid{"Struct"}{$CName}; + } + + foreach my $Attr (keys(%{$SymbolAttribute{$Symbol}})) { + $SymbolInfo{$ID}{$Attr} = $SymbolAttribute{$Symbol}{$Attr}; + } + } +} + sub cloneSymbol($$) { my ($ID, $Symbol) = @_; @@ -4157,7 +4315,14 @@ $TypeSpec{$ID} = $BASE_ID; } - + + if(defined $ExtraDump) + { + if($ID>$GLOBAL_ID_T) { + $GLOBAL_ID_T = $ID; + } + } + # remove duplicates my $DId = undef; @@ -4278,9 +4443,12 @@ if(defined $File) { + my $InfoName = undef; if(index($File, "(")!=-1) { # Support for new elfutils (Fedora 30) - $File=~s/.+ \((\d+)\)/$1/; + if($File=~s/\A(.+?)\s+\((\d+)\)/$1/) { + $InfoName = $1; + } } my $Name = undef; @@ -4292,6 +4460,10 @@ { # imported $Name = $SourceFile_Alt{0}{$File}; } + + if(not $Name) { + $Name = $InfoName; + } if($Name=~/\.($HEADER_EXT)\Z/i or index($Name, ".")==-1) @@ -4926,7 +5098,7 @@ { my $ParamId = $FuncParam{$ID}{$Pos}; my $Offset = undef; - my $Reg = undef; + my %Regs = (); if(my $Sp = $SpecElem{$ID}) { @@ -4938,15 +5110,12 @@ if((my $Loc = $DWARF_Info{$ParamId}{"location"}) ne "") { $Offset = $Loc; } - elsif((my $R = $DWARF_Info{$ParamId}{"register"}) ne "") { - $Reg = $RegName{$R}; - } elsif((my $LL = $DWARF_Info{$ParamId}{"location_list"}) ne "") { if(my $L = $DebugLoc{$LL}) { if($L=~/reg(\d+)/) { - $Reg = $RegName{$1}; + $Regs{0} = $RegName{$1}; } elsif($L=~/fbreg\s+(-?\w+)\Z/) { $Offset = $1; @@ -4961,6 +5130,35 @@ } } } + elsif(defined $ExtraDump) + { + my $Piece = 0; + foreach my $P (sort {int($a)<=>int($b)} keys(%{$FullLoc{$ParamId}})) + { + my $L = $FullLoc{$ParamId}{$P}; + + if($L=~/piece (\d+)/) { + $Piece = $1; + } + elsif($L=~/stack_value/) + { + # Nothing to do + } + elsif($L=~/reg(\d+)/) + { + $Regs{$Piece} = $RegName{$1}; + } + else + { + # Error + } + } + } + elsif(defined $DWARF_Info{$ParamId}{"register"}) + { + my $R = $DWARF_Info{$ParamId}{"register"}; + $Regs{0} = $RegName{$R}; + } if(my $OrigP = $DWARF_Info{$ParamId}{"orig"}) { $ParamId = $OrigP; @@ -5014,10 +5212,26 @@ $SInfo{"Param"}{$Pos}{"name"} = "p".($PPos+1); } - if(defined $Reg + if(my @R = keys(%Regs) and not defined $IncompatibleOpt) { - $SInfo{"Reg"}{$Pos} = $Reg; + if(defined $ExtraDump) + { + # FIXME: 0+8, 1+16, etc. (for partially distributed parameters) + foreach my $RP (@R) + { + my $O = $Pos; + if($RP) { + $O .= "+".$RP; + } + + $SInfo{"Reg"}{$O} = $Regs{$RP}; + } + } + else + { + $SInfo{"Reg"}{$Pos} = $Regs{$R[0]}; + } } if($DWARF_Info{$ParamId}{"art"} and $Pos==0) @@ -6510,8 +6724,8 @@ } if($ShowVersion) { - printMsg("INFO", "ABI Dumper $TOOL_VERSION"); - printMsg("INFO", "Copyright (C) 2019 Andrey Ponomarenko's ABI Laboratory"); + printMsg("INFO", "ABI Dumper $TOOL_VERSION EE"); + printMsg("INFO", "Copyright (C) 2025 Andrey Ponomarenko's ABI Laboratory"); printMsg("INFO", "License: GNU LGPL 2.1 <http://www.gnu.org/licenses/>"); printMsg("INFO", "This program is free software: you can redistribute it and/or modify it.\n"); printMsg("INFO", "Written by Andrey Ponomarenko."); @@ -6717,7 +6931,15 @@ if(not $Res) { exitStatus("No_DWARF", "can't find debug info in object(s)"); } - + + if(defined $ExtraDump) + { # add v-table symbols + add_VtableSymbols(); + } + + %VTable_Symbol = (); + %VTable_Class = (); + %VirtualTable = (); completeABI(); @@ -6783,7 +7005,9 @@ %TName_Tid = (); %TName_Tids = (); %SymbolTable = (); - + + %SymbolAttribute = (); + %NameSpace = (); %DeletedAnon = ();