[Dwarf-discuss] DWARF Issue 050808.2&body=Re: <ahref=http://dwarf.freestandards.org/ShowIssue.php

Daniel Berlin dberlin
Thu Feb 23 20:45:06 GMT 2006


On Thu, 2006-02-23 at 23:38 -0500, Daniel Jacobowitz wrote:
> On Thu, Feb 23, 2006 at 11:08:00PM -0500, Daniel Berlin wrote:
> > Proposal:
> > 
> > I propose we modify the definition of the DW_TAG_entry_point tag
> > definition to state that it is also usable for specifying the main
> > entry point to a program, not just fortran alternate entry points.
> > 
> > In order to determine which of the DW_TAG_entry_point is the single
> >  main entry point to the program, a flag attribute DW_AT_is_main(or
> >  something suitably named) should be added to the allowed attributes
> >  for DW_TAG_entry_point.
> 
> If we need a new flag anyway, then why shouldn't it be a flag on
> the DW_TAG_subprogram for main?  That seems to me like the clearest
> choice.

I don't disagree, that's a fine solution as well.
I was making the first and most obvious proposal to get discussion
going.

> 
> "entry point" is an overloaded term already; this isn't necessarily the
> program's entry point, but the high level language's starting point.
> The actual entry point will be over in _start land.

Which is why it's already confusing what the heck DW_TAG_entry_point is
supposed to be used for (it probably should have been named
DW_TAG_alternate_entry or something).  

It would be nice to have an example in the next standard for what
exactly it *is* used for

It's apparently *none* of these things (HLL starting point, actual
program entry point) that i've ever seen referred to as an "entry
point".  Fortran is probably the one language i never bothered to learn,
but i imagine i'm not alone.

> 
> > Alternatively, we could define it as the entry_point with
> > DW_CC_program calling convention, and delete the text that says "The
> > DW_CC_program value is intended to support Fortran main programs. It
> > is not intended as a way of finding the entry address for the
> > program."
> 
> This isn't appropriate because it would interfere with any other
> DW_AT_calling_convention that applied to the main routine - for
> instance, sh-elf-gcc with -mrenesas will mark main with
> DW_CC_GNU_renesas_sh.

I wasn't aware anyone had extended the cc attribute. There goes that
idea.






More information about the Dwarf-discuss mailing list