This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] DWARF: Don't add nameless modules to partial symbol table.


On 02/11/2016 17:41, Yao Qi wrote:
On Mon, Oct 31, 2016 at 9:05 AM, Bernhard Heckel
<bernhard.heckel@intel.com> wrote:
On 21/10/2016 17:37, Yao Qi wrote:
Bernhard Heckel <bernhard.heckel@intel.com> writes:

A name for BLOCK DATA in Fortran is optional. If no
name has been assigned, GDB will crash during read-in of DWARF
when BLOCK DATA is represented via DW_TAG_module.
BLOCK DATA is used for one-time initialization of
non-pointer variables in named common blocks.
I compiled your test case block-data.f, but there is no DW_TAG_module in
debug info.  It has DW_TAG_common_block.  IOW, I run block-data.exp
without your fix in dwarf2read.c, there is no crash in GDB.  My gfotran
is 4.9.3.

It happen when compiled with Ifort. I attached a dump of the debug info,
line 80+ is important.

I don't understand why BLOCK DATA is represented as a
DW_TAG_module when program is compiled with ifort.  In DWARF 5,
Modula-2 definition module and Fortran 90 module can be represented
as DW_TAG_module.

IMO, "BLOCK DATA" should be represented as a DW_TAG_subprogram,
because it is a program unit initializes data that appears in common
block.

From DWARF, I still believe DW_TAG_module could be used although it is not explicitly mentioned.

Nevertheless, Fortran specification say's this:
24 subprogram (2.2) : A function subprogram or a subroutine subprogram. Note that in Fortran 77, a
    25 block data program unit was called a subprogram.

Sorry for the noise and thanks for your input


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]