From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29997 invoked by alias); 25 Oct 2007 15:30:45 -0000 Received: (qmail 29982 invoked by uid 22791); 25 Oct 2007 15:30:43 -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 15:30:40 +0000 Received: (qmail 3397 invoked from network); 25 Oct 2007 15:30:38 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Oct 2007 15:30:38 -0000 To: Carlos Eduardo Seo Cc: Joel Brobecker , gdb-patches@sourceware.org Subject: Re: Problems while debugging fortran References: <46F2CE45.5020308@linux.vnet.ibm.com> <20070920204622.GB4368@adacore.com> <20070920205629.GA17779@caradoc.them.org> <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> From: Jim Blandy Date: Thu, 25 Oct 2007 15:41:00 -0000 In-Reply-To: <472098B2.5010605@linux.vnet.ibm.com> (Carlos Eduardo Seo's message of "Thu, 25 Oct 2007 11:22:58 -0200") 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/msg00657.txt.bz2 Carlos Eduardo Seo writes: > Joel Brobecker wrote: >> [moving to gdb-patches] >> >> This is close to what I had in mind, but I would personally prefer >> to limit this to Fortran compilation units. The semantics of this >> attribute value are still a bit unclear, and I'd like us to be cautious >> in its usage. >> > Restricted this to Fortran. Ok to commit now? > > -- > Carlos Eduardo Seo > Software Engineer > IBM Linux Technology Center > 2007-10-25 Wu Zhou > Carlos Eduardo Seo > > * dwarf2read.c (read_partial_die): check the value > of DW_AT_calling_convention in Fortran programs. > > Index: src/gdb/dwarf2read.c > =================================================================== > --- src.orig/gdb/dwarf2read.c > +++ src/gdb/dwarf2read.c > @@ -5616,6 +5616,13 @@ read_partial_die (struct partial_die_inf > case DW_AT_byte_size: > part_die->has_byte_size = 1; > break; > + case DW_AT_calling_convention: > + /* DWARF standard suggests to use value DW_CC_program of attribute > + DW_AT_calling_convention to indicate the Fortran main program. > + The following code is to check this. */ 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. */