public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2][PR fortran/26373][PR fortran/22497] GDB support for Fortran extends feature
@ 2022-01-13 16:39 Nils-Christian Kempke
  2022-01-13 16:39 ` [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types Nils-Christian Kempke
  2022-01-13 16:39 ` [PATCH 2/2] gdb/fortran: print fortran extended types with ptype Nils-Christian Kempke
  0 siblings, 2 replies; 9+ messages in thread
From: Nils-Christian Kempke @ 2022-01-13 16:39 UTC (permalink / raw)
  To: gdb-patches

Hi,

please find attached 2 patches enabling GDB to deal with the
Fortran 2003 feature of type extension.

For ifx and ifort this patch addresses the above mentioned Bugzilla
bugs fully.  For gfortran (and flang - these are all I tried) the
bugs still somewhat exist but I'd not consider them to be on GDB side.

The problem when using gfortran (or flang) is, that the compilers
do not emit the respective DWARF tag for inheritance when the extends
feature is used.  Thus, GDB has no chance of actually knowing about
it. Assume the following scenario:

    type :: a
        real :: a_real
    end type a

    type, extends(a) :: b
    end type b

Now if we have

    type(b) :: obj

and compiled with gfortran or flang GDB is not able to directly resolve
a member access of the sort

    (gdb) obj%a_real
    There is no member named a_real.

since gfortran will not emit the DW_TAG_inheritance for b.  There is a
gcc bug gcc/49475 filed for this which is set as kfail in the respective
test in [PATCH (1/2)].

Any feedback is welcome!

Cheers,

Nils

Bernhard Heckel (2):
  gdb/fortran: add support for accessing fields of extended types
  gdb/fortran: print fortran extended types with ptype

 gdb/f-exp.y                                   |   7 +-
 gdb/f-lang.h                                  |  11 +
 gdb/f-typeprint.c                             |  24 ++-
 gdb/testsuite/gdb.fortran/oop_extend_type.exp | 190 ++++++++++++++++++
 gdb/testsuite/gdb.fortran/oop_extend_type.f90 |  69 +++++++
 gdb/valops.c                                  |   6 +
 6 files changed, 303 insertions(+), 4 deletions(-)
 create mode 100755 gdb/testsuite/gdb.fortran/oop_extend_type.exp
 create mode 100755 gdb/testsuite/gdb.fortran/oop_extend_type.f90

-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

end of thread, other threads:[~2022-02-18 16:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 16:39 [PATCH 0/2][PR fortran/26373][PR fortran/22497] GDB support for Fortran extends feature Nils-Christian Kempke
2022-01-13 16:39 ` [PATCH 1/2][PR fortran/26373][PR fortran/22497] gdb/fortran: add support for accessing fields of extended types Nils-Christian Kempke
2022-01-14 20:06   ` Tom Tromey
2022-01-17 10:28     ` Kempke, Nils-Christian
2022-02-01 15:06       ` Kempke, Nils-Christian
2022-02-10 13:20         ` Kempke, Nils-Christian
2022-02-18 16:14           ` Kempke, Nils-Christian
2022-01-13 16:39 ` [PATCH 2/2] gdb/fortran: print fortran extended types with ptype Nils-Christian Kempke
2022-01-14 20:10   ` Tom Tromey

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).