From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32262 invoked by alias); 26 Jul 2005 03:05:35 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32252 invoked by uid 22791); 26 Jul 2005 03:05:32 -0000 Received: from ausmtp02.au.ibm.com (HELO ausmtp02.au.ibm.com) (202.81.18.187) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 26 Jul 2005 03:05:32 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp02.au.ibm.com (8.12.10/8.12.10) with ESMTP id j6Q30QAH240552 for ; Tue, 26 Jul 2005 13:00:30 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.250.243]) by sd0208e0.au.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j6Q385xb180860 for ; Tue, 26 Jul 2005 13:08:07 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.12.11/8.13.3) with ESMTP id j6Q358qv028247 for ; Tue, 26 Jul 2005 13:05:09 +1000 Received: from [9.181.134.203] ([9.181.134.203]) by d23av02.au.ibm.com (8.12.11/8.12.11) with ESMTP id j6Q34j6H027727; Tue, 26 Jul 2005 13:04:55 +1000 Date: Tue, 26 Jul 2005 03:05:00 -0000 From: Wu Zhou X-X-Sender: woodzltc@localhost.localdomain To: Daniel Jacobowitz cc: kamaraju@gmail.com, fortran@gcc.gnu.org, gdb@sources.redhat.com Subject: Re: gfortran - gdb problem In-Reply-To: <20050725130929.GA2090@nevyn.them.org> Message-ID: References: <20050725130929.GA2090@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-07/txt/msg00237.txt.bz2 > Really, GDB ought to know that the main function in a Fortran program > is named MAIN__ and set that to the default location. Daniel, thanks for the pointer. I am trying to code a patch to fix this, but encounter another problem: when GDB tries to lookup "MAIN__" in the symtabs, it transfers "MAIN__" to lower cases first, so lookup_symbol (main_name (), 0, VAR_DOMAIN, 0, NULL) failed. This attributes to the following code in symtab.c: if (case_sensitivity == case_sensitive_off) { char *copy; int len, i; len = strlen (name); copy = (char *) alloca (len + 1); for (i= 0; i < len; i++) copy[i] = tolower (name[i]); copy[len] = 0; modified_name = copy; } My question here is: is it desirable to transfer the name to lower-case if the language is case insensitive. My point is that the compiler could handle this and GDB needs only to handle what we get from the compiler. As for this case, I don't know how other case-insensitive languages behave. But it might helps to change the conditional expression to: case_sensitivity == case_sensitive_off && current_language->la_language != language_fortran What do you think? If there is any error, please correct me. Thanks. Regards - Wu Zhou