Re: [RFC] Use DW_CC_program to indicate Fortran main subroutine

Wu Zhou
2005-11-22T02:31:08Z

Hi,

Thank you all for your kind input. I had a look at all your comments. It
seems that no one is 100% convinced that DW_CC_program is the proper
solution. In fact I am also a little odd about the usage of DW_CC_program
to indicate the main function. But the text in DWARF 3.3.1 really induce
me to think that it is currently the only feasible solution.

Now that most of you concur to make up a new attribute or tag for this. I
think it is more correct too. Maybe it is time for us to discuss the
detail of this new tag or attribute?

My vote is to use a new attribute Dan Berlin proposed: DW_AT_GNU_main. We
can use it in GNU toolchain first, gcc, gdb, binutils and so on. If the
DWARF committee can reach agreement on the final name, we can switch to
it then. What is your point on this? Thanks.

Regards
- Wu Zhou

On Mon, 21 Nov 2005, Daniel Jacobowitz wrote:

> On Mon, Nov 21, 2005 at 11:34:15AM -0500, Jason Merrill wrote:
> > Daniel Jacobowitz wrote:
> > >As for calling set_main_name, I don't know if this is right or not. I
> > >guess it depends what the DWARF folks meant by "not intended as a way
> > >of finding the entry address for the program". Can a Fortran binary
> > >have more than one "main program"?
> > >
> > >If they only meant "it does not indicate the address you can jump to in
> > >order to start", then this seems quite reasonable.
> >
> > This makes sense to me. The "entry address" sounds like _start, not main.
> >
> > It does seem a bit odd to put this under the calling convention
> > attribute, though, as the main function might be callable using the
> > normal calling convention in some languages. Java, for instance.
>
> Right - and it might not be, e.g. DW_CC_GNU_renesas_sh. I think Dan's
> got the right idea; we should just make up a tag for this, and submit
> it for dwarf4.
>
> --
> Daniel Jacobowitz
> CodeSourcery, LLC
>
>