* Re: Problems while debugging fortran
@ 2007-10-25 16:07 François-Xavier Coudert
2007-10-25 17:06 ` Daniel Jacobowitz
0 siblings, 1 reply; 10+ messages in thread
From: François-Xavier Coudert @ 2007-10-25 16:07 UTC (permalink / raw)
To: gdb; +Cc: Daniel Jacobowitz, Joel Brobecker, Carlos Eduardo Seo
Hi,
> This is very unclear, since they don't explain what "support"
> refers to. But for people stuck with XLF, if we can improve their
> lives without hurting the rest of GDB, I'm ok with compromising and
> using this attribute value be used to find the main.
I'd like to support this comprise, and I'll note that other compilers
(Intel and Sun, at least) already use this convention.
For the longer term, what do you think is the optimal solution? I'd
like to make gfortran, the Fortran front-end in GCC, do The Right
Thing, but what is it? Should we add this DW_AT_calling_convention tag
for the time being, until the meaning of the DWARF standard is made
clearer?
FX
PS: I might submit patches to GDB in the future. Could someone send me
copyright assignment form? (I already have a GCC assignment, if that
makes any difference)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problems while debugging fortran
2007-10-25 16:07 Problems while debugging fortran François-Xavier Coudert
@ 2007-10-25 17:06 ` Daniel Jacobowitz
2007-10-25 18:44 ` Jim Blandy
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-10-25 17:06 UTC (permalink / raw)
To: Fran?ois-Xavier Coudert; +Cc: gdb, Joel Brobecker, Carlos Eduardo Seo
On Thu, Oct 25, 2007 at 05:06:54PM +0100, Fran?ois-Xavier Coudert wrote:
> For the longer term, what do you think is the optimal solution? I'd
> like to make gfortran, the Fortran front-end in GCC, do The Right
> Thing, but what is it? Should we add this DW_AT_calling_convention tag
> for the time being, until the meaning of the DWARF standard is made
> clearer?
I'll let Jim answer this, though I think it's reasonable.
> PS: I might submit patches to GDB in the future. Could someone send me
> copyright assignment form? (I already have a GCC assignment, if that
> makes any difference)
Sure, I will.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problems while debugging fortran
2007-10-25 17:06 ` Daniel Jacobowitz
@ 2007-10-25 18:44 ` Jim Blandy
2007-10-25 19:01 ` Daniel Jacobowitz
0 siblings, 1 reply; 10+ messages in thread
From: Jim Blandy @ 2007-10-25 18:44 UTC (permalink / raw)
To: Fran?ois-Xavier Coudert; +Cc: gdb, Joel Brobecker, Carlos Eduardo Seo
Daniel Jacobowitz <drow at false.org> writes:
> On Thu, Oct 25, 2007 at 05:06:54PM +0100, Fran?ois-Xavier Coudert wrote:
>> For the longer term, what do you think is the optimal solution? I'd
>> like to make gfortran, the Fortran front-end in GCC, do The Right
>> Thing, but what is it? Should we add this DW_AT_calling_convention tag
>> for the time being, until the meaning of the DWARF standard is made
>> clearer?
>
> I'll let Jim answer this, though I think it's reasonable.
To be clear: I think the actual code in Carlos's patch is just fine.
The comment, though, should not say things that are simply untrue.
Which is why I suggested a new comment, instead of rejecting the
patch. Whether or not we like the state of DWARF in this regard, the
comment should correct describes the state of play, no?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problems while debugging fortran
2007-10-25 18:44 ` Jim Blandy
@ 2007-10-25 19:01 ` Daniel Jacobowitz
2007-10-25 19:27 ` Jim Blandy
0 siblings, 1 reply; 10+ messages in thread
From: Daniel Jacobowitz @ 2007-10-25 19:01 UTC (permalink / raw)
To: gdb
On Thu, Oct 25, 2007 at 11:43:57AM -0700, Jim Blandy wrote:
> To be clear: I think the actual code in Carlos's patch is just fine.
> The comment, though, should not say things that are simply untrue.
> Which is why I suggested a new comment, instead of rejecting the
> patch. Whether or not we like the state of DWARF in this regard, the
> comment should correct describes the state of play, no?
However, the Fortran main program receives its arguments via a
special calling convention
I don't think that's true. As far as I know it has a perfectly
ordinary calling convention.
As for Carlos's comment, I don't know if it's true or not, but
it certainly seems to be what everyone else interprets the
DWARF standard to suggest :-)
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problems while debugging fortran
2007-10-25 19:01 ` Daniel Jacobowitz
@ 2007-10-25 19:27 ` Jim Blandy
2007-10-25 20:24 ` Joel Brobecker
0 siblings, 1 reply; 10+ messages in thread
From: Jim Blandy @ 2007-10-25 19:27 UTC (permalink / raw)
To: gdb
Here's a revised comment that may explain what's going on better:
/* DWARF doesn't provide a way to identify a program's source-level
entry point. DW_AT_calling_convention attributes are only meant
to describe functions' calling conventions.
However, because it's a necessary piece of information in
Fortran, and because DW_CC_program is the only piece of debugging
information whose definition refers to a 'main program' at all,
several compilers have begun marking Fortran main programs with
DW_CC_program --- even when those functions use the standard
calling conventions.
So until DWARF specifies a way to provide this information and
compilers pick up the new representation, we'll support this
practice. */
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Problems while debugging fortran
2007-10-25 19:27 ` Jim Blandy
@ 2007-10-25 20:24 ` Joel Brobecker
2007-10-25 20:36 ` Carlos Eduardo Seo
0 siblings, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2007-10-25 20:24 UTC (permalink / raw)
To: Jim Blandy; +Cc: gdb
> Here's a revised comment that may explain what's going on better:
>
> /* DWARF doesn't provide a way to identify a program's source-level
> entry point. DW_AT_calling_convention attributes are only meant
> to describe functions' calling conventions.
>
> However, because it's a necessary piece of information in
> Fortran, and because DW_CC_program is the only piece of debugging
> information whose definition refers to a 'main program' at all,
> several compilers have begun marking Fortran main programs with
> DW_CC_program --- even when those functions use the standard
> calling conventions.
>
> So until DWARF specifies a way to provide this information and
> compilers pick up the new representation, we'll support this
> practice. */
I think that's a great comment. Let's use that one.
--
Joel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Problems while debugging fortran
2007-10-25 20:24 ` Joel Brobecker
@ 2007-10-25 20:36 ` Carlos Eduardo Seo
2007-10-25 20:41 ` Joel Brobecker
2007-10-25 20:55 ` Problems while debugging fortran Andreas Schwab
0 siblings, 2 replies; 10+ messages in thread
From: Carlos Eduardo Seo @ 2007-10-25 20:36 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Jim Blandy, gdb, GDB Patches Mailing List, drow
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Joel Brobecker wrote:
> I think that's a great comment. Let's use that one.
>
All right. Here's the updated patch with Jim's comments. Ok now?
Regards,
- --
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
iD8DBQFHIP5Hqvq7Aov/qQARAg1wAKCKTPmOboGpEXy+4JOYI/t6ky5haQCfTSE4
K7lNORxqXOlJqRSJKSR/ZQk=
=aeaW
-----END PGP SIGNATURE-----
[-- Attachment #2: fortran-main.diff --]
[-- Type: text/x-patch, Size: 1468 bytes --]
2007-10-25 Wu Zhou <woodzltc@cn.ibm.com>
Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
Jim Blandy <jimb@codesourcery.com>
* dwarf2read.c (read_partial_die): check the value
of DW_AT_calling_convention in Fortran programs.
Index: src/gdb/dwarf2read.c
===================================================================
--- src.orig/gdb/dwarf2read.c
+++ src/gdb/dwarf2read.c
@@ -5616,6 +5616,24 @@ read_partial_die (struct partial_die_inf
case DW_AT_byte_size:
part_die->has_byte_size = 1;
break;
+ case DW_AT_calling_convention:
+ /* DWARF doesn't provide a way to identify a program's source-level
+ entry point. DW_AT_calling_convention attributes are only meant
+ to describe functions' calling conventions.
+
+ However, because it's a necessary piece of information in
+ Fortran, and because DW_CC_program is the only piece of debugging
+ information whose definition refers to a 'main program' at all,
+ several compilers have begun marking Fortran main programs with
+ DW_CC_program --- even when those functions use the standard
+ calling conventions.
+
+ So until DWARF specifies a way to provide this information and
+ compilers pick up the new representation, we'll support this
+ practice. */
+ if ((DW_UNSND (&attr) == DW_CC_program) && (cu->language == language_fortran))
+ set_main_name (part_die->name);
+ break;
default:
break;
}
[-- Attachment #3: fortran-main.diff.sig --]
[-- Type: application/octet-stream, Size: 65 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Problems while debugging fortran
2007-10-25 20:36 ` Carlos Eduardo Seo
@ 2007-10-25 20:41 ` Joel Brobecker
[not found] ` <4721034D.2060502@linux.vnet.ibm.com>
2007-10-25 20:55 ` Problems while debugging fortran Andreas Schwab
1 sibling, 1 reply; 10+ messages in thread
From: Joel Brobecker @ 2007-10-25 20:41 UTC (permalink / raw)
To: Carlos Eduardo Seo; +Cc: Jim Blandy, gdb, GDB Patches Mailing List, drow
> 2007-10-25 Wu Zhou <woodzltc@cn.ibm.com>
> Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
> Jim Blandy <jimb@codesourcery.com>
>
> * dwarf2read.c (read_partial_die): check the value
> of DW_AT_calling_convention in Fortran programs.
Just one minor comment:
> + if ((DW_UNSND (&attr) == DW_CC_program) && (cu->language == language_fortran))
Could you remove the unnecessary extra parens and split this line
into two (it's too long):
if (DW_UNSND (&attr) == DW_CC_program
&& cu->language == language_fortran)
Your patch is approved with that adjustment.
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: Problems while debugging fortran
2007-10-25 20:36 ` Carlos Eduardo Seo
2007-10-25 20:41 ` Joel Brobecker
@ 2007-10-25 20:55 ` Andreas Schwab
1 sibling, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2007-10-25 20:55 UTC (permalink / raw)
To: Carlos Eduardo Seo
Cc: Joel Brobecker, Jim Blandy, gdb, GDB Patches Mailing List, drow
Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> writes:
> + if ((DW_UNSND (&attr) == DW_CC_program) && (cu->language == language_fortran))
Please remove the extra parens and fold the line to keep it below 80
columns.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-11-13 17:45 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-25 16:07 Problems while debugging fortran François-Xavier Coudert
2007-10-25 17:06 ` Daniel Jacobowitz
2007-10-25 18:44 ` Jim Blandy
2007-10-25 19:01 ` Daniel Jacobowitz
2007-10-25 19:27 ` Jim Blandy
2007-10-25 20:24 ` Joel Brobecker
2007-10-25 20:36 ` Carlos Eduardo Seo
2007-10-25 20:41 ` Joel Brobecker
[not found] ` <4721034D.2060502@linux.vnet.ibm.com>
2007-11-13 17:45 ` Problems while debugging fortran -- DWARF Michael Eager
2007-10-25 20:55 ` Problems while debugging fortran Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox