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


Carlos Eduardo Seo <cseo at linux.vnet.ibm.com> writes:
> Joel Brobecker wrote:
>> [moving to gdb-patches]
>>
>> This is close to what I had in mind, but I would personally prefer
>> to limit this to Fortran compilation units.  The semantics of this
>> attribute value are still a bit unclear, and I'd like us to be cautious
>> in its usage.
>>
> Restricted this to Fortran.  Ok to commit now?
>
> --
> Carlos Eduardo Seo
> Software Engineer
> IBM Linux Technology Center
> 2007-10-25  Wu Zhou  <woodzltc@cn.ibm.com>
> 	    Carlos Eduardo Seo  <cseo@linux.vnet.ibm.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,13 @@ 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 standard suggests to use value DW_CC_program of attribute
> +	   DW_AT_calling_convention to indicate the Fortran main program.
> +	   The following code is to check this.  */

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.  */


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