[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#668437: lintian: Identify -dbg packages that have binaries with no debugging symbols



On 2012-04-11 22:37, Nelson A. de Oliveira wrote:
> Package: lintian
> Version: 2.5.6
> Severity: wishlist
> 
> Hi!
> 
> Using #652099 as an example, we have a source package that has a -dbg
> binary package, with files located under /usr/lib/debug/ as they should
> be but with one problem: there are no debugging symbols.
> 
> Could lintian do a new check against the binaries in a -dbg package to
> see if they indeed have the proper debugging symbols?
> 

Hi,

It might be possible to do...

> Something like doing a "nm -a $file | cut -b 18" and grepping for "N"
> If no N is found then we have a file with missing symbols and a warning
> about this.
> 

Did you by chance mean "cut -b 8" or so.  By the looks of it 18 cuts
into the symbol/section/$something name.  I assume the "N" you are
talking about would be:

         |
         v
00000000 N .debug_abbrev
00000000 N .debug_aranges
00000000 N .debug_frame
00000000 N .debug_info
00000000 N .debug_line
00000000 N .debug_loc
00000000 N .debug_pubnames
00000000 N .debug_str
         ^
         |

> (I don't know if nm + cut + grep is the best way to test for debugging symbols, but
> it seems to do the job)
> 
> Thank you!
> 
> Best regards,
> Nelson
> 
> [...]


If so, we should be able to simply check for the presence of any section
starting with ".debug_" (or maybe just ".debug_line", which supposedly
holds the line number mappings)[1].

~Niels

[1] Ref: http://www.dwarfstd.org/doc/Debugging%20using%20DWARF.pdf

(see "ELF sections" on page 9)


Reply to: