CONFIGURE: Support new style DWARF2 debug info for i386 assembly
|Reported by:||SF/chkr||Owned by:|
I'm one of scummvm's packagers for Fedora. During the latest update we have stumbled over the following issue:
scummvm version: all versions, including git trunk platform: x86 and x86_64 compiler: any version of nasm (problem is only related to *.asm files)
The nasm compiler generates by default the old style "STABS" debug info:
readelf -S scummvm-1.3.1/graphics/scaler/hq3x_i386.o [...]  .stab PROGBITS 00000000 0288f0 004fec 0c 11 0 4  .stabstr STRTAB 00000000 02d8e0 00001f 00 0 0 4 [...]
This old format is not supported by the debuginfo packages generated in Fedora. As a consequence the debug information are missing for all assembler files. Although it is possible to change the debug info generated by nasm with "-F dwarf" to more recent "DWARF" type (indicated by the .debug* sections in the ELF binary):
readelf -S scummvm-1.4.0/graphics/scaler/hq3x_i386.o |grep debug [...]  .debug_info PROGBITS 00000000 028b10 00004f 00 0 0 1 [...]
that's not sufficient. The debug symbols generate by nasm are still not optimal since the DW_AT_comp_dir entry is missing:
readelf --debug-dump=info hq3x_i386.o [...] Contents of the .debug_info section: [...] <18> DW_AT_name : graphics/scaler/hq3x_i386.asm <36> DW_AT_producer : NASM 2.09.08 [...]
Most other compilers will generate debug sections like this:
readelf --debug-dump=info aspect.o [...] <11> DW_AT_name : (indirect string, offset: 0x57a): graphics/scaler/aspect.cpp <15> DW_AT_comp_dir : (indirect string, offset: 0x5f5): /home/chkr/Projects/fedora/scummvm/scummvm-1.4.0 [...]
As a result, the debuginfo packages in Fedora would not contain the assembler source files.
One possible solution would be to use the yasm assembler. If I use yasm with "-f elf32 -g dwarf2" to compile scummvm, complete and usable debug symbols are generated for the *.asm source files and full source-level debugging is possible.
Since it would be also helpful for bug reporting (complete stack traces etc.) it would be great if the problem of the wrong or incomplete debug symbols for assembler files could be fixed.
I can think of the following solutions:
a) scummvm could move entirely from nasm to yasm and add the appropriate compile flags b) the used assembler could be selected via configure script
I would be happy to provide a patch for this, please let me know how you would like to approach the issue.
Ticket imported from: #3439302. Ticket imported from: feature-requests/649.
Change History (8)
comment:1 by , 8 years ago
|Summary:||wrong debug format generated for *.asm files → Debug info for *.asm files is not compatible with Fedora|
comment:3 by , 8 years ago
|Summary:||Debug info for *.asm files is not compatible with Fedora → Support new style DWARF2 debug info for i386 assembly|
comment:7 by , 22 months ago
|Summary:||Support new style DWARF2 debug info for i386 assembly → CONFIGURE: Support new style DWARF2 debug info for i386 assembly|