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


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

Daniel Jacobowitz wrote:
> On Thu, Oct 25, 2007 at 12:30:41PM -0700, Jim Blandy wrote:
>> This would be fine with me, too.
> 
> Me too.
> 

Ok. I added Joel's comments to the patch, replacing the original ones.
If no one has any other objections, I can commit this later.

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

iD8DBQFHIPF+qvq7Aov/qQARAjcnAJ0SBFHaOnQrkzN2C0hsKuuYr5bhLQCeJLMS
OI9Fa1ZuhUQ7/h9lV19q86w=
=+biI
-----END PGP SIGNATURE-----
2007-10-25  Wu Zhou  <woodzltc@cn.ibm.com>
	    Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>
	    Joel Brobecker  <brobecker@adacore.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,19 @@ read_partial_die (struct partial_die_inf
         case DW_AT_byte_size:
           part_die->has_byte_size = 1;
           break;
+	case DW_AT_calling_convention:
+	  /* In Fortran programs compiled with XLF, the only way we have found
+	     so far to identify the main procedure is by using the fact that
+	     the calling convention is different from the other procedures:
+	     The DW_AT_calling_convention attribute is set to DW_CC_program.
+
+	     This is not the intent of this attribute as documented in the
+	     DWARF standard, but we haven't found any other distinctive
+	     characteristic of the main procedure, so we check the calling
+	     convention for Fortran compilation units.  */
+	  if ((DW_UNSND (&attr) == DW_CC_program) && (cu->language == language_fortran))
+	    set_main_name (part_die->name);
+	  break;
 	default:
 	  break;
 	}

Attachment: fortran-main.diff.sig
Description: Binary data


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