This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Pascal symbols and case sensitivity
> > I think you have to be a little careful of not converting some of the
> > symbols were the "linkage name" is specifically specified. I don't know
> > if this is something that's actually possible with Pascal, but it is
> > something that Ada users sometimes do (Ada is also language insensitive).
>
> That explains why there is an exception for Ada in symbol_search_name.
Not quite, actually. The real issue why Ada needs an exception is that
we do not pre-compute the "natural" names, in order to conserve memory
(we compute the natural names on the fly, and always as temporary memory).
This decision has been at the root of a couple of headaches for me,
particularly performance-wise, but we had no choice, as some of the
projects at the time were too big to fit in the system's memory.
> Besides that I think it would be a good idea to fix the
> case_insensitivity language setting for all languages, so that it's not
> necessary to add it for each language that needs it?
Looks like the problem might be in symtab.c:lookup_symbol_in_language.
Not sure, but the code looks like this:
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;
}
returnval = lookup_symbol_aux (modified_name, block, domain, lang,
The case-lowering is done if case_sensitivity is set to off, but this is
the global setting, modified at user level. It looks like we should be
testing the language's la_case_sensitivity?
> How is it done for Ada? Does Ada use the case_sensitivity language
> setting?
Ada does not set the sensitivity to off - otherwise, we'd be having
issues with symbols where case matters.
Thinking about this so far, I tend to think that a language case-sensitivity
will not be a silver bullet, just because of the few exceptions that might
exist. It's really easy IMO to implement in the language-specific section,
and we could get rid of this language setting which has not been really
used until now.
--
Joel