This is the mail archive of the
mailing list for the GCC project.
Re: [fortran,patch] Give the main program its proper name
- From: FX Coudert <fxcoudert at gmail dot com>
- To: GFortran <fortran at gcc dot gnu dot org>, gcc-patches list <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 3 Nov 2007 12:21:51 +0000
- Subject: Re: [fortran,patch] Give the main program its proper name
- References: <firstname.lastname@example.org>
*ping* (I know it's not been long, but since it' the week-end, some
might have a bit a free time for this rather simple patch)
Attached simple patch gives the symbol for the main program its proper
name, if any (otherwise, MAIN__ is used), while its assembler name is
set to MAIN__. This allows for better error messages from the
middle-end (instead of "In function MAIN__", we get "In function bar"
if the main program is bar ), and also for better debugging: we can
now set breakpoints on the main program (still called bar in my
example) by typing "break bar" as well as "break MAIN__".
When this patch is in, I'll also submit a patch to the middle-end that
emits DW_AT_calling_convention to identify the main program (that's
our lowest-numbered PR, PR 10220) which can then use this information.
Bootstrapped and regtested on x86_64-linux, OK to commit? (I regtested
with Tobias' interface patch; without it, there is one failure, which
lead to isolate the bug Tobias fixed.)
PS: I also fixed or trimmed down a few comments along the way.
 Yes, we should also make the GCC error mechanism print "In main
program 'bar'", but that's for another day ;-)