This is the mail archive of the gdb@sources.redhat.com 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: gfortran - gdb problem


> Really, GDB ought to know that the main function in a Fortran program
> is named MAIN__ and set that to the default location.

Daniel, thanks for the pointer.  I am trying to code a patch to fix this, 
but encounter another problem: when GDB tries to lookup "MAIN__" in the 
symtabs, it transfers "MAIN__" to lower cases first, so 

  lookup_symbol (main_name (), 0, VAR_DOMAIN, 0, NULL)

failed.  This attributes to the following code in symtab.c:

  if (case_sensitivity == case_sensitive_off)
    {
      char *copy;
      int len, i;

      len = strlen (name);
      copy = (char *) alloca (len + 1);
      for (i= 0; i < len; i++)
        copy[i] = tolower (name[i]);
      copy[len] = 0;
      modified_name = copy;
    }

My question here is: is it desirable to transfer the name to lower-case if 
the language is case insensitive.  My point is that the compiler could handle 
this and GDB needs only to handle what we get from the compiler.  

As for this case, I don't know how other case-insensitive languages behave. 
But it might helps to change the conditional expression to:

  case_sensitivity == case_sensitive_off && current_language->la_language != language_fortran

What do you think?  If there is any error, please correct me.  Thanks.

Regards
- Wu Zhou


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