From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24261 invoked by alias); 25 Oct 2007 18:40:37 -0000 Received: (qmail 24249 invoked by uid 22791); 25 Oct 2007 18:40:36 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 25 Oct 2007 18:40:34 +0000 Received: (qmail 15503 invoked from network); 25 Oct 2007 18:40:27 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Oct 2007 18:40:27 -0000 To: Carlos Eduardo Seo Cc: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: Problems while debugging fortran References: <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> <20071025170453.GA26928@caradoc.them.org> From: Jim Blandy Date: Thu, 25 Oct 2007 19:05:00 -0000 In-Reply-To: <20071025170453.GA26928@caradoc.them.org> (Daniel Jacobowitz's message of "Thu, 25 Oct 2007 13:04:53 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00666.txt.bz2 Daniel Jacobowitz writes: > On Thu, Oct 25, 2007 at 09:18:14AM -0700, Jim Blandy wrote: >> We've been discussing this on the DWARF committee. That attribute is >> definitely not meant to be used to recognize the Fortran main program. >> There's a proposal for an attribute that really does what we want, but >> it's been sent back for revision. > > This is, if you will forgive my saying so, a bit absurd. I think > we've been discussing this problem for three or four years now and > we're still waiting for a new and more accurate attribute. I hope > there's at least some clarification of the text for DW_CC_program > included; if it's not for the entry point, and it's not for the > Fortran main program, I have no idea what it's for. I do forgive your saying so. :) I'm just the messenger, okay? The committee wanted language that would be clear in all sorts of hairy corner cases: What about Java, where the entry point isn't selected until link time? What about Ada, where every module can have its own main, and they all get run in some order? What about global constructors in C++ --- they're the first user code that gets executed? What about COBOL, where I fell asleep? Why not just make up a GNU extension that does what we want? It'd be trivial. As far as what the attribute is supposed to mean, it seems pretty obvious. A language might specify different calling conventions for different functions; if present, the attribute specifies the calling convention used for the function it's attached to. If a Fortran program had multiple entry points (I think the language permits this, although I'm not sure what it would mean in Unix), the compiler could legitimately attach that attribute to all of them, even though only one of them was serving as the program's entry point.