From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5FC5B3858D28; Fri, 8 Apr 2022 14:14:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5FC5B3858D28 From: "nils-christian.kempke at intel dot com" To: gdb-prs@sourceware.org Subject: [Bug fortran/22497] Unable to access base type of derived types Date: Fri, 08 Apr 2022 14:14:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: fortran X-Bugzilla-Version: 8.0.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nils-christian.kempke at intel dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2022 14:14:25 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D22497 Kempke, Nils-Christian changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nils-christian.kempke@intel | |.com --- Comment #1 from Kempke, Nils-Christian --- I can confirm that this was a bug in GDB but now actually only is one in gfortran. I recently pushed=20 87e10e9c288c2f6c933f235b623522c8d9a2d727 and 110aae55a8b7e19fa5f04998851968e48822605f which fixed this problem on GDB's side. The problem with gfortran is, that = it is not emitting the correct DWARF OOP Fortran tags. This is a known issue here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D= 49475 Compiling the example with the ifort or ifx compiler I can get the following out of gdb (breaking at line 17): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (gdb) p foo $1 =3D ( my_int =3D 0 ) (gdb) p bar $2 =3D ( my_type =3D ( my_int =3D 1 ) ) (gdb) ptype foo type =3D Type my_type INTEGER*4 :: my_int End Type my_type (gdb) ptype bar type =3D Type, extends(my_type) :: extended_type Type my_type :: my_type End Type extended_type (gdb) p bar%my_type $3 =3D ( my_int =3D 1 ) (gdb) p bar%my_int $4 =3D 1 (gdb) p bar%my_type%my_int $5 =3D 1 (gdb) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The types emitted by gfortran (GNU Fortran (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0) do not provide any inheritance information: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <1><53>: Abbrev Number: 2 (DW_TAG_structure_type) <54> DW_AT_name : (indirect string, offset: 0x8): extended_type <58> DW_AT_byte_size : 4 <59> DW_AT_decl_file : 1 <5a> DW_AT_decl_line : 1 <5b> DW_AT_sibling : <0x6c> <2><5f>: Abbrev Number: 3 (DW_TAG_member) <60> DW_AT_name : (indirect string, offset: 0x0): my_type <64> DW_AT_decl_file : 1 <65> DW_AT_decl_line : 8 <66> DW_AT_type : <0x2e> <6a> DW_AT_data_member_location: 0 <2><6b>: Abbrev Number: 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D while ifx/ifort emit =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D <2><5c>: Abbrev Number: 4 (DW_TAG_structure_type) <5d> DW_AT_name : (indirect string, offset: 0x3b): extended_ty= pe <61> DW_AT_byte_size : 4 <62> DW_AT_decl_file : 1 <63> DW_AT_decl_line : 8 <3><64>: Abbrev Number: 5 (DW_TAG_inheritance) <65> DW_AT_type : <0x83> <3><69>: Abbrev Number: 0 ... <2><83>: Abbrev Number: 4 (DW_TAG_structure_type) <84> DW_AT_name : (indirect string, offset: 0x68): my_type <88> DW_AT_byte_size : 4 <89> DW_AT_decl_file : 1 <8a> DW_AT_decl_line : 4 <3><8b>: Abbrev Number: 6 (DW_TAG_member) <8c> DW_AT_name : (indirect string, offset: 0x57): my_int <90> DW_AT_type : <0x9a> <94> DW_AT_decl_file : 1 <95> DW_AT_decl_line : 4 <96> DW_AT_data_member_location: 0 <97> DW_AT_accessibility: 1 (public) <3><98>: Abbrev Number: 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 You are receiving this mail because: You are on the CC list for the bug.=