diff options
author | Andrey Ponomarenko <andrewponomarenko@yandex.ru> | 2016-08-24 19:07:11 +0300 |
---|---|---|
committer | Andrey Ponomarenko <andrewponomarenko@yandex.ru> | 2016-08-24 19:07:11 +0300 |
commit | 40629637d392a2db3e28e167f9022d965cb3b906 (patch) | |
tree | 8dea85d0758f4775fb5673e1f3f90498dffefea6 | |
parent | 0e9c78aa998d063f044ccb6dd794229458296a0b (diff) | |
download | abi-dumper-40629637d392a2db3e28e167f9022d965cb3b906.tar.gz |
Improved search for linked debug-info files. Added more debug messages.
-rw-r--r-- | abi-dumper.pl | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/abi-dumper.pl b/abi-dumper.pl index cc00772..351223c 100644 --- a/abi-dumper.pl +++ b/abi-dumper.pl @@ -977,44 +977,47 @@ sub read_DWARF_Info($) my $DPath = $DebugFile; my $DName = getFilename($DPath); + printMsg("INFO", "Found gnu_debuglink to $DName"); + if(my $DDir = getDirname($Path)) { $DPath = $DDir."/".$DPath; } my $Found = undef; + if(defined $SearchDirDebuginfo) { - my @Files = findFiles($SearchDirDebuginfo, "f"); - - foreach my $F (@Files) + if(-f $SearchDirDebuginfo."/".$DName) { + $Found = $SearchDirDebuginfo."/".$DName; + } + else { - if(getFilename($F) eq $DName) + my @Files = findFiles($SearchDirDebuginfo, "f"); + + foreach my $F (@Files) { - $Found = $F; - last; + if(getFilename($F) eq $DName) + { + $Found = $F; + last; + } } } } - - if($Found) - { - $DPath = $Found; - printMsg("INFO", "Found debuginfo $DName (gnu_debuglink)"); + elsif(-f $DPath + and $DPath ne $Path) { + $Found = $DPath; } - if($DPath ne $Path) + if($Found and $Found ne $Path) { - if(-e $DPath) - { - printMsg("INFO", "Reading debuginfo $DName (gnu_debuglink)"); - return read_DWARF_Info($DPath); - } - else { - printMsg("WARNING", "missed debuginfo $DName (gnu_debuglink)"); - } + printMsg("INFO", "Reading debug-info file $DName (gnu_debuglink)"); + return read_DWARF_Info($Found); } - else { + else + { + printMsg("WARNING", "missed debug-info file $DName (gnu_debuglink)"); return 0; } } |