This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] language support: case sensitivity
- To: David Taylor <taylor at cygnus dot com>
- Subject: Re: [PATCH] language support: case sensitivity
- From: Jimmy Guo <guo at cup dot hp dot com>
- Date: Thu, 3 Aug 2000 10:02:47 -0700 (PDT)
- Cc: gdb-patches at sourceware dot cygnus dot com
Actually the two commands added are:
set case-sensitive (on/off/auto)
show case-sensitive
It's not correct that nothing would be print if case sensitivity is set
same as the language default and if the user issues the show command.
As I said, do_setshow_command () in command.c handles that part.
Looking at the 'set/show language' implementation, there's nothing
different between the two -- one would expect that if this patch needs a
different command to support user query, then show_language would too.
Just to show this, here's what I got from GDB on a C application:
(gdb) show case-sensitive
Case sensitivity in name search is "auto; currently on".
(gdb) set case-sensitive on
(gdb) show case-sensitive
Case sensitivity in name search is "on".
(gdb) show language
The current source language is "auto; currently c".
(gdb) set language c
(gdb) show language
The current source language is "c".
- Jimmy
On Thu, 3 Aug 2000, David Taylor wrote:
> Date: Wed, 2 Aug 2000 09:55:23 -0700 (PDT)
> From: Jimmy Guo <guo@cup.hp.com>
>
> I don't quite understand yet the need for having a new show command
> routine ... command.c (do_setshow_command) seems to be the one that
> handle the normal output of settings. Also, show_language_command
> has similar setup as show_case_command (). Do you have an example on
> the kind of behavior you'd like to see but not supported currently by
> this patch?
>
> - Jimmy Guo, guo@cup.hp.com
>
>You added two commands:
>
> set case-sensitivity
> show case-sensitivity
>
>And if the user types "show case-sensitivity", nothing will print
>unless the sensitivity differs from that of the current language. I
>feel that if the user *ASKED* to be shown the case sensitivity, then
>the user should be *SHOWN* the case sensitivity. If the user
>explicitily asks what it is, then it should not be silent.
>
>So, you could have the command "show case-sensitivity" print something like:
>
> Case sensitivity is on.
> warning: current language, fortran, is case insensitive.
>
>Where the first line is printed by a new function (to be called when
>the user types "show case-sensitivity"), and the second line is
>printed by the function (renamed) that currently implements "show
>case-sensitivity".
>
>[...]
> >Your new function show_case_command plays double duty -- it is both
> >invoked by other functions / commands and it is invoked by the user in
> >response to the 'show case' command. And while it is quite reasonable
> >for it to be silent when it is *NOT* invoked by the user, it should
> >not be silent when it is invoked by the user.
> >
> >My suggestion is to define two functions:
> >
> >. one, the new show_case_command, which is never silent -- it always
> >tells you the setting.
> >
> >. the other, the current show_case_command, prints a warning if
> >appropriate and is called by the current callers of show_case_command.
> >
> >Otherwise it looks fine to me. Thanks for submitting this.
>
>