From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2786 invoked by alias); 10 Jul 2002 18:47:12 -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 2778 invoked from network); 10 Jul 2002 18:47:11 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 10 Jul 2002 18:47:11 -0000 Received: from dsl254-114-096.nyc1.dsl.speakeasy.net ([216.254.114.96] helo=nevyn.them.org) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17SMUX-00041t-00; Wed, 10 Jul 2002 13:47:10 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17SMUY-0006EK-00; Wed, 10 Jul 2002 14:47:10 -0400 Date: Wed, 10 Jul 2002 11:47:00 -0000 From: Daniel Jacobowitz To: Petr Sorfa Cc: "gdb-patches@sources.redhat.com" Subject: Re: [PATCH] DW_AT_calling_convention support REV 2 Message-ID: <20020710184710.GA923@nevyn.them.org> Mail-Followup-To: Petr Sorfa , "gdb-patches@sources.redhat.com" References: <3D2C80A8.35D678FE@caldera.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D2C80A8.35D678FE@caldera.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-07/txt/msg00197.txt.bz2 On Wed, Jul 10, 2002 at 02:44:56PM -0400, Petr Sorfa wrote: > Hi, > > Revised 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". It adds a new API set for keeping track of the > symbol associated with "main". Note that there are 3 checks for > DW_AT_calling_convention. They are all necessary as they are detected at > different times when processing program debug information. I wasn't quite clear... there's one thing that should be different. > + /* Determine whether the symbol passed is equivalent to > + the ``main'' symbol. Returns 0 if not or if there is no ``main'' > + symbol set. */ > + int > + is_main_symbol (struct symbol *check_symbol) > + { > + return (check_symbol == NULL ? 0 : symbol_of_main == check_symbol); > + } > > void > _initialize_symtab (void) I was thinking like: int is_main_symbol (struct symbol *check_symbol) { if (symbol_of_main && symbol_of_main == check_symbol) return 1; else if (strcmp (SYMBOL_NAME (check_symbol), get_main_name ()) == 0) return 1; return 0; } And then change all callers of get_main_name () to use this. (Note that this requires being careful if symbol_of_main gets unloaded and we load a C program afterwards!) Make sense? Sound reasonable? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer