This is the mail archive of the
mailing list for the GCC project.
RFC: DWARF debug tags for gfortran's OOP implementation
- From: Tobias Burnus <burnus at net-b dot de>
- To: GCC Mailing List <gcc at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Mon, 27 Jun 2011 19:39:08 +0200
- Subject: RFC: DWARF debug tags for gfortran's OOP implementation
during the GCC Gathering I realized during the LTO debugging symbol
discussion that gfortran does not generate debug information for the OOP
features (cf. PR 49475).
The first issue to solve is which DWARF information one should generate.
I have only very limited knowledge of DWARF, except that I quickly
scanned "5.5.3 Derived or Extended Structs, Classes and Interfaces" and
"5.5.7 Member Function Entries" (of http://www.dwarfstd.org/doc/DWARF4.pdf).
I think one should handle member functions (cf. example below). I am not
sure whether other things like type extension or accessibility should be
integer :: var_p = 3
procedure, nopass :: memb => proc_parent
end type parent
! Side note: nopass disables passing of the type itself ("this")
! Otherwise, the effective type would be passed as first argument to
type, extends(parent) :: child
procedure, nopass :: memb => proc_child
end type child
print *, "proc_parent"
end subroutine proc_parent
print *, "proc_child"
end subroutine proc_child
end module m
class(parent), allocatable :: a
type(child) :: b
allocate (parent :: a)
call a%memb() ! Uses vtable to see that proc_parent should be called
allocate (child :: a)
call a%memb() ! Uses vtable to see that proc_child should be called
! Variable access - resolved at compile time
print *, b%var_p ! Directly access "var_p"
print *, b%parent%var_p ! Access it via the parent type
end program main