[ scummvm-Bugs-3439302 ] wrong debug format generated for *.asm files
SourceForge.net
noreply at sourceforge.net
Thu Nov 17 11:11:02 CET 2011
Bugs item #3439302, was opened at 2011-11-17 02:11
Message generated for change (Tracker Item Submitted) made by chkr
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=3439302&group_id=37116
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compiler error
Group: All Games
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christian Krause (chkr)
Assigned to: Nobody/Anonymous (nobody)
Summary: wrong debug format generated for *.asm files
Initial Comment:
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
[...]
[10] .stab PROGBITS 00000000 0288f0 004fec 0c 11 0 4
[11] .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
[...]
[13] .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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=3439302&group_id=37116
More information about the Scummvm-tracker
mailing list