From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30714 invoked by alias); 25 Oct 2007 16:15:02 -0000 Received: (qmail 30584 invoked by uid 22791); 25 Oct 2007 16:15:01 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 Oct 2007 16:14:54 +0000 Received: from mailhub3.br.ibm.com (mailhub3 [9.18.232.110]) by igw2.br.ibm.com (Postfix) with ESMTP id 02DD317F5FA; Thu, 25 Oct 2007 14:12:09 -0200 (BRDT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9PGEknS3010704; Thu, 25 Oct 2007 14:14:46 -0200 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9PGEkl7015084; Thu, 25 Oct 2007 13:14:46 -0300 Received: from [9.18.238.59] ([9.18.238.59]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l9PGEjZK015053; Thu, 25 Oct 2007 13:14:46 -0300 Message-ID: <4720C0F6.4040400@linux.vnet.ibm.com> Date: Thu, 25 Oct 2007 16:18:00 -0000 From: Carlos Eduardo Seo User-Agent: Thunderbird 2.0.0.6 (X11/20070907) MIME-Version: 1.0 To: Jim Blandy , Carlos Eduardo Seo , Joel Brobecker , gdb-patches@sourceware.org, drow@sourceware.org Subject: Re: Problems while debugging fortran References: <46FAD136.5030406@linux.vnet.ibm.com> <20070926214619.GC9403@adacore.com> <471F70C0.3000206@linux.vnet.ibm.com> <20071024193336.GI11797@adacore.com> <20071024195719.GA16009@caradoc.them.org> <471FA810.6080506@linux.vnet.ibm.com> <471FBF9E.5000607@linux.vnet.ibm.com> <20071024220648.GL11797@adacore.com> <472098B2.5010605@linux.vnet.ibm.com> <20071025154107.GA13835@caradoc.them.org> In-Reply-To: <20071025154107.GA13835@caradoc.them.org> OpenPGP: id=8BFFA900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00659.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel Jacobowitz wrote: > On Thu, Oct 25, 2007 at 08:30:38AM -0700, Jim Blandy wrote: >> This comment isn't right. The Fortran main program expects to have >> its arguments passed to it differently than other subroutines or >> functions; that's what DW_AT_calling_convention is meant to express. >> The comment should say something like: >> >> /* DWARF doesn't provide a way to identify a program's entry point. >> However, the Fortran main program receives its arguments via a >> special calling convention; we look for that to recognize the >> program's entry point. */ > > Have we concluded that this is true? If so, is there any reason we > should not make gfortran generate this attribute? And if so, why > not GNAT or GCJ too? > > The only thing we risk (that I can think of) in treating DW_CC_program > as a marker for main is that if the architecture required > DW_CC_program to indicate calling convention on a per-function basis > we would fail to implement "print main()" correctly. I don't think > that matters. > The DWARF3 spec says: '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.' So, it's a suggestion by the DWARF spec. I was investigating the DWARF info generated by gfortran and found out that this compiler doesn't generate DW_AT_calling_convention. Instead, it replaces the name of the "main program" by MAIN__ . Therefore, I think we should restrict this only to XLF. What's your opinion? - -- Carlos Eduardo Seo Software Engineer IBM Linux Technology Center -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHIMD1qvq7Aov/qQARAl46AJ9ODvLeHzL2rpcwvXMWVzpLxmaM1wCfePEN XFp9dC4zv7b7ChzwKUcQyRk= =6NPq -----END PGP SIGNATURE-----