From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10028 invoked by alias); 26 Sep 2007 17:58:15 -0000 Received: (qmail 10020 invoked by uid 22791); 26 Sep 2007 17:58:14 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Sep 2007 17:58:10 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4D2932AB22F; Wed, 26 Sep 2007 13:58:08 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id llWFkdrfW4zQ; Wed, 26 Sep 2007 13:58:08 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E885B2AB14B; Wed, 26 Sep 2007 13:58:07 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B0ACCE7B58; Wed, 26 Sep 2007 10:58:05 -0700 (PDT) Date: Wed, 26 Sep 2007 17:58:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org, gpc@gnu.de Subject: Re: [RFC] Handle GPC specific name for main function Message-ID: <20070926175805.GA6208@adacore.com> References: <003901c8004b$2f9a55d0$8ecf0170$@u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <003901c8004b$2f9a55d0$8ecf0170$@u-strasbg.fr> User-Agent: Mutt/1.4.2.2i 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-09/txt/msg00380.txt.bz2 Hello Pierre, > 2007-09-26 Pierre Muller > * p-lang.h (pascal_main_name): New function. > p-lang.c (GPC_MAIN_PROGRAM_NAME_1, > GPC_MAIN_PROGRAM_NAME_2): New char array constants > corresponding to the two minimal symbols used > by GPC compiler. > (pascal_main_name): Try to find minimal symbol > corresponding to the entry of GPC compiled programs. > symtab.c (find_main_name): Try to find > pascal specific main name by calling pascal_main_name. This is mostly OK, except for the tiny comment formatting pointed out by Eli. I have a few suggestions: > +/* The name of the symbol used by GPC compiler. */ I find this is too vague. I suggest something like: /* The name of the symbol that GPC uses as the name of the main subprogram. There are several possibilities depending on the version of GPC. */ I might even go one step further and put a comment for each entry. Something like: /* The name of the symbol that GPC uses as the name of the main subprogram (since version ...). */ And then, for the other one say: /* Older versions of GPC (version ... and older) were using a different name for the main subprogram. */ > +static const char GPC_MAIN_PROGRAM_NAME_1[] > + = "pascal_main_program"; > +static const char GPC_MAIN_PROGRAM_NAME_2[] > + = "_p__M0_main_program"; Also, I think you might want to order them the opposite way. The net effect is that you'll end up trying the newer symbol first, and then fallback to the older symbol. When people start using the newer compiler, GDB will need to do only one symbol lookup to find a match. > + /* For GPC, main procedure s a special name. > + . */ I think making the comment above a bit more expressive makes this comment superfluous. > @@ -40,6 +40,7 @@ > #include "filenames.h" /* for FILENAME_CMP */ > #include "objc-lang.h" > #include "ada-lang.h" > +#include "p-lang.h" > > #include "hashtab.h" > You also need to update Makefile.in, since you added a dependency. With these adjustments in, your patch is pre-approved (but please remember to give it a round of testing, just in cases). Thank you, -- Joel