Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
To: Jim Blandy <jimb@codesourcery.com>,
	        Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>,
	        Joel Brobecker <brobecker@adacore.com>,
	gdb-patches@sourceware.org,         drow@sourceware.org
Subject: Re: Problems while debugging fortran
Date: Thu, 25 Oct 2007 16:18:00 -0000	[thread overview]
Message-ID: <4720C0F6.4040400@linux.vnet.ibm.com> (raw)
In-Reply-To: <20071025154107.GA13835@caradoc.them.org>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Daniel Jacobowitz wrote:
> On Thu, Oct 25, 2007 at 08:30:38AM -0700, Jim Blandy wrote:
>> This comment isn't right.  The Fortran main program expects to have
>> its arguments passed to it differently than other subroutines or
>> functions; that's what DW_AT_calling_convention is meant to express.
>> The comment should say something like:
>>
>>   /* DWARF doesn't provide a way to identify a program's entry point.
>>      However, the Fortran main program receives its arguments via a
>>      special calling convention; we look for that to recognize the
>>      program's entry point.  */
>
> Have we concluded that this is true?  If so, is there any reason we
> should not make gfortran generate this attribute?  And if so, why
> not GNAT or GCJ too?
>
> The only thing we risk (that I can think of) in treating DW_CC_program
> as a marker for main is that if the architecture required
> DW_CC_program to indicate calling convention on a per-function basis
> we would fail to implement "print main()" correctly.  I don't think
> that matters.
>
The DWARF3 spec says:

'If the semantics of the language of the compilation unit containing
the subroutine entry distinguishes between ordinary subroutines and
subroutines that can serve as the "main program", that is, subroutines
that cannot be called directly according to the ordinary calling
conventions, then the debugging information entry for such a
subroutine _may_ have a calling convention attribute whose value is
the constant DW_CC_program.

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.'

So, it's a suggestion by the DWARF spec. I was investigating the DWARF
info generated by gfortran and found out that this compiler doesn't
generate DW_AT_calling_convention. Instead, it replaces the name of
the "main program" by MAIN__ . Therefore, I think we should restrict
this only to XLF.

What's your opinion?


- --
Carlos Eduardo Seo
Software Engineer
IBM Linux Technology Center
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHIMD1qvq7Aov/qQARAl46AJ9ODvLeHzL2rpcwvXMWVzpLxmaM1wCfePEN
XFp9dC4zv7b7ChzwKUcQyRk=
=6NPq
-----END PGP SIGNATURE-----


  reply	other threads:[~2007-10-25 16:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <46F2CE45.5020308@linux.vnet.ibm.com>
     [not found] ` <20070920204622.GB4368@adacore.com>
     [not found]   ` <20070920205629.GA17779@caradoc.them.org>
     [not found]     ` <46FAD136.5030406@linux.vnet.ibm.com>
     [not found]       ` <20070926214619.GC9403@adacore.com>
     [not found]         ` <471F70C0.3000206@linux.vnet.ibm.com>
     [not found]           ` <20071024193336.GI11797@adacore.com>
     [not found]             ` <20071024195719.GA16009@caradoc.them.org>
     [not found]               ` <471FA810.6080506@linux.vnet.ibm.com>
     [not found]                 ` <471FBF9E.5000607@linux.vnet.ibm.com>
2007-10-24 22:14                   ` Joel Brobecker
2007-10-25 14:10                     ` Carlos Eduardo Seo
2007-10-25 15:41                       ` Jim Blandy
2007-10-25 16:15                         ` Daniel Jacobowitz
2007-10-25 16:18                           ` Carlos Eduardo Seo [this message]
2007-10-25 17:05                           ` Jim Blandy
2007-10-25 18:19                             ` Daniel Jacobowitz
2007-10-25 19:05                               ` Jim Blandy
2007-10-25 19:23                                 ` Joel Brobecker
2007-10-25 19:10                         ` Joel Brobecker
2007-10-25 19:35                           ` Jim Blandy
2007-10-25 20:00                             ` Daniel Jacobowitz
2007-10-25 20:32                               ` Carlos Eduardo Seo
     [not found] <19c433eb0710250906k392cecf8t1f99595d5c5a8107@mail.gmail.com>
     [not found] ` <20071025170621.GA27275@caradoc.them.org>
     [not found]   ` <m3lk9rxceq.fsf@codesourcery.com>
     [not found]     ` <20071025190150.GA1560@caradoc.them.org>
     [not found]       ` <m3tzof9eqq.fsf@codesourcery.com>
     [not found]         ` <20071025202406.GC4063@adacore.com>
2007-10-25 20:41           ` Carlos Eduardo Seo
2007-10-25 20:55             ` Joel Brobecker
2007-10-25 21:47               ` Carlos Eduardo Seo
2007-10-25 20:57             ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4720C0F6.4040400@linux.vnet.ibm.com \
    --to=cseo@linux.vnet.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=drow@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=jimb@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox