Created attachment 9886 [details] The patch which fixes the reported bug. When the filename or the full path is too long, "objdump --dwarf=decodedline" truncates the filename or the full path. In theory, "--wide" should prevent the truncation. However, that doesn't work. Btw, "readelf --debug-dump=decodedline" works well with "--wide". Here is the example of output: $ binutils/readelf --debug-dump=decodedline --wide ~/dev/tmp/a.out Decoded dump of debug contents of section .debug_line: CU: my_very_very_very_very_very_very_very_very_long.c: File name Line number Starting address my_very_very_very_very_very_very_very_very_long.c 3 0x4004ed my_very_very_very_very_very_very_very_very_long.c 4 0x4004f1 my_very_very_very_very_very_very_very_very_long.c 5 0x4004f6 $ binutils/objdump --dwarf=decodedline --wide ~/dev/tmp/a.out /home/fcamel/dev/tmp/a.out: file format elf64-x86-64 Decoded dump of debug contents of section .debug_line: CU: my_very_very_very_very_very_very_very_very_long.c: File name Line number Starting address ery_very_very_very_very_very_long.c 3 0x4004ed ery_very_very_very_very_very_long.c 4 0x4004f1 ery_very_very_very_very_very_long.c 5 0x4004f6 The attachment is a patch to fix this issue. After applying the patch: $ binutils/objdump --dwarf=decodedline --wide ~/dev/tmp/a.out /home/fcamel/dev/tmp/a.out: file format elf64-x86-64 Decoded dump of debug contents of section .debug_line: CU: my_very_very_very_very_very_very_very_very_long.c: File name Line number Starting address my_very_very_very_very_very_very_very_very_long.c 3 0x4004ed my_very_very_very_very_very_very_very_very_long.c 4 0x4004f1 my_very_very_very_very_very_very_very_very_long.c 5 0x4004f6
Forgot to mention my testing revision: 15c22686d0e33d87262bc9075296eeddd7d955f7
The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7b5d48229b7faa16f69e87fb269f17db0291d89f commit 7b5d48229b7faa16f69e87fb269f17db0291d89f Author: Chia-Hao Lo <fcamel@gmail.com> Date: Fri Mar 10 16:29:58 2017 +0000 Make objdump's --wide command line option affect its output of DWARF debug information. PR binutils/21235 * objdump.c (main): Set do_wide with --wide.
Hi Chia-Hao, Thanks for the bug report and patch. I have applied your patch the sources and added a changelog entry as well. Cheers Nick