[Bug java/1427] gcc should allow gcj and gfortran to generate N_MAIN stab or DW_AT_entry_point dwarf2 debug info
------- Comment #20 from drow at gcc dot gnu dot org 2006-10-17 02:40 -------
Subject: Re: gcj should generate N_MAIN stab or DW_AT_entry_point dwarf2
debug info
On Sat, Oct 14, 2006 at 02:17:32PM -0000, steven at gcc dot gnu dot org wrote:
> Someone should make gdb understand the DW_AT_calling_convention attribute.
> This is the bit necessary to make it work for Fortran. I considered stealing a
> bit on FUNCTION_DECL to mark it as the main program but it seems to me that
> this hard-coded solution should be acceptable as well (but, your thoughts?).
I don't remember the discussion entirely, and can't find it now, but I
thought that the conclusion was that DW_AT_calling_convention was not
appropriate for this purpose? In gfortran, main-ness doesn't affect
whether the function can be called or not, or how to call it, I don't
think.
Compare to DW_CC_GNU_renesas_sh, indicating a different ABI. A flag
for i386 regparm could also go here.
I guess the language in the standard allows this usage, but it would
make it impossible to mark a main routine as obeying a particular ABI.
Ah, here:
http://dwarf.freestandards.org/ShowIssue.php?issue=050808.2&type=closed
Maybe someone out to poke the committee again.
> - value = targetm.dwarf_calling_convention (type);
> + if (is_fortran ())
> + {
> + /* The subroutine named MAIN__ is the main program for Fortran. */
> + const char *subroutine_name = get_AT_string (subr_die, DW_AT_name);
> + if (strcmp (subroutine_name, "MAIN__") == 0)
> + value = DW_CC_program;
> + }
> + else
> + value = targetm.dwarf_calling_convention (type);
Probably ought to call the target hook in the fortran case
eventually...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1427
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply to: