Discussion:
Bug in Fortran: DW_AT_name
Markus Deuling
2008-03-14 08:18:28 UTC
Permalink
Hi,

I try to debug a Fortan binary produced by gcc 4.3. I get:

Breakpoint 1, MAIN__ () at :1
1 : No such file or directory.
in 
(gdb) info frame
Stack level 0, frame at 0xbfcec3e0:
eip = 0x80485bd in MAIN__ (:1); saved eip 0x80486c9

objdump is able to read the DW_AT_name

<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_producer : (indirect string, offset: 0x41): GNU F95 4.3.0­
DW_AT_language : 14­····(Fortran 95)
DW_AT_name : (indirect string, offset: 0x0): ./neg_array.F­·
DW_AT_comp_dir : (indirect string, offset: 0x1b): /home/deuling/fortran­

but shows following error:

objdump: Error: Location lists in .debug_info section aren't in ascending order!
objdump: Warning: There is an overlap [0x2c - 0xfffffffe] in .debug_loc section.
objdump: Warning: Offset 0xfffffffe is bigger than .debug_loc section size.
objdump: Warning: There is a hole [0xfffffffe - 0x2c] in .debug_loc section.

C-code works fine.

For my opinion this is a compiler bug in fortran. But as objdump is able to recognize
DW_AT_name maybe GDB should, too? What do you think ?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
***@de.ibm.com
Markus Deuling
2008-03-14 09:03:15 UTC
Permalink
Post by Markus Deuling
Hi,
Breakpoint 1, MAIN__ () at :1
1 : No such file or directory.
in 
(gdb) info frame
eip = 0x80485bd in MAIN__ (:1); saved eip 0x80486c9
objdump is able to read the DW_AT_name
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_producer : (indirect string, offset: 0x41): GNU F95 4.3.0­
DW_AT_language : 14­····(Fortran 95)
DW_AT_name : (indirect string, offset: 0x0): ./neg_array.F­·
/home/deuling/fortran­
objdump: Error: Location lists in .debug_info section aren't in ascending order!
objdump: Warning: There is an overlap [0x2c - 0xfffffffe] in .debug_loc section.
objdump: Warning: Offset 0xfffffffe is bigger than .debug_loc section size.
objdump: Warning: There is a hole [0xfffffffe - 0x2c] in .debug_loc section.
C-code works fine.
For my opinion this is a compiler bug in fortran. But as objdump is able
to recognize DW_AT_name maybe GDB should, too? What do you think ?
Hm, readelf does not show overlaps and no errors/warnings as well:

[25] .debug_aranges PROGBITS 00000000 0009e2 000040 00 0 0 1
[26] .debug_pubnames PROGBITS 00000000 000a22 000038 00 0 0 1
[27] .debug_info PROGBITS 00000000 000a5a 000361 00 0 0 1
[28] .debug_abbrev PROGBITS 00000000 000dbb 000141 00 0 0 1
[29] .debug_line PROGBITS 00000000 000efc 0000e3 00 0 0 1
[30] .debug_frame PROGBITS 00000000 000fe0 00006c 00 0 0 4
[31] .debug_str PROGBITS 00000000 00104c 0002db 01 MS 0 0 1
[32] .debug_loc PROGBITS 00000000 001327 00006f 00 0 0 1
[33] .shstrtab STRTAB 00000000 001396 00013f 00 0 0 1
[34] .symtab SYMTAB 00000000 001a78 000550 10 35 58 4
[35] .strtab STRTAB 00000000 001fc8 000369 00 0 0 1

So it might be a Bug in BFD library?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
***@de.ibm.com
Markus Deuling
2008-03-17 14:23:59 UTC
Permalink
Hi,
Post by Markus Deuling
For my opinion this is a compiler bug in fortran. But as objdump is
able to recognize DW_AT_name maybe GDB should, too? What do you think ?
it seems this is a gfortran bug. I opened a bugzilla:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615

Regards,
Markus
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
***@de.ibm.com
Loading...