This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] pascal: Add lowercase copy of symbol name
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 29 Apr 2010 16:09:17 -0700
- Subject: Re: [RFC] pascal: Add lowercase copy of symbol name
- References: <002101cae7e9$e7229540$b567bfc0$@muller@ics-cnrs.unistra.fr> <20100429223157.GA2768@adacore.com> <002a01cae7ee$e144b6d0$a3ce2470$@muller@ics-cnrs.unistra.fr>
> The problem is that if we want to keep the true case of the symbols
> (which I at least want), doing case-insensitive searching required
> practically to lowercase on the fly all pascal symbol each time an
> expression is evaluated. This is very inefficient.
The way Ada handles this is by lower-casing the expression being used
as the key, and then comparing it with the name stored in our symbol.
For instance, if the user does:
(gdb) print My_Variable
What GDB does is first lower-case "My_Variable" to "my_variable", and
then do a search of my_variable.
You could transpose that to Pascal by upper-casing My_Variable the
entity name in the expression before doing the search.
> There are some internal functions or variables inside Free Pascal
> that are lowercase to avoid possible conflict with explicitly
> declared functions or variables (who are completely UPPERCASED in
> Free Pascal).
Using Ada as an example, we have the same sort of issue, and what
we have been using is a special syntax to tell the parser to avoid
the casing-change:
(gdb) print <My_Variable>
Maybe you can do something similar for Pascal?
--
Joel