[Dwarf-discuss] DWARF Issue 050808.2&body=Re: <ahref=http://dwarf.freestandards.org/ShowIssue.php
Michael Eager
eager
Fri Feb 24 11:29:26 GMT 2006
Daniel Berlin wrote:
> 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).
While there's not a lot of explanation, I think that the DWARF
standard is explicit: DW_TAG_entry_point is a Fortran alternate
entry point. Any other use for this tag does not follow the standard.
> 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.
It's a Fortran-specific feature, as the DWARF standard says.
As Jim Blandy said, the tag is a specific mapping to a specific
language feature and the name is based on this feature name.
It's a "term of art" in the Fortran language. The fact that you are
not familiar with this language is not a very compelling reason for
changing it's name or giving it a different meaning. Sorry.
As for examples, I would certainly like to see a document which
provides recommended language bindings for DWARF. This has been
something that we've wanted for many years. It's also a lot of
work. Feel free to volunteer. :-)
>>>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.
Extending the DW_CC attribute is entirely appropriate. If there are
multiple ways to call a subroutine, then this attribute describes what
ways apply to the routine. The DWARF spec defines three generic calling
conventions. The spec also defines a user extension range for additional
calling conventions. (I hope that DW_CC_GNU_renesas_sh is in this
user extension range.)
Calling conventions seem unrelated to the question (if I understand
it correctly) of where the program starts. In C/C++, the calling
convention for main() is no different from any other function.
If you are proposing an extension to DWARF to support some specific
language feature (a question which I don't think has been answered)
then then an understanding of that language would be advisable.
--
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-discuss
mailing list