public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/59438] New: DWARF: Fortran mishandles ALLOCATABLE/ASSOCIATED in debug output
@ 2013-12-09 20:30 burnus at gcc dot gnu.org
  2013-12-09 21:58 ` [Bug fortran/59438] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-12-09 20:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59438

            Bug ID: 59438
           Summary: DWARF: Fortran mishandles ALLOCATABLE/ASSOCIATED in
                    debug output
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

Reported by Sanimir of Intel, who is working on GDB VLA/Fortran array support.
(See various patches at gdb-patches@ or http://intel-gdb.github.io/)


(a) The DW_AT_allocated/DW_AT_associated is lacking for scalars - including
strings.

For arrays, it is handled via "struct array_descr_info", which is filled via
gfc_get_array_descr_info, via info->allocated and info->associated.



(b) Dynamic strings are wrapped within a DW_TAG_pointer_type
    character(len=:), allocatable :: str
Printing 'str' yields (PTR TO -> ( character*N )) 0xdeadbeef. Unfortunately
gfortran emits a DW_TAG_pointer_type for dynamic strings, which is not the case
for allocatable arrays.
--> Drop pointer_type and add an allocatable predicate so gdb can dereference
the string if it is allowed to.


(c) Allocatable/associated bits are available after stepping over variable
declaration.
   integer, allocatable :: array(:) ! attribute is missing
The above predicates will be initialized _after_ the inferior has passed the
line and thus gdb shows some random state before the line is executed.
--> Hoist the initialization of these bits (assign .False.) into the prologue,
this allows gdb to determine the correct status of the variable at any given
time.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-29 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-09 20:30 [Bug fortran/59438] New: DWARF: Fortran mishandles ALLOCATABLE/ASSOCIATED in debug output burnus at gcc dot gnu.org
2013-12-09 21:58 ` [Bug fortran/59438] " burnus at gcc dot gnu.org
2014-06-10  4:22 ` burnus at gcc dot gnu.org
2015-10-29 13:39 ` dominiq at lps dot ens.fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).