This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems while debugging fortran


Daniel Jacobowitz <drow at false.org> writes:
> On Thu, Oct 25, 2007 at 09:18:14AM -0700, Jim Blandy wrote:
>> We've been discussing this on the DWARF committee.  That attribute is
>> definitely not meant to be used to recognize the Fortran main program.
>> There's a proposal for an attribute that really does what we want, but
>> it's been sent back for revision.
>
> This is, if you will forgive my saying so, a bit absurd.  I think
> we've been discussing this problem for three or four years now and
> we're still waiting for a new and more accurate attribute.  I hope
> there's at least some clarification of the text for DW_CC_program
> included; if it's not for the entry point, and it's not for the
> Fortran main program, I have no idea what it's for.

I do forgive your saying so.  :)  I'm just the messenger, okay?

The committee wanted language that would be clear in all sorts of
hairy corner cases: What about Java, where the entry point isn't
selected until link time?  What about Ada, where every module can have
its own main, and they all get run in some order?  What about global
constructors in C++ --- they're the first user code that gets
executed?  What about COBOL, where I fell asleep?

Why not just make up a GNU extension that does what we want?  It'd be
trivial.

As far as what the attribute is supposed to mean, it seems pretty
obvious.  A language might specify different calling conventions for
different functions; if present, the attribute specifies the calling
convention used for the function it's attached to.  If a Fortran
program had multiple entry points (I think the language permits this,
although I'm not sure what it would mean in Unix), the compiler could
legitimately attach that attribute to all of them, even though only
one of them was serving as the program's entry point.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]