From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29946 invoked by alias); 13 Nov 2007 17:45:57 -0000 Received: (qmail 29936 invoked by uid 22791); 13 Nov 2007 17:45:56 -0000 X-Spam-Check-By: sourceware.org Received: from shell4.BAYAREA.NET (HELO shell4.bayarea.net) (209.128.82.1) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Nov 2007 17:45:54 +0000 Received: (qmail 21559 invoked from network); 13 Nov 2007 09:45:51 -0800 Received: from 209-128-106-254.bayarea.net (HELO ?192.168.20.7?) (209.128.106.254) by shell4.bayarea.net with SMTP; 13 Nov 2007 09:45:51 -0800 Message-ID: <4739E2CF.6080805@eagercon.com> Date: Tue, 13 Nov 2007 17:45:00 -0000 From: Michael Eager User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: Carlos Eduardo Seo CC: Joel Brobecker , Jim Blandy , gdb@sources.redhat.com, drow@false.org Subject: Re: Problems while debugging fortran -- DWARF References: <19c433eb0710250906k392cecf8t1f99595d5c5a8107@mail.gmail.com> <20071025170621.GA27275@caradoc.them.org> <20071025190150.GA1560@caradoc.them.org> <20071025202406.GC4063@adacore.com> <4720FE48.8020200@linux.vnet.ibm.com> <20071025204134.GC4157@adacore.com> <4721034D.2060502@linux.vnet.ibm.com> In-Reply-To: <4721034D.2060502@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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-11/txt/msg00097.txt.bz2 Hi -- I haven't been following this thread and was just told about it. Disclaimer: I haven't read all of the discussion about this issue. The DWARF Committee has been considering a couple different proposals for an extension to DWARF to identify the "main" routine for Fortran or other languages which need this. An early version of the proposal can be found on the DWARF website: http://dwarfstd.org/Issues.php. A revised proposal which will have an attribute in the Compilation Unit DIE which points to the "main" subprogram is under development. Carlos Eduardo Seo wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > Joel Brobecker wrote: >> Just one minor comment: >> >>> + if ((DW_UNSND (&attr) == DW_CC_program) && (cu->language == > language_fortran)) >> Could you remove the unnecessary extra parens and split this line >> into two (it's too long): >> >> if (DW_UNSND (&attr) == DW_CC_program >> && cu->language == language_fortran) >> >> Your patch is approved with that adjustment. >> >> Thanks, > Ok, here's the version I commited, with Joel's suggestion and approval. > > 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 > > iD8DBQFHIQNMqvq7Aov/qQARAlRVAJsEheBLCyh8VdDHPy4Cyg5avI55hACeJxaz > +Y3B2mdbNkmBF9G/gthtq/c= > =xOwT > -----END PGP SIGNATURE----- > > > > ------------------------------------------------------------------------ > > 2007-10-25 Wu Zhou > Carlos Eduardo Seo > Jim Blandy > > * dwarf2read.c (read_partial_die): check the value > of DW_AT_calling_convention in Fortran programs. > > Index: src/gdb/dwarf2read.c > =================================================================== > --- src.orig/gdb/dwarf2read.c > +++ src/gdb/dwarf2read.c > @@ -5616,6 +5616,25 @@ read_partial_die (struct partial_die_inf > case DW_AT_byte_size: > part_die->has_byte_size = 1; > break; > + case DW_AT_calling_convention: > + /* DWARF doesn't provide a way to identify a program's source-level > + entry point. DW_AT_calling_convention attributes are only meant > + to describe functions' calling conventions. > + > + However, because it's a necessary piece of information in > + Fortran, and because DW_CC_program is the only piece of debugging > + information whose definition refers to a 'main program' at all, > + several compilers have begun marking Fortran main programs with > + DW_CC_program --- even when those functions use the standard > + calling conventions. > + > + So until DWARF specifies a way to provide this information and > + compilers pick up the new representation, we'll support this > + practice. */ > + if (DW_UNSND (&attr) == DW_CC_program > + && cu->language == language_fortran) > + set_main_name (part_die->name); > + break; > default: > break; > } -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077