From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27876 invoked by alias); 24 Sep 2007 23:49:21 -0000 Received: (qmail 27867 invoked by uid 22791); 24 Sep 2007 23:49:19 -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; Mon, 24 Sep 2007 23:49:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 216062AAF66; Mon, 24 Sep 2007 19:49:13 -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 k4VLeldBmI0T; Mon, 24 Sep 2007 19:49:13 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DEF0E2AAF65; Mon, 24 Sep 2007 19:49:12 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 47E5CE7B58; Mon, 24 Sep 2007 16:49:10 -0700 (PDT) Date: Tue, 25 Sep 2007 01:29:00 -0000 From: Joel Brobecker To: Carlos Eduardo Seo Cc: gdb@sourceware.org Subject: Re: Problems while debugging fortran Message-ID: <20070924234910.GB8601@adacore.com> References: <46EB035B.4090802@linux.vnet.ibm.com> <20070920173246.GJ16400@adacore.com> <46F2CE45.5020308@linux.vnet.ibm.com> <20070920204622.GB4368@adacore.com> <46F5D13D.2070303@linux.vnet.ibm.com> <20070923025033.GA20073@adacore.com> <46F81E0C.7030709@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46F81E0C.7030709@linux.vnet.ibm.com> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-09/txt/msg00194.txt.bz2 > > I think Daniel was right on the spot. You are trying to use the > > "current source file" concept right at the start of your session > > assuming that it is automatically set to the source file where > > you main is defined. Is that correct? > Yes. And the problem is that the current file is set as "init.c". I wonder why that is. Is this the file where function "main" is reported to be? > > We can certainly work on modifying GDB to be > > better at finding the name of the main procedure in a Fortran program > > (just like we do with Ada programs). > Any ideas where can we start? In terms of the GDB implementation, you can start by looking at what we do in symtab.c:find_main_name(). What you need to do is find a way for GDB to determine what the name of the main routine is. See the comment I inserted that explains also that we should not have any false positive. In terms of the Fortran compiler, I don't know how things are setup, so I don't know how it actually needs to be done, or if it's doable at all, actually. It looks like, from the patch that Daniel posted, that this routine is always called "MAIN__". Is that the case? -- Joel