This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
ada/939: GDB does not recognise debug information for fortran string correctly.
- From: sana at stl dot sarov dot ru
- To: gdb-gnats at sources dot redhat dot com
- Cc: miwako dot tokugawa at intel dot com
- Date: 16 Jan 2003 13:26:58 -0000
- Subject: ada/939: GDB does not recognise debug information for fortran string correctly.
- Reply-to: sana at stl dot sarov dot ru
>Number: 939
>Category: ada
>Synopsis: GDB does not recognise debug information for fortran string correctly.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jan 16 05:28:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: sana@stl.sarov.ru
>Release: unknown-1.0
>Organization:
>Environment:
32-bit && 64-bit Linux
>Description:
GD does not recognise debug information for fortran string correctly.
It shows these variables as simple symbol:
This GDB was configured as "i386-redhat-linux"...
(gdb) b 11
Breakpoint 1 at 0x8049237: file char.f, line 11.
(gdb) r
Starting program: /home1/sana/trackers/GDB/tr17819/a.out
Breakpoint 1, charf () at char.f:11
11 end
Current language: auto; currently fortran
(gdb) p a
$1 = 'a'
(gdb) p b
$2 = 'f'
(gdb) p c
$3 = 'o'
(gdb)
Other debuggers (LDB and IDB) shows them correctly as strings:
object file name: a.out
Reading symbolic information ...done
(idb) stop 11
[#1: stop at "char.f":11 ]
(idb) r
[1] stopped at [subroutine charf():11 0x8049237]
11 end
(idb) p a
"a"
(idb) p b
"ff"
(idb) p c
"ooo"
Probably GDB ignores attribute DW_AT_byte_size for string type:
<2><8d>: Abbrev Number: 4 (DW_TAG_variable)
DW_AT_decl_line : 11
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_name : c
DW_AT_type : <c4>
DW_AT_location : 5 byte block: 3 98 9 7 8 (DW_OP_addr: 8070998)
DW_AT_external : 0
<2><9f>: Abbrev Number: 4 (DW_TAG_variable)
DW_AT_decl_line : 11
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_name : b
DW_AT_type : <c8>
DW_AT_location : 5 byte block: 3 94 9 7 8 (DW_OP_addr: 8070994)
DW_AT_external : 0
<2><b1>: Abbrev Number: 4 (DW_TAG_variable)
DW_AT_decl_line : 11
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_accessibility: 1 (public)
DW_AT_name : a
DW_AT_type : <cc>
DW_AT_location : 5 byte block: 3 90 9 7 8 (DW_OP_addr: 8070990)
DW_AT_external : 0
<1><c4>: Abbrev Number: 5 (DW_TAG_string_type)
DW_AT_accessibility: 1 (public)
DW_AT_name :
DW_AT_byte_size : 3
<1><c8>: Abbrev Number: 5 (DW_TAG_string_type)
DW_AT_accessibility: 1 (public)
DW_AT_name :
DW_AT_byte_size : 2
<1><cc>: Abbrev Number: 5 (DW_TAG_string_type)
DW_AT_accessibility: 1 (public)
DW_AT_name :
DW_AT_byte_size : 1
>How-To-Repeat:
Regression test is attached or below:
program charf
! This routine tests the character type
character*1 a
character*2 b
character*3 c
a='a'
b='ff'
c='ooo'
! write(*,*)a,b,c
end
Intel compiler should be used.
Command line is 'ifc -g char.f'.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="char.f"
Content-Disposition: inline; filename="char.f"
program charf
! This routine tests the character type
character*1 a
character*2 b
character*3 c
a='a'
b='ff'
c='ooo'
! write(*,*)a,b,c
end