This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix 'Undefined command' error message
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: Andrew STUBBS <andrew dot stubbs at st dot com>, gdb-patches at sources dot redhat dot com
- Date: Wed, 16 Nov 2005 15:13:00 -0500
- Subject: Re: [PATCH] Fix 'Undefined command' error message
- References: <4379EC0A.3060601@st.com> <u1x1h93u5.fsf@gnu.org>
On Tue, Nov 15, 2005 at 08:13:38PM +0200, Eli Zaretskii wrote:
> > Date: Tue, 15 Nov 2005 14:09:14 +0000
> > From: Andrew STUBBS <andrew.stubbs@st.com>
> >
> > - while (isalnum (*p) || *p == '-')
> > + while (*p && (isalnum (*p) || *p == '-' || *p == '_' ||
>
> Why is there a need for testing *p to be non-zero? AFAIK, isalnum is
> well defined for a zero argument.
Just to clarify when the end of the loop is? You're right, it should
not be necessary.
> > +#if defined(TUI)
> > + (tui_active &&
> > + (*p == '+' || *p == '<' || *p == '>' || *p == '$')) ||
> > +#endif
>
> What is the reason for additional tests under TUI?
The TUI has commands which include these. E.g. + is scroll forward;
search for add_com in tui/.
> > + (xdb_commands && (*p == '!' || *p == '/' || *p == '?'))))
>
> Is this for some kind of compatibility with XDB?
And xdb has some commands which include these, which GDB emulates, I
presume. ! is for an xdb-specific alias to shell. (With a comment
from Andrew above it mentioning that using a different syntax would be
more useful. Personally, I think we don't need to bind ! to that so
much as we need to bind it to bash-style command history.)
/ and ? are bound to forward and reverse search in the source file.
Found these with grep also, although it took me a little longer.
Does anyone use xdb compatibility any more? I suspect we could remove
it, but I've no way to know.
The other characters could presumably be allowed unconditionally
without doing any harm, but I haven't tried that.
--
Daniel Jacobowitz
CodeSourcery, LLC