From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 662 invoked by alias); 21 Nov 2005 14:14:28 -0000 Received: (qmail 642 invoked by uid 22791); 21 Nov 2005 14:14:26 -0000 X-Spam-Check-By: sourceware.org Received: from h-68-164-203-246.nycmny83.covad.net (HELO dberlin.org) (68.164.203.246) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 21 Nov 2005 14:14:25 +0000 Received: from [127.0.0.1] (HELO localhost) by dberlin.org (CommuniGate Pro SMTP 5.0.1) with ESMTP id 8322247; Mon, 21 Nov 2005 09:14:19 -0500 Subject: Re: [RFC] Use DW_CC_program to indicate Fortran main subroutine From: Daniel Berlin To: Daniel Jacobowitz Cc: Wu Zhou , gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org, pinskia@gcc.gnu.org In-Reply-To: <20051121051017.GA12030@nevyn.them.org> References: <20051121051017.GA12030@nevyn.them.org> Content-Type: text/plain Date: Mon, 21 Nov 2005 18:10:00 -0000 Message-Id: <1132582460.3076.22.camel@linux.site> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00391.txt.bz2 On Mon, 2005-11-21 at 00:10 -0500, Daniel Jacobowitz wrote: > On Mon, Nov 21, 2005 at 12:44:33PM +0800, Wu Zhou wrote: > > Hello GCC and GDB maintainers, > > > > We ever discussed about how to indicate the main subroutine of fortran > > and java code with DWARF info (GCC PR 23280, 1427 and 10220; GDB PR 822). > > My point is that DW_CC_program might be the final solution. Here is what > > DWARF standard said about this: > > > > If the semantics of the language of the compilation unit containing the > > subroutine entry distinguishes between ordinary subroutines and > > subroutines that can serve as the main program, that is, subroutines > > that cannot be called directly according to the ordinary calling > > conventions, then the debugging information entry for such a subroutine > > may have a calling convention attribute whose value is the constant > > DW_CC_program. > > > > The DW_CC_program value is intended to support Fortran main programs. It > > is not intended as a way of finding the entry address for the program. > > The compiler patch I can't comment on... > > As for calling set_main_name, I don't know if this is right or not. I > guess it depends what the DWARF folks meant by "not intended as a way > of finding the entry address for the program". It means it wasn't intended to be reused for this purpose, AFAIK. :) > Can a Fortran binary > have more than one "main program"? > > If they only meant "it does not indicate the address you can jump to in > order to start", then this seems quite reasonable. > > If that's the case then it should work for gcj too. You'll have a > function named main, with no special debug info, and also a function > with DW_CC_program at the real entry point. I remember asking Wu to file an issue with the dwarf working group, and that issue was resolved by deferring to DWARF 4 for now. See http://dwarf.freestandards.org/ShowIssue.php?issue=050808.2&type=closed For now, why don't we just add a new vendor attribute? DW_AT_GNU_main