addr2line, when used with options -f and -p combined, does not output a single line for unknown symbols. Instead, it outputs two lines: ?? ??:0 Which is in contrast with the output of other symbols (in a single line). The man page does not precisely define this behavior: "If the -p option is used then the output for each input address is displayed on one, possibly quite long, line. If -p is not used then the output is broken up into multiple lines, based on the paragraphs above." "If the file name or function name can not be determined, addr2line will print two question marks in their place. If the line number can not be determined, addr2line will print 0." However, this is quite annoying when producing scripts, since the unknown symbol is the only exception that requires a particular processing. It seems it would be more coherent to only output a single line containing "??:0" in this case.
Created attachment 6822 [details] When pretty printing print unknown function names on the same line as unknown file names.
Hi, I have uploaded a potential patch to fix this behaviour. Please let me know if you are happy with it, and if so, I will check the patch in. Cheers Nick
Perfect, for me it's fine! Thanks!
CVSROOT: /cvs/src Module name: src Changes by: nickc@sourceware.org 2013-01-18 13:14:35 Modified files: binutils : ChangeLog addr2line.c Log message: PR binutils/15026 * addr2line.c (translate_addresses): When pretty printing, print unknown function names on the same line as unknown symbol names. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/ChangeLog.diff?cvsroot=src&r1=1.1976&r2=1.1977 http://sourceware.org/cgi-bin/cvsweb.cgi/src/binutils/addr2line.c.diff?cvsroot=src&r1=1.42&r2=1.43