public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Wu Zhou <woodzltc@cn.ibm.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: kamaraju@gmail.com, fortran@gcc.gnu.org, gdb@sources.redhat.com
Subject: Re: gfortran - gdb problem
Date: Tue, 26 Jul 2005 03:05:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.63.0507230335130.11626@localhost.localdomain> (raw)
In-Reply-To: <20050725130929.GA2090@nevyn.them.org>

> 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

  reply	other threads:[~2005-07-26  3:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-25  7:31 Wu Zhou
2005-07-25 13:09 ` Daniel Jacobowitz
2005-07-26  3:05   ` Wu Zhou [this message]
2005-07-26  3:19     ` Daniel Jacobowitz
2005-07-26  6:57       ` David Lecomber
2005-07-26  9:01       ` Wu Zhou
2005-07-26 13:06         ` Daniel Jacobowitz
2005-07-28  3:43           ` Wu Zhou

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=Pine.LNX.4.63.0507230335130.11626@localhost.localdomain \
    --to=woodzltc@cn.ibm.com \
    --cc=drow@false.org \
    --cc=fortran@gcc.gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=kamaraju@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).