From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7050 invoked by alias); 10 Jul 2002 13:41:26 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 7027 invoked from network); 10 Jul 2002 13:41:25 -0000 Received: from unknown (HELO tetsuo.nj.caldera.com) (63.124.204.226) by sources.redhat.com with SMTP; 10 Jul 2002 13:41:25 -0000 Received: from caldera.com (localhost.localdomain [127.0.0.1]) by tetsuo.nj.caldera.com (8.11.6/8.11.6) with ESMTP id g6ADra403580; Wed, 10 Jul 2002 09:53:36 -0400 Message-ID: <3D2C3C5F.A74215A4@caldera.com> Date: Wed, 10 Jul 2002 07:03:00 -0000 From: Petr Sorfa Organization: Caldera X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz CC: "gdb-patches@sources.redhat.com" Subject: Re: [PATCH] DW_AT_calling_convention support References: <3D2B5385.997D474D@caldera.com> <20020709211520.GA21948@nevyn.them.org> <3D2B576E.85B28074@caldera.com> <20020709215812.GA966@nevyn.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00177.txt.bz2 Hi Daniel, > I'd rather save a pointer the symbol for the main function, or > something along those lines - do you think that's workable? Sounds good. Note that I'm making the assumption that the symbol is associated with a type that is only associated with that symbol (iff). I think it should be API driven, like set_main_symbol () and get_main_symbol () and situated in symtab.c alonside set_main_name() and main_name(). Petr > > On Tue, Jul 09, 2002 at 05:36:46PM -0400, Petr Sorfa wrote: > > Hi Daniel, > > > > Valid point, however there is a (hopefully not misguided) reason; I use > > it when printing a subroutine type for FORTRAN95. I make the assumption > > that determining whether a symbol name is equivalent to main_name() is > > not sufficient. > > > > Petr > > > > Patch for supporting DW_AT_calling_convention. This helps GDB identify > > > > the "main" program for languages that do not have a starting subroutine > > > > called "main". The patch also adds a new type flag, > > > > TYPE_FLAG_MAIN_PROGRAM which is set if the type is describing a "main" > > > > entry point. This can be used, for example, in noting a subroutine type > > > > as a FORTRAN PROGRAM. > > > > > > > > 2002-07-09 Petr Sorfa (petrs@caldera.com) > > > > > > > > * dwarf2read.c (read_subroutine_type): Expanded to recognize > > > > the DW_AT_calling_convention DWARF attribute and for > > > > DW_CC_program set the TYPE_FLAG_MAIN_PROGRAM type flag > > > > and call set_main_name (). > > > > (read_partial_die): Now recognizes the > > > > DW_AT_calling_convention attribute and calls set_main_name(). > > > > Note that TYPE_FLAG_MAIN_PROGRAM type flag is not set, as > > > > the partial_die might not denote a subroutine type. > > > > > > > > * gdbtypes.h (TYPE_FLAG_MAIN_PROGRAM): New type flag which > > > > indicates whether the type denotes a main program subroutine. > > > > (TYPE_MAIN_PROGRAM): New macro that returns a non-zero value > > > > if the type describes a main program subroutine. > > > > > > Why is the type flag necessary? It seems wasteful to allocate a bit in > > > every type when there will presumably only be one such routine. > > > > > > -- > > > Daniel Jacobowitz Carnegie Mellon University > > > MontaVista Software Debian GNU/Linux Developer > > > > > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer