From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18052 invoked by alias); 17 Oct 2006 02:40:24 -0000 Received: (qmail 17891 invoked by alias); 17 Oct 2006 02:40:23 -0000 Date: Tue, 17 Oct 2006 02:40:00 -0000 Message-ID: <20061017024023.17890.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug java/1427] gcc should allow gcj and gfortran to generate N_MAIN stab or DW_AT_entry_point dwarf2 debug info In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "drow at false dot org" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2006-q4/txt/msg00060.txt.bz2 List-Id: ------- Comment #20 from drow at gcc dot gnu dot org 2006-10-17 02:40 ------- Subject: Re: gcj should generate N_MAIN stab or DW_AT_entry_point dwarf2 debug info On Sat, Oct 14, 2006 at 02:17:32PM -0000, steven at gcc dot gnu dot org wrote: > Someone should make gdb understand the DW_AT_calling_convention attribute. > This is the bit necessary to make it work for Fortran. I considered stealing a > bit on FUNCTION_DECL to mark it as the main program but it seems to me that > this hard-coded solution should be acceptable as well (but, your thoughts?). I don't remember the discussion entirely, and can't find it now, but I thought that the conclusion was that DW_AT_calling_convention was not appropriate for this purpose? In gfortran, main-ness doesn't affect whether the function can be called or not, or how to call it, I don't think. Compare to DW_CC_GNU_renesas_sh, indicating a different ABI. A flag for i386 regparm could also go here. I guess the language in the standard allows this usage, but it would make it impossible to mark a main routine as obeying a particular ABI. Ah, here: http://dwarf.freestandards.org/ShowIssue.php?issue=050808.2&type=closed Maybe someone out to poke the committee again. > - value = targetm.dwarf_calling_convention (type); > + if (is_fortran ()) > + { > + /* The subroutine named MAIN__ is the main program for Fortran. */ > + const char *subroutine_name = get_AT_string (subr_die, DW_AT_name); > + if (strcmp (subroutine_name, "MAIN__") == 0) > + value = DW_CC_program; > + } > + else > + value = targetm.dwarf_calling_convention (type); Probably ought to call the target hook in the fortran case eventually... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1427