This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
breakpoints/960: Problem with debug information for fortran strings with variable boundaries.
- 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: 27 Jan 2003 10:07:52 -0000
- Subject: breakpoints/960: Problem with debug information for fortran strings with variable boundaries.
- Reply-to: sana at stl dot sarov dot ru
>Number: 960
>Category: breakpoints
>Synopsis: Problem with debug information for fortran strings with variable boundaries.
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 27 10:08:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: sana@stl.sarov.ru
>Release: unknown-1.0
>Organization:
>Environment:
32-bit Linux && 64-bit Linux
>Description:
GDB does not recognize debug information about boundaries of fortran string which boundaries are variable (automatic strings, adjustable and boundary == *). It looks like that GDB ignores this information at all.
IDB works with this information correctly.
Fragment of debug information dump (test tr28001_1 is attached, command line is 'ifc -g tr28001_1.f90'):
<2><b0>: Abbrev Number: 4 (DW_TAG_formal_parameter)
DW_AT_decl_line : 7
DW_AT_decl_column : 0
DW_AT_decl_file : 1
DW_AT_type : <d4>
DW_AT_variable_parameter: 1
DW_AT_name : cpt
DW_AT_location : 3 byte block: 75 78 6 (DW_OP_breg5: -8DW_OP_deref)
.........................
<1><d4>: Abbrev Number: 5 (DW_TAG_string_type)
DW_AT_accessibility: 1 (public)
DW_AT_name :
DW_AT_string_length: 2 byte block: 75 7c
DW_AT_byte_size : 4
Example of debug sessio with GDB:
This GDB was configured as "i386-redhat-linux"...
(gdb) b 6
Breakpoint 1 at 0x80495c8: file tr28001_1.f90, line 6.
(gdb) r
Starting program: /home1/sana/trackers/Archive/tr29011/tests/gdbF/opt_none_debug/tr28001_1.exe
svetasveta
Breakpoint 1, foo (cpt='s', cpt1='s') at tr28001_1.f90:6
6 print *, cpt1
Current language: auto; currently fortran
(gdb) p cpt
$1 = 's'
(gdb) p cpt1
$2 = 's'
(gdb) whatis cpt
type = character
(gdb) whatis cpt1
type = character
(gdb)
Example of debug sessio with IDB (the same executable file):
Linux Application Debugger for 32-bit applications, Version 7.0 Beta, Build 20020715
------------------
object file name: tr28001_1.exe
Reading symbolic information ...done
(idb) stop 6
[#1: stop at "tr28001_1.f90":6 ]
(idb) r
svetasveta
[1] stopped at [subroutine foo(character(len=*), character*7):6 0x80495c8]
6 print *, cpt1
(idb) p cpt
"svetasveta"
(idb) p cpt1
"svetula"
(idb) whatis cpt
character*10 cpt
(idb) whatis cpt1
character*7 cpt1
(idb)
>How-To-Repeat:
Regression test is attached or below:
subroutine foo (cpt, cpt1)
character (len=*)::cpt
character (len=7):: cpt1
print *, cpt
print *, cpt1
end subroutine foo
program intel_string_bug
interface
subroutine foo (cpt, cpt1)
character (len=*)::cpt
character (len=7):: cpt1
end subroutine foo
^Mend interface
character(len=7) :: c7
character(len=10) :: c10
c7 = 'svetula'
c10 = 'svetasveta'
call foo (c10,c7)
end program intel_string_bug
Intel compiler should be used for reproducing of situation.
Command Line is 'ifc -g tr28001_1.f90'.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="tr28001_1.f90"
Content-Disposition: inline; filename="tr28001_1.f90"
subroutine foo (cpt, cpt1)
character (len=*)::cpt
character (len=7):: cpt1
print *, cpt
print *, cpt1
end subroutine foo
program intel_string_bug
interface
subroutine foo (cpt, cpt1)
character (len=*)::cpt
character (len=7):: cpt1
end subroutine foo
end interface
character(len=7) :: c7
character(len=10) :: c10
c7 = 'svetula'
c10 = 'svetasveta'
call foo (c10,c7)
end program intel_string_bug