From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3495 invoked by alias); 25 Sep 2007 17:22:01 -0000 Received: (qmail 3475 invoked by uid 22791); 25 Sep 2007 17:22:00 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 25 Sep 2007 17:21:53 +0000 Received: from mailhub1.br.ibm.com (unknown [9.18.232.109]) by igw3.br.ibm.com (Postfix) with ESMTP id 33FB6390212 for ; Tue, 25 Sep 2007 14:17:00 -0300 (BRT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l8PHLlwN3260610 for ; Tue, 25 Sep 2007 14:21:48 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l8PHLkYH002014 for ; Tue, 25 Sep 2007 14:21:47 -0300 Received: from [9.18.201.207] ([9.18.201.207]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l8PHLkY9001947; Tue, 25 Sep 2007 14:21:46 -0300 Message-ID: <46F9439A.3010806@linux.vnet.ibm.com> Date: Tue, 25 Sep 2007 17:34:00 -0000 From: Carlos Eduardo Seo User-Agent: Thunderbird 2.0.0.6 (X11/20070907) MIME-Version: 1.0 To: Joel Brobecker CC: gdb@sourceware.org Subject: Re: Problems while debugging fortran 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> <20070924234910.GB8601@adacore.com> In-Reply-To: <20070924234910.GB8601@adacore.com> OpenPGP: id=8BFFA900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00210.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Joel Brobecker wrote: > > I wonder why that is. Is this the file where function "main" is > reported to be? > Yes, it seems that way. The problem is: in that sample code I sent in my first post, there's no function "main". If GDB assumes that it will always be like: program main ...blah blah end it'll never work for something like: program foo ... blah blah end If I change the name of my Fortran program to "main", I can set a breakpoint by line number inside it. So it seems that GDB is only looking for "main". This is fine for C, but it won't work for Fortran IMHO, not even using that patch Daniel posted. So, I believe we should address this issue in symtab.c:find_main_name. I can start looking into it. In the scenario above, a breakpoint by line number inside a function will fail. I think this may has to do with the compiler generating two DWARF compilation units (one for "main" and other for the function) and GDB is not reading the one related to the function. What are your thoughts about this? Regards, - -- Carlos Eduardo Seo Software Engineer IBM Linux Technology Center -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD4DBQFG+UOZqvq7Aov/qQARAgXlAJ0fa3E/Dv15WNFHB9s0uODC/YUKXQCY1xhJ 9jNxJPlD98kMq1XIuFE6pA== =3bWB -----END PGP SIGNATURE-----