File: bug1020818.patch

package info (click to toggle)
abi-dumper 1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 844 kB
  • sloc: perl: 23,061; makefile: 18
file content (161 lines) | stat: -rw-r--r-- 5,075 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Description: abi-dumper 1.2 doesn't work with today's binaries
Author: Andrey Ponomarenko <andrewponomarenko@yandex.ru>
Bug-Debian: https://bugs.debian.org/1020818
Reviewed-by: Mathieu Malaterre <malat@debian.org>
Forwarded: https://github.com/lvc/abi-dumper/commit/16bb467cd7d343dd3a16782b151b56cf15509594

Index: abi-dumper/abi-dumper.pl
===================================================================
--- abi-dumper.orig/abi-dumper.pl
+++ abi-dumper/abi-dumper.pl
@@ -409,6 +409,7 @@ my %TypeType = (
     "subroutine_type"=>"Func",
     "array_type"=>"Array",
     "base_type"=>"Intrinsic",
+    "atomic_type"=>"Intrinsic",
     "unspecified_type"=>"Unspecified",
     "const_type"=>"Const",
     "pointer_type"=>"Pointer",
@@ -944,12 +945,25 @@ sub readAltInfo($)
                 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 +1195,13 @@ sub readDWARFInfo($)
             
             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 +1209,32 @@ sub readDWARFInfo($)
         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 +1255,8 @@ sub readDWARFInfo($)
         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 +1265,14 @@ sub readDWARFInfo($)
         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);
     
@@ -1611,7 +1650,7 @@ sub readDWARFDump($$)
                             $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+|)/)
@@ -4278,9 +4317,12 @@ sub setSource(@)
     
     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 +4334,10 @@ sub setSource(@)
         { # imported
             $Name = $SourceFile_Alt{0}{$File};
         }
+
+        if(not $Name) {
+            $Name = $InfoName;
+        }
         
         if($Name=~/\.($HEADER_EXT)\Z/i
         or index($Name, ".")==-1)