This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objdump -S omits source when input uses .gnu_debuglink


Noah Misch <noah@cs.caltech.edu> writes:

> When an object's debugging information resides in a separate file, linked via a
> .gnu_debuglink section, `objdump -S' does not show source code; the output is
> rigorously identical to that of `objdump -d'.  The following command sequence
> illustrates the problem:
> 
>   echo 'int main() { return 0; }' >foo.c
>   gcc -g foo.c -o foo
>   objcopy --strip-debug --add-gnu-debuglink=foo foo foo-link
>   objdump -S foo	| sed -n '/<main>/,/^$/p'
>   objdump -S foo-link	| sed -n '/<main>/,/^$/p'
> 
> The gdb `list' command reads source from both objects without trouble.
> 
> CVS exhibits the problem, as do older versions.

It's just that nobody implemented parsing that header as far as I can see. 
It's not really a bug, just a missing feature. Probably would not
very hard to add.

Currently it is one of -S's smallest issues -- it is generally totally
unusable with current gcc and optimization
[see the patch I posted a few days ago]

-Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]