This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Add DW_AT_main_subprogram tag to Fortran main program
- From: Jakub Jelinek <jakub at redhat dot com>
- To: FX <fxcoudert at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gfortran List <fortran at gcc dot gnu dot org>
- Date: Sun, 3 Oct 2010 15:16:11 +0200
- Subject: Re: [patch] Add DW_AT_main_subprogram tag to Fortran main program
- References: <28A1527A-518A-40C8-9DC8-A86FEFC8D067@gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sun, Oct 03, 2010 at 03:08:51PM +0200, FX wrote:
> Attached patch adds the DW_AT_main_subprogram DWARF 4 tag to the main Fortran program.
>
> Bootstrapped and regtested on x86_64-linux. With a recent readelf, a main program compiled with patch says:
>
> <1><2e>: Abbrev Number: 2 (DW_TAG_subprogram)
> <2f> DW_AT_name : (indirect string, offset: 0x5): MAIN__
> <33> DW_AT_decl_file : 1
> <34> DW_AT_decl_line : 1
> <35> DW_AT_low_pc : 0x0
> <3d> DW_AT_high_pc : 0x6
> <45> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa)
> <47> DW_AT_main_subprogram: 1
> <47> DW_AT_calling_convention: 2 (program)
>
>
> OK to commit?
+ add_AT_flag (subr_die, DW_AT_main_subprogram, 1);
should be guarded by
if (dwarf_version >= 4 || !dwarf_strict)
Jakub