[Dwarf-discuss] DW_AT_program_entry_point

Chris Quenelle Chris.Quenelle
Tue Feb 28 17:52:38 GMT 2006


Jim Blandy:
> I'd prefer adding a new attribute, DW_AT_program_entry_point, whose
> value would be a reference to the die representing the program's main
> function.  This would be an attribute of some DW_TAG_compile_unit die.
>  It wouldn't necessarily need to refer to a die in that compilation
> unit, so gcj could emit a dummy Dwarf compilation unit just to contain
> the DW_AT_program_entry_point attribute at link time.

I like this better than reusing the existing entry_point tag.

But I don't think it's appropriate to attach it to the CU tag.
It should be an attribute of the DW_TAG_subprogram that
represents the 'main'-ish function.

Nobody is going to scan all the CU tags and look for special
attributes.  That's what the index tables are for.
Ideally this would be an attribute of the DIE that
represents the main program, but we don't have a DIE for
that and are unlikely to grow one in the near future unless
the linker starts reading and writing dwarf.

I believe it is common practice when scanning the index
lists to read the attributes of the DIE's that are
indexed, and so an attribute of the subprogram die
would be found and remembered at that time.

--chris



More information about the Dwarf-discuss mailing list